From 426dd3312f31245622ec15c07824e406de9a76cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tomulik?= Date: Wed, 7 May 2014 17:23:03 +0200 Subject: [PATCH 001/152] minor corrections to python documentation --- Doc/Manual/Python.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index dcfd7427e..9b86652f4 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -5412,7 +5412,7 @@ class M3: pass

We edit pkg1/mod2.py and want to import module -pkg1/pkg2/pkg3.py in order to derive from class M3. We can +pkg1/pkg2/mod3.py in order to derive from class M3. We can write appropriate Python code in several ways, for example:

@@ -5570,8 +5570,8 @@ from __future__ import absolute_import

Imports in __init__.py are handy when you want to populate a package's namespace with names imported from other modules. In SWIG based projects this approach may also be used to split large pieces of code into -smaller modules, compile them in parallel and then re-assemble everything at another -level by importing submodules' contents in __init__.py, for +smaller modules, compile them in parallel and then re-assemble everything at +runtime by importing submodules' contents in __init__.py, for example.

Unfortunately import directives in __init__.py may cause problems, From 8d01b145f7d368348e702f88df6c091f5d7175a5 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 2 May 2014 07:07:15 +0100 Subject: [PATCH 002/152] Cosmetic rewording to workaround syntax highlighting bug in vim. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d83e0d31b..6d70f1da8 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ AH_BOTTOM([ /* Default language */ #define SWIG_LANG "-tcl" -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +/* Deal with attempt by Microsoft to deprecate C standard runtime functions */ #if defined(_MSC_VER) # define _CRT_SECURE_NO_DEPRECATE #endif @@ -489,7 +489,7 @@ if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then TCLCONFIG=`(cd ${with_tclconfig}; pwd)` else - AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh]) + AC_MSG_ERROR([${with_tcl} directory does not contain tclConfig.sh]) fi fi # check in a few common install locations From 575c7a113aa8237f130a9c094173b8f335dceff4 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 9 May 2014 23:23:39 +0100 Subject: [PATCH 003/152] html fixes --- Doc/Manual/Javascript.html | 192 ++++++++++++++++++++++++++----------- Doc/Manual/Lua.html | 90 ++++++++--------- 2 files changed, 179 insertions(+), 103 deletions(-) diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index e589d9d09..011e61051 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -6,10 +6,53 @@ -

SWIG and Javascript

+

26 SWIG and Javascript

+ +
+ +
+ + + +

This chapter describes SWIG's support of Javascript. It does not cover SWIG basics, but only information that is specific to this module.

-

Overview

+

26.1 Overview

+ +

Javascript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. Its arguably the most popular language for web development. Javascript has gone beyond being a browser-based scripting language and with node.js, it is also used as a backend development language.

Native Javascript extensions can be used for applications that embed a web-browser view or that embed a Javascript engine (such as node.js). Extending a general purpose web-browser is not possible as this would be a severe security issue.

@@ -18,9 +61,11 @@ Javascript has gone beyond being a browser-based scripting language and with node-webkit there is a platform which uses Google's Chromium as Web-Browser widget and node.js for javascript extensions.

-

Preliminaries

+

26.2 Preliminaries

+ + +

26.2.1 Running SWIG

-

Running SWIG

Suppose that you defined a SWIG module such as the following:

@@ -51,13 +96,15 @@ bool example_initialize(JSGlobalContextRef context, JSObjectRef *exports)

and for v8:

-void example_initialize(v8::Handle exports)
+void example_initialize(v8::Handle<v8::Object> exports)

-

Note: be aware that v8 has a C++ API, and thus, the generated modules must be compiled as C++.

+Note: be aware that v8 has a C++ API, and thus, the generated modules must be compiled as C++.

-

Running Tests and Examples

+

26.2.2 Running Tests and Examples

+ +

The configuration for tests and examples currently supports Linux and Mac only and not MinGW (Windows) yet.

The default interpreter is node.js as it is available on all platforms and convenient to use.

Running the examples with JavascriptCore requires libjavascriptcoregtk-1.0 to be installed, e.g., under Ubuntu with

@@ -98,19 +145,24 @@ $ make check-javascript-test-suite ENGINE=jsc - Windows 7 64bit (VS 2010) - Node.js
-

-

Future work

+

26.2.3 Future work

+ +

The Javascript module is not yet as mature as other modules and some things are still missing. As it makes use of SWIG's Unified Typemap Library (UTL), many typemaps are inherited. We could work on that if requested:

-

Integration

+

26.3 Integration

+ +

This chapter gives a short introduction how to use a native Javascript extension: as a node.js module, and as an extension for an embedded Webkit.

-

Creating node.js Extensions

+

26.3.1 Creating node.js Extensions

+ +

To install node.js you can download an installer from their web-site for OSX and Windows. For Linux you can either build the source yourself and run sudo checkinstall or keep to the (probably stone-age) packaged version. For Ubuntu there is a PPA available.

@@ -154,7 +206,9 @@ require("./build/Release/example")

A more detailed explanation is given in the Examples section.

-

Troubleshooting

+

26.3.1.1 Troubleshooting

+ + @@ -164,10 +218,14 @@ require("./build/Release/example") $ sudo apt-get remove gyp -

Embedded Webkit

+

26.3.2 Embedded Webkit

+ +

Webkit is pre-installed on OSX and available as a library for GTK.

-

OSX

+

26.3.2.1 OSX

+ +

There is general information about programming with WebKit on Apple Developer Documentation. Details about Cocoa programming are not covered here.

An integration of a native extension 'example' would look like this:

@@ -201,20 +259,22 @@ extern bool example_initialize(JSGlobalContextRef context); @end
-

GTK

+

26.3.2.2 GTK

+ +

There is general information about programming GTK at GTK documentation and in the GTK tutorial, and for Webkit there is a Webkit GTK+ API Reference.

An integration of a native extension 'example' would look like this:

-#include 
-#include 
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
 
 extern bool example_initialize(JSGlobalContextRef context);
 
 int main(int argc, char* argv[])
 {
     // Initialize GTK+
-    gtk_init(&argc, &argv);
+    gtk_init(&argc, &argv);
 
     ...
 
@@ -238,8 +298,9 @@ int main(int argc, char* argv[])
 }
-

Creating Applications with node-webkit

-

+

26.3.3 Creating Applications with node-webkit

+ +

To get started with node-webkit there is a very informative set of wiki pages.

Similar to node.js, node-webkit is started from command line within a node.js project directory. Native extensions are created in the very same way as for node.js, except that a customized gyp derivate has to be used: nw-gyp. @@ -328,10 +389,14 @@ open new windows, and many more things. }; -

Examples

+

26.4 Examples

+ +

Some basic examples are shown here in more detail.

-

Simple

+

26.4.1 Simple

+ +

The common example simple looks like this:

@@ -376,11 +441,12 @@ var f = example.Foo;
 example.Foo = 3.1415926;

First the module example is loaded from the previously built extension. Global methods and variables are available in the scope of the module.

-

-

Note: ECMAScript 5, the currently implemented Javascript standard, does not have modules. node.js and other implementations provide this mechanism defined by the CommonJS group. For browsers this is provided by Browserify, for instance.

-

-

Class

+

Note: ECMAScript 5, the currently implemented Javascript standard, does not have modules. node.js and other implementations provide this mechanism defined by the CommonJS group. For browsers this is provided by Browserify, for instance.

+ +

26.4.2 Class

+ +

The common example class defines three classes, Shape, Circle, and Square:

@@ -455,47 +521,47 @@ new Shape();
 $ node -i
-> var example = require("./build/Release/example");
+& var example = require("./build/Release/example");
 undefined
-> var Shape = example.Shape;
+& var Shape = example.Shape;
 undefined
-> var Circle = example.Circle;
+& var Circle = example.Circle;
 undefined
-> var Square = example.Square;
+& var Square = example.Square;
 undefined
-> var c = new Circle(10);
+& var c = new Circle(10);
 undefined
-> var s = new Square(10);
+& var s = new Square(10);
 undefined
-> Shape.nshapes;
+& Shape.nshapes;
 2
-> c.x = 20;
+& c.x = 20;
 20
-> c.y = 30;
+& c.y = 30;
 30
-> s.x = -10;
+& s.x = -10;
 -10
-> s.y = 5;
+& s.y = 5;
 5
-> c.area();
+& c.area();
 314.1592653589793
-> c.perimeter();
+& c.perimeter();
 62.83185307179586
-> s.area();
+& s.area();
 100
-> s.perimeter();
+& s.perimeter();
 40
-> c.move(40, 40)
+& c.move(40, 40)
 undefined
-> c.x
+& c.x
 60
-> c.y
+& c.y
 70
-> new Shape()
+& new Shape()
 Error: Class Shape can not be instantiated
 at repl:1:2
 at REPLServer.self.eval (repl.js:110:21)
-at Interface. (repl.js:239:12)
+at Interface.<anonymous> (repl.js:239:12)
 at Interface.EventEmitter.emit (events.js:95:17)
 at Interface._onLine (readline.js:202:10)
 at Interface._line (readline.js:531:8)
@@ -505,13 +571,17 @@ at ReadStream.EventEmitter.emit (events.js:98:17)
 at emitKey (readline.js:1095:12)

-

Note: In ECMAScript 5 there is no concept for classes. Instead each function can be used as a constructor function which is executed by the 'new' operator. Furthermore, during construction the key property prototype of the constructor function is used to attach a prototype instance to the created object. A prototype is essentially an object itself that is the first-class delegate of a class used whenever the access to a property of an object fails. The very same prototype instance is shared among all instances of one type. Prototypal inheritance is explained in more detail on in Inheritance and the prototype chain, for instance.

+Note: In ECMAScript 5 there is no concept for classes. Instead each function can be used as a constructor function which is executed by the 'new' operator. Furthermore, during construction the key property prototype of the constructor function is used to attach a prototype instance to the created object. A prototype is essentially an object itself that is the first-class delegate of a class used whenever the access to a property of an object fails. The very same prototype instance is shared among all instances of one type. Prototypal inheritance is explained in more detail on in Inheritance and the prototype chain, for instance.

-

Implementation

+

26.5 Implementation

+ +

The Javascript Module implementation has taken a very different approach compared to other language modules in order to support different Javascript interpreters.

-

Source Code

+

26.5.1 Source Code

+ +

The Javascript module is implemented in Source/Modules/javascript.cxx. It dispatches the code generation to a JSEmitter instance, V8Emitter or JSCEmitter. Additionally there are some helpers: Template, for templated code generation, and JSEmitterState, which is used to manage state information during AST traversal. This rough map shall make it easier to find a way through this huge source file:

@@ -610,7 +680,9 @@ Template::Template(const String *code_) { ... }
 ...
-

Code Templates

+

26.5.2 Code Templates

+ +

All generated code is created on the basis of code templates. The templates for JavascriptCore can be found in Lib/javascript/jsc/javascriptcode.swg, for v8 in Lib/javascript/v8/javascriptcode.swg.

To track the originating code template for generated code you can run

@@ -647,7 +719,9 @@ t_register.replace("$jsparent", state.clazz(NAME_MANGLED))

Template creates a copy of that string and Template::replace uses Swig's Replaceall to replace variables in the template. Template::trim can be used to eliminate leading and trailing whitespaces. Template::print is used to write the final template string to a Swig DOH (based on Printv). All methods allow chaining.

-

Emitter

+

26.5.3 Emitter

+ +

The Javascript module delegates code generation to a JSEmitter instance. The following extract shows the essential interface:

@@ -730,7 +804,7 @@ class JSEmitter {
    */
   Template getTemplate(const String *name);
 
-  State &getState();
+  State &getState();
 
   ...
 
@@ -740,12 +814,12 @@ class JSEmitter {
 
 int JAVASCRIPT::top(Node *n) {
-  emitter->initialize(n);
+  emitter->initialize(n);
 
   Language::top(n);
 
-  emitter->dump(n);
-  emitter->close();
+  emitter->dump(n);
+  emitter->close();
 
   return SWIG_OK;
 }
@@ -755,16 +829,18 @@ int JAVASCRIPT::top(Node *n) {
 int JAVASCRIPT::classHandler(Node *n) {
 
-  emitter->enterClass(n);
+  emitter->enterClass(n);
   Language::classHandler(n);
-  emitter->exitClass(n);
+  emitter->exitClass(n);
 
   return SWIG_OK;
 }

In enterClass the emitter stores state information that is necessary when processing class members. In exitClass the wrapper code for the whole class is generated.

-

Emitter states

+

26.5.4 Emitter states

+ +

For storing information during the AST traversal the emitter provides a JSEmitterState with different slots to store data representing the scopes global, class, function, and variable.

diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html
index 269cb2801..61f19be68 100644
--- a/Doc/Manual/Lua.html
+++ b/Doc/Manual/Lua.html
@@ -6,7 +6,7 @@
 
 
 
-

27 SWIG and Lua

+

28 SWIG and Lua

    @@ -82,14 +82,14 @@ Lua is an extension programming language designed to support general procedural eLua stands for Embedded Lua (can be thought of as a flavor of Lua) and offers the full implementation of the Lua programming language to the embedded world, extending it with specific features for efficient and portable software embedded development. eLua runs on smaller devices like microcontrollers and provides the full features of the regular Lua desktop version. More information on eLua can be found here: http://www.eluaproject.net

    -

    27.1 Preliminaries

    +

    28.1 Preliminaries

    The current SWIG implementation is designed to work with Lua 5.0.x, 5.1.x and 5.2.x. It should work with later versions of Lua, but certainly not with Lua 4.0 due to substantial API changes. It is possible to either static link or dynamic link a Lua module into the interpreter (normally Lua static links its libraries, as dynamic linking is not available on all platforms). SWIG also has support for eLua starting from eLua 0.8. Due to substantial changes between SWIG 2.x and SWIG 3.0 and unavailability of testing platform, eLua status was downgraded to 'experimental'.

    -

    27.2 Running SWIG

    +

    28.2 Running SWIG

    @@ -137,7 +137,7 @@ $ swig -lua -eluac example.i The -elua option puts all the C function wrappers and variable get/set wrappers in rotables. It also generates a metatable which will control the access to these variables from eLua. It also offers a significant amount of module size compression. On the other hand, the -eluac option puts all the wrappers in a single rotable. With this option, no matter how huge the module, it will consume no additional microcontroller SRAM (crass compression). There is a catch though: Metatables are not generated with -eluac. To access any value from eLua, one must directly call the wrapper function associated with that value.

    -

    27.2.1 Additional command line options

    +

    28.2.1 Additional command line options

    @@ -178,7 +178,7 @@ swig -lua -help -

    27.2.2 Compiling and Linking and Interpreter

    +

    28.2.2 Compiling and Linking and Interpreter

    @@ -249,7 +249,7 @@ LUALIB_API int ( luaopen_mod )(lua_State *L ); More information on building and configuring eLua can be found here: http://www.eluaproject.net/doc/v0.8/en_building.html

    -

    27.2.3 Compiling a dynamic module

    +

    28.2.3 Compiling a dynamic module

    @@ -317,7 +317,7 @@ Is quite obvious (Go back and consult the Lua documents on how to enable loadlib -

    27.2.4 Using your module

    +

    28.2.4 Using your module

    @@ -335,19 +335,19 @@ $ ./my_lua >

-

27.3 A tour of basic C/C++ wrapping

+

28.3 A tour of basic C/C++ wrapping

By default, SWIG tries to build a very natural Lua interface to your C/C++ code. This section briefly covers the essential aspects of this wrapping.

-

27.3.1 Modules

+

28.3.1 Modules

The SWIG module directive specifies the name of the Lua module. If you specify `module example', then everything is wrapped into a Lua table 'example' containing all the functions and variables. When choosing a module name, make sure you don't use the same name as a built-in Lua command or standard module name.

-

27.3.2 Functions

+

28.3.2 Functions

@@ -388,7 +388,7 @@ It is also possible to rename the module with an assignment. 24

-

27.3.3 Global variables

+

28.3.3 Global variables

@@ -476,7 +476,7 @@ If you have used the -eluac option for your eLua module, you will have In general, functions of the form "variable_get()" and "variable_set()" are automatically generated by SWIG for use with -eluac.

-

27.3.4 Constants and enums

+

28.3.4 Constants and enums

@@ -511,7 +511,7 @@ If you're using eLua and have used -elua or -eluac to generate Hello World

-

27.3.4.1 Constants/enums and classes/structures

+

28.3.4.1 Constants/enums and classes/structures

@@ -567,7 +567,7 @@ If the -no-old-metatable-bindings option is used, then these old-style It is worth mentioning, that example.Test.TEST1 and example.Test_TEST1 are different entities and changing one does not change the other. Given the fact that these are constantes and they are not supposed to be changed, it is up to you to avoid such issues.

-

27.3.5 Pointers

+

28.3.5 Pointers

@@ -605,7 +605,7 @@ Lua enforces the integrity of its userdata, so it is virtually impossible to cor nil -

27.3.6 Structures

+

28.3.6 Structures

@@ -709,7 +709,7 @@ For eLua with the -eluac option, structure manipulation has to be perfo In general, functions of the form "new_struct()", "struct_member_get()", "struct_member_set()" and "free_struct()" are automatically generated by SWIG for each structure defined in C. (Please note: This doesn't apply for modules generated with the -elua option)

-

27.3.7 C++ classes

+

28.3.7 C++ classes

@@ -784,7 +784,7 @@ Both style names are generated by default now. However, if the -no-old-metatable-bindings option is used, then the backward compatible names are not generated in addition to ordinary ones.

-

27.3.8 C++ inheritance

+

28.3.8 C++ inheritance

@@ -809,7 +809,7 @@ then the function spam() accepts a Foo pointer or a pointer to any clas

It is safe to use multiple inheritance with SWIG.

-

27.3.9 Pointers, references, values, and arrays

+

28.3.9 Pointers, references, values, and arrays

@@ -840,7 +840,7 @@ Foo spam7();

then all three functions will return a pointer to some Foo object. Since the third function (spam7) returns a value, newly allocated memory is used to hold the result and a pointer is returned (Lua will release this memory when the return value is garbage collected). The other two are pointers which are assumed to be managed by the C code and so will not be garbage collected.

-

27.3.10 C++ overloaded functions

+

28.3.10 C++ overloaded functions

@@ -926,7 +926,7 @@ Please refer to the "SWIG and C++" chapter for more information about overloadin

Dealing with the Lua coercion mechanism, the priority is roughly (integers, floats, strings, userdata). But it is better to rename the functions rather than rely upon the ordering.

-

27.3.11 C++ operators

+

28.3.11 C++ operators

@@ -1058,9 +1058,9 @@ operators and pseudo-operators):

  • __setitem__
  • __tostring used internally by Lua for tostring() function. __str__ is mapped to this function -

    No other lua metafunction is inherited. For example, __gc is not inherited and must be redefined in every class. __tostring is subject to a special handling. If absent in class and in class bases, a default one will be provided by SWIG

    +

    No other lua metafunction is inherited. For example, __gc is not inherited and must be redefined in every class. __tostring is subject to a special handling. If absent in class and in class bases, a default one will be provided by SWIG.

    -

    27.3.12 Class extension with %extend

    +

    28.3.12 Class extension with %extend

    @@ -1116,7 +1116,7 @@ true Extend works with both C and C++ code, on classes and structs. It does not modify the underlying object in any way---the extensions only show up in the Lua interface. The only item to take note of is the code has to use the '$self' instead of 'this', and that you cannot access protected/private members of the code (as you are not officially part of the class).

    -

    27.3.13 Using %newobject to release memory

    +

    28.3.13 Using %newobject to release memory

    If you have a function that allocates memory like this,

    @@ -1140,7 +1140,7 @@ char *foo();

    This will release the allocated memory.

    -

    27.3.14 C++ templates

    +

    28.3.14 C++ templates

    @@ -1175,7 +1175,7 @@ In Lua:

    Obviously, there is more to template wrapping than shown in this example. More details can be found in the SWIG and C++ chapter. Some more complicated examples will appear later.

    -

    27.3.15 C++ Smart Pointers

    +

    28.3.15 C++ Smart Pointers

    @@ -1227,7 +1227,7 @@ If you ever need to access the underlying pointer returned by operator->( > f = p:__deref__() -- Returns underlying Foo * -

    27.3.16 C++ Exceptions

    +

    28.3.16 C++ Exceptions

    @@ -1370,7 +1370,7 @@ and the "Exception handling add exception specification to functions or globally (respectively).

    -

    27.3.17 Namespaces

    +

    28.3.17 Namespaces

    @@ -1421,7 +1421,7 @@ Now, from Lua usage is as follows: 19 > -

    27.3.17.1 Compatibility Note

    +

    28.3.17.1 Compatibility Note

    @@ -1437,7 +1437,7 @@ If SWIG is running in a backwards compatible way, i.e. without the -no-old-m -

    27.3.17.2 Names

    +

    28.3.17.2 Names

    If SWIG is launched without -no-old-metatable-bindings option, then it enters backward-compatible mode. While in this mode, it tries @@ -1481,7 +1481,7 @@ surrounding scope without any prefixing. Pretending that Test2 is a struct, not > -

    27.3.17.3 Inheritance

    +

    28.3.17.3 Inheritance

    The internal organization of inheritance has changed. @@ -1522,12 +1522,12 @@ function > -

    27.4 Typemaps

    +

    28.4 Typemaps

    This section explains what typemaps are and how to use them. The default wrapping behaviour of SWIG is enough in most cases. However sometimes SWIG may need a little additional assistance to know which typemap to apply to provide the best wrapping. This section will be explaining how to use typemaps to best effect

    -

    27.4.1 What is a typemap?

    +

    28.4.1 What is a typemap?

    A typemap is nothing more than a code generation rule that is attached to a specific C datatype. For example, to convert integers from Lua to C, you might define a typemap like this:

    @@ -1555,7 +1555,7 @@ Received an integer : 6 720 -

    27.4.2 Using typemaps

    +

    28.4.2 Using typemaps

    There are many ready written typemaps built into SWIG for all common types (int, float, short, long, char*, enum and more), which SWIG uses automatically, with no effort required on your part.

    @@ -1608,7 +1608,7 @@ void swap(int *sx, int *sy);

    Note: C++ references must be handled exactly the same way. However SWIG will automatically wrap a const int& as an input parameter (since that it obviously input).

    -

    27.4.3 Typemaps and arrays

    +

    28.4.3 Typemaps and arrays

    Arrays present a challenge for SWIG, because like pointers SWIG does not know whether these are input or output values, nor @@ -1672,7 +1672,7 @@ and Lua tables to be 1..N, (the indexing follows the norm for the language). In

    Note: SWIG also can support arrays of pointers in a similar manner.

    -

    27.4.4 Typemaps and pointer-pointer functions

    +

    28.4.4 Typemaps and pointer-pointer functions

    Several C++ libraries use a pointer-pointer functions to create its objects. These functions require a pointer to a pointer which is then filled with the pointer to the new object. Microsoft's COM and DirectX as well as many other libraries have this kind of function. An example is given below:

    @@ -1706,7 +1706,7 @@ int Create_Math(iMath** pptr); // its creator (assume it mallocs) ptr=nil -- the iMath* will be GC'ed as normal -

    27.5 Writing typemaps

    +

    28.5 Writing typemaps

    This section describes how you can modify SWIG's default wrapping behavior for various C/C++ datatypes using the %typemap directive. This is an advanced topic that assumes familiarity with the Lua C API as well as the material in the "Typemaps" chapter.

    @@ -1715,7 +1715,7 @@ ptr=nil -- the iMath* will be GC'ed as normal

    Before proceeding, you should read the previous section on using typemaps, and look at the existing typemaps found in luatypemaps.swg and typemaps.i. These are both well documented and fairly easy to read. You should not attempt to write your own typemaps until you have read and can understand both of these files (they may well also give you an idea to base your work on).

    -

    27.5.1 Typemaps you can write

    +

    28.5.1 Typemaps you can write

    There are many different types of typemap that can be written, the full list can be found in the "Typemaps" chapter. However the following are the most commonly used ones.

    @@ -1728,7 +1728,7 @@ ptr=nil -- the iMath* will be GC'ed as normal (the syntax for the typecheck is different from the typemap, see typemaps for details).
  • -

    27.5.2 SWIG's Lua-C API

    +

    28.5.2 SWIG's Lua-C API

    This section explains the SWIG specific Lua-C API. It does not cover the main Lua-C api, as this is well documented and not worth covering.

    @@ -1777,7 +1777,7 @@ This macro, when called within the context of a SWIG wrapped function, will disp
    Similar to SWIG_fail_arg, except that it will display the swig_type_info information instead.
    -

    27.6 Customization of your Bindings

    +

    28.6 Customization of your Bindings

    @@ -1786,7 +1786,7 @@ This section covers adding of some small extra bits to your module to add the la -

    27.6.1 Writing your own custom wrappers

    +

    28.6.1 Writing your own custom wrappers

    @@ -1805,7 +1805,7 @@ int native_function(lua_State*L) // my native code The %native directive in the above example, tells SWIG that there is a function int native_function(lua_State*L); which is to be added into the module under the name 'my_func'. SWIG will not add any wrapper for this function, beyond adding it into the function table. How you write your code is entirely up to you.

    -

    27.6.2 Adding additional Lua code

    +

    28.6.2 Adding additional Lua code

    @@ -1843,7 +1843,7 @@ Good uses for this feature is adding of new code, or writing helper functions to See Examples/lua/arrays for an example of this code.

    -

    27.7 Details on the Lua binding

    +

    28.7 Details on the Lua binding

    @@ -1854,7 +1854,7 @@ See Examples/lua/arrays for an example of this code.

    -

    27.7.1 Binding global data into the module.

    +

    28.7.1 Binding global data into the module.

    @@ -1914,7 +1914,7 @@ end

    That way when you call 'a=example.Foo', the interpreter looks at the table 'example' sees that there is no field 'Foo' and calls __index. This will in turn check in '.get' table and find the existence of 'Foo' and then return the value of the C function call 'Foo_get()'. Similarly for the code 'example.Foo=10', the interpreter will check the table, then call the __newindex which will then check the '.set' table and call the C function 'Foo_set(10)'.

    -

    27.7.2 Userdata and Metatables

    +

    28.7.2 Userdata and Metatables

    @@ -1994,7 +1994,7 @@ Note: Both the opaque structures (like the FILE*) and normal wrapped classes/str

    Note: Operator overloads are basically done in the same way, by adding functions such as '__add' & '__call' to the class' metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming its an operator overload.

    -

    27.7.3 Memory management

    +

    28.7.3 Memory management

    From 4a680e5545af57bd866a8211679b3d953e286545 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 9 May 2014 23:26:59 +0100 Subject: [PATCH 004/152] html doc chapter numbering update since adding Javascript --- Doc/Manual/Contents.html | 69 +++++++++++--- Doc/Manual/Extending.html | 100 +++++++++---------- Doc/Manual/Lisp.html | 22 ++--- Doc/Manual/Modula3.html | 40 ++++---- Doc/Manual/Mzscheme.html | 8 +- Doc/Manual/Ocaml.html | 62 ++++++------ Doc/Manual/Octave.html | 48 +++++----- Doc/Manual/Perl5.html | 108 ++++++++++----------- Doc/Manual/Php.html | 48 +++++----- Doc/Manual/Pike.html | 24 ++--- Doc/Manual/Python.html | 164 +++++++++++++++---------------- Doc/Manual/R.html | 16 ++-- Doc/Manual/Ruby.html | 196 +++++++++++++++++++------------------- Doc/Manual/Tcl.html | 92 +++++++++--------- 14 files changed, 519 insertions(+), 478 deletions(-) diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html index 7cf40b95d..37a5aacff 100644 --- a/Doc/Manual/Contents.html +++ b/Doc/Manual/Contents.html @@ -1046,7 +1046,48 @@ -

    26 SWIG and Common Lisp

    +

    26 SWIG and Javascript

    + + + + + +

    27 SWIG and Common Lisp

    @@ -1069,7 +1110,7 @@
    -

    27 SWIG and Lua

    +

    28 SWIG and Lua

    @@ -1137,7 +1178,7 @@
    -

    28 SWIG and Modula-3

    +

    29 SWIG and Modula-3

    @@ -1175,7 +1216,7 @@
    -

    29 SWIG and MzScheme/Racket

    +

    30 SWIG and MzScheme/Racket

    @@ -1187,7 +1228,7 @@
    -

    30 SWIG and Ocaml

    +

    31 SWIG and Ocaml

    @@ -1238,7 +1279,7 @@
    -

    31 SWIG and Octave

    +

    32 SWIG and Octave

    @@ -1274,7 +1315,7 @@
    -

    32 SWIG and Perl5

    +

    33 SWIG and Perl5

    @@ -1350,7 +1391,7 @@
    -

    33 SWIG and PHP

    +

    34 SWIG and PHP

    @@ -1390,7 +1431,7 @@
    -

    34 SWIG and Pike

    +

    35 SWIG and Pike

    @@ -1414,7 +1455,7 @@
    -

    35 SWIG and Python

    +

    36 SWIG and Python

    @@ -1530,7 +1571,7 @@
    -

    36 SWIG and R

    +

    37 SWIG and R

    @@ -1546,7 +1587,7 @@
    -

    37 SWIG and Ruby

    +

    38 SWIG and Ruby

    @@ -1680,7 +1721,7 @@
    -

    38 SWIG and Tcl

    +

    39 SWIG and Tcl

    @@ -1746,7 +1787,7 @@
    -

    39 Extending SWIG to support new languages

    +

    40 Extending SWIG to support new languages

    diff --git a/Doc/Manual/Extending.html b/Doc/Manual/Extending.html index 5c209bbb5..00302d7b5 100644 --- a/Doc/Manual/Extending.html +++ b/Doc/Manual/Extending.html @@ -6,7 +6,7 @@ -

    39 Extending SWIG to support new languages

    +

    40 Extending SWIG to support new languages

      @@ -75,7 +75,7 @@ -

      39.1 Introduction

      +

      40.1 Introduction

      @@ -91,7 +91,7 @@ Also, this chapter is not meant to be a hand-holding tutorial. As a starting po you should probably look at one of SWIG's existing modules.

      -

      39.2 Prerequisites

      +

      40.2 Prerequisites

      @@ -121,7 +121,7 @@ obvious, but almost all SWIG directives as well as the low-level generation of wrapper code are driven by C++ datatypes.

      -

      39.3 The Big Picture

      +

      40.3 The Big Picture

      @@ -158,7 +158,7 @@ role in making the system work. For example, both typemaps and declaration anno based on pattern matching and interact heavily with the underlying type system.

      -

      39.4 Execution Model

      +

      40.4 Execution Model

      @@ -203,7 +203,7 @@ latter stage of compilation. The next few sections briefly describe some of these stages.

      -

      39.4.1 Preprocessing

      +

      40.4.1 Preprocessing

      @@ -284,7 +284,7 @@ been expanded as well as everything else that goes into the low-level construction of the wrapper code.

      -

      39.4.2 Parsing

      +

      40.4.2 Parsing

      @@ -385,7 +385,7 @@ returning a foo and taking types a and b as arguments).

      -

      39.4.3 Parse Trees

      +

      40.4.3 Parse Trees

      @@ -640,7 +640,7 @@ $ swig -c++ -python -debug-module 4 example.i

    -

    39.4.4 Attribute namespaces

    +

    40.4.4 Attribute namespaces

    @@ -659,7 +659,7 @@ that matches the name of the target language. For example, python:foo perl:foo.

    -

    39.4.5 Symbol Tables

    +

    40.4.5 Symbol Tables

    @@ -750,7 +750,7 @@ example.i:5. Previous declaration is foo_i(int )

    -

    39.4.6 The %feature directive

    +

    40.4.6 The %feature directive

    @@ -806,7 +806,7 @@ For example, the exception code above is simply stored without any modifications.

    -

    39.4.7 Code Generation

    +

    40.4.7 Code Generation

    @@ -928,7 +928,7 @@ public : The role of these functions is described shortly.

    -

    39.4.8 SWIG and XML

    +

    40.4.8 SWIG and XML

    @@ -941,7 +941,7 @@ internal data structures, it may be useful to keep XML in the back of your mind as a model.

    -

    39.5 Primitive Data Structures

    +

    40.5 Primitive Data Structures

    @@ -987,7 +987,7 @@ typedef Hash Typetab; -

    39.5.1 Strings

    +

    40.5.1 Strings

    @@ -1128,7 +1128,7 @@ Returns the number of replacements made (if any). -

    39.5.2 Hashes

    +

    40.5.2 Hashes

    @@ -1205,7 +1205,7 @@ Returns the list of hash table keys. -

    39.5.3 Lists

    +

    40.5.3 Lists

    @@ -1294,7 +1294,7 @@ If t is not a standard object, it is assumed to be a char * and is used to create a String object. -

    39.5.4 Common operations

    +

    40.5.4 Common operations

    The following operations are applicable to all datatypes. @@ -1349,7 +1349,7 @@ objects and report errors. Gets the line number associated with x. -

    39.5.5 Iterating over Lists and Hashes

    +

    40.5.5 Iterating over Lists and Hashes

    To iterate over the elements of a list or a hash table, the following functions are used: @@ -1394,7 +1394,7 @@ for (j = First(j); j.item; j= Next(j)) { -

    39.5.6 I/O

    +

    40.5.6 I/O

    Special I/O functions are used for all internal I/O. These operations @@ -1528,7 +1528,7 @@ Printf(f, "%s\n", s); Similarly, the preprocessor and parser all operate on string-files.

    -

    39.6 Navigating and manipulating parse trees

    +

    40.6 Navigating and manipulating parse trees

    Parse trees are built as collections of hash tables. Each node is a hash table in which @@ -1662,7 +1662,7 @@ Deletes a node from the parse tree. Deletion reconnects siblings and properly u the parent so that sibling nodes are unaffected. -

    39.7 Working with attributes

    +

    40.7 Working with attributes

    @@ -1779,7 +1779,7 @@ the attribute is optional. Swig_restore() must always be called after function. -

    39.8 Type system

    +

    40.8 Type system

    @@ -1788,7 +1788,7 @@ pointers, references, and pointers to members. A detailed discussion of type theory is impossible here. However, let's cover the highlights.

    -

    39.8.1 String encoding of types

    +

    40.8.1 String encoding of types

    @@ -1889,7 +1889,7 @@ make the final type, the two parts are just joined together using string concatenation.

    -

    39.8.2 Type construction

    +

    40.8.2 Type construction

    @@ -2058,7 +2058,7 @@ Returns the prefix of a type. For example, if ty is ty is unmodified. -

    39.8.3 Type tests

    +

    40.8.3 Type tests

    @@ -2145,7 +2145,7 @@ Checks if ty is a varargs type. Checks if ty is a templatized type. -

    39.8.4 Typedef and inheritance

    +

    40.8.4 Typedef and inheritance

    @@ -2247,7 +2247,7 @@ Fully reduces ty according to typedef rules. Resulting datatype will consist only of primitive typenames. -

    39.8.5 Lvalues

    +

    40.8.5 Lvalues

    @@ -2284,7 +2284,7 @@ Literal y; // type = 'Literal', ltype='p.char' -

    39.8.6 Output functions

    +

    40.8.6 Output functions

    @@ -2346,7 +2346,7 @@ SWIG, but is most commonly associated with type-descriptor objects that appear in wrappers (e.g., SWIGTYPE_p_double). -

    39.9 Parameters

    +

    40.9 Parameters

    @@ -2445,7 +2445,7 @@ included. Used to emit prototypes. Returns the number of required (non-optional) arguments in p. -

    39.10 Writing a Language Module

    +

    40.10 Writing a Language Module

    @@ -2460,7 +2460,7 @@ describes the creation of a minimal Python module. You should be able to extra this to other languages.

    -

    39.10.1 Execution model

    +

    40.10.1 Execution model

    @@ -2470,7 +2470,7 @@ the parsing of command line options, all aspects of code generation are controll different methods of the Language that must be defined by your module.

    -

    39.10.2 Starting out

    +

    40.10.2 Starting out

    @@ -2578,7 +2578,7 @@ that activates your module. For example, swig -python foo.i. The messages from your new module should appear.

    -

    39.10.3 Command line options

    +

    40.10.3 Command line options

    @@ -2637,7 +2637,7 @@ to mark the option as valid. If you forget to do this, SWIG will terminate wit unrecognized command line option error.

    -

    39.10.4 Configuration and preprocessing

    +

    40.10.4 Configuration and preprocessing

    @@ -2686,7 +2686,7 @@ an implementation file python.cxx and a configuration file python.swg.

    -

    39.10.5 Entry point to code generation

    +

    40.10.5 Entry point to code generation

    @@ -2744,7 +2744,7 @@ int Python::top(Node *n) { -

    39.10.6 Module I/O and wrapper skeleton

    +

    40.10.6 Module I/O and wrapper skeleton

    @@ -2892,7 +2892,7 @@ functionWrapper : void Shape_y_set(Shape *self,double y) -

    39.10.7 Low-level code generators

    +

    40.10.7 Low-level code generators

    @@ -3046,7 +3046,7 @@ but without the typemaps, there is still work to do.

    -

    39.10.8 Configuration files

    +

    40.10.8 Configuration files

    @@ -3190,7 +3190,7 @@ politely displays the ignoring language message. -

    39.10.9 Runtime support

    +

    40.10.9 Runtime support

    @@ -3199,7 +3199,7 @@ Discuss the kinds of functions typically needed for SWIG runtime support (e.g. the SWIG files that implement those functions.

    -

    39.10.10 Standard library files

    +

    40.10.10 Standard library files

    @@ -3218,7 +3218,7 @@ The following are the minimum that are usually supported: Please copy these and modify for any new language.

    -

    39.10.11 User examples

    +

    40.10.11 User examples

    @@ -3247,7 +3247,7 @@ during this process, see the section on .

    -

    39.10.12 Test driven development and the test-suite

    +

    40.10.12 Test driven development and the test-suite

    @@ -3306,7 +3306,7 @@ It is therefore essential that the runtime tests are written in a manner that di but error/exception out with an error message on stderr on failure.

    -

    39.10.12.1 Running the test-suite

    +

    40.10.12.1 Running the test-suite

    @@ -3498,7 +3498,7 @@ It can be run in the same way as the other language test-suites, replacing [lang The test cases used and the way it works is described in Examples/test-suite/errors/Makefile.in.

    -

    39.10.13 Documentation

    +

    40.10.13 Documentation

    @@ -3530,7 +3530,7 @@ Some topics that you'll want to be sure to address include: if available. -

    39.10.14 Prerequisites for adding a new language module to the SWIG distribution

    +

    40.10.14 Prerequisites for adding a new language module to the SWIG distribution

    @@ -3587,7 +3587,7 @@ should be added should there be an area not already covered by the existing tests.

    -

    39.10.15 Coding style guidelines

    +

    40.10.15 Coding style guidelines

    @@ -3611,7 +3611,7 @@ The generated C/C++ code should also follow this style as close as possible. How should be avoided as unlike the SWIG developers, users will never have consistent tab settings.

    -

    39.11 Debugging Options

    +

    40.11 Debugging Options

    @@ -3638,7 +3638,7 @@ There are various command line options which can aid debugging a SWIG interface The complete list of command line options for SWIG are available by running swig -help.

    -

    39.12 Guide to parse tree nodes

    +

    40.12 Guide to parse tree nodes

    @@ -4046,7 +4046,7 @@ extern "X" { ... } declaration. -

    39.13 Further Development Information

    +

    40.13 Further Development Information

    diff --git a/Doc/Manual/Lisp.html b/Doc/Manual/Lisp.html index 7ea9139ac..0b8d47846 100644 --- a/Doc/Manual/Lisp.html +++ b/Doc/Manual/Lisp.html @@ -6,7 +6,7 @@ -

    26 SWIG and Common Lisp

    +

    27 SWIG and Common Lisp

      @@ -41,7 +41,7 @@ Lisp, Common Foreign Function Interface(CFFI), CLisp and UFFI foreign function interfaces.

      -

      26.1 Allegro Common Lisp

      +

      27.1 Allegro Common Lisp

      @@ -50,7 +50,7 @@ here

      -

      26.2 Common Foreign Function Interface(CFFI)

      +

      27.2 Common Foreign Function Interface(CFFI)

      @@ -77,7 +77,7 @@ swig -cffi -module module-name file-name files and the various things which you can do with them.

      -

      26.2.1 Additional Commandline Options

      +

      27.2.1 Additional Commandline Options

      @@ -118,7 +118,7 @@ swig -cffi -help -

      26.2.2 Generating CFFI bindings

      +

      27.2.2 Generating CFFI bindings

      As we mentioned earlier the ideal way to use SWIG is to use interface @@ -392,7 +392,7 @@ The feature intern_function ensures that all C names are
    -

    26.2.3 Generating CFFI bindings for C++ code

    +

    27.2.3 Generating CFFI bindings for C++ code

    This feature to SWIG (for CFFI) is very new and still far from @@ -568,7 +568,7 @@ If you have any questions, suggestions, patches, etc., related to CFFI module feel free to contact us on the SWIG mailing list, and also please add a "[CFFI]" tag in the subject line. -

    26.2.4 Inserting user code into generated files

    +

    27.2.4 Inserting user code into generated files

    @@ -608,7 +608,7 @@ Note that the block %{ ... %} is effectively a shortcut for

    -

    26.3 CLISP

    +

    27.3 CLISP

    @@ -638,7 +638,7 @@ swig -clisp -module module-name file-name interface file for the CLISP module. The CLISP module tries to produce code which is both human readable and easily modifyable.

    -

    26.3.1 Additional Commandline Options

    +

    27.3.1 Additional Commandline Options

    @@ -671,7 +671,7 @@ and global variables will be created otherwise only definitions for
    -

    26.3.2 Details on CLISP bindings

    +

    27.3.2 Details on CLISP bindings

    @@ -795,7 +795,7 @@ struct bar { -

    26.4 UFFI

    +

    27.4 UFFI

    diff --git a/Doc/Manual/Modula3.html b/Doc/Manual/Modula3.html index 0bf9f2995..ffbf6132d 100644 --- a/Doc/Manual/Modula3.html +++ b/Doc/Manual/Modula3.html @@ -5,7 +5,7 @@ -

    28 SWIG and Modula-3

    +

    29 SWIG and Modula-3

      @@ -54,7 +54,7 @@ especially typemaps.

      -

      28.1 Overview

      +

      29.1 Overview

      @@ -84,7 +84,7 @@ FFTW -

      28.1.1 Motivation

      +

      29.1.1 Motivation

      @@ -131,10 +131,10 @@ functions), but it doesn't allow you to easily integrate a Modula-3 module into a C/C++ project.

      -

      28.2 Conception

      +

      29.2 Conception

      -

      28.2.1 Interfaces to C libraries

      +

      29.2.1 Interfaces to C libraries

      @@ -283,7 +283,7 @@ and the principal type must be renamed (%typemap).

      -

      28.2.2 Interfaces to C++ libraries

      +

      29.2.2 Interfaces to C++ libraries

      @@ -384,10 +384,10 @@ There is no C++ library I wrote a SWIG interface for, so I'm not sure if this is possible or sensible, yet.

      -

      28.3 Preliminaries

      +

      29.3 Preliminaries

      -

      28.3.1 Compilers

      +

      29.3.1 Compilers

      @@ -400,7 +400,7 @@ For testing examples I use Critical Mass cm3.

      -

      28.3.2 Additional Commandline Options

      +

      29.3.2 Additional Commandline Options

      @@ -477,10 +477,10 @@ Instead generate templates for some basic typemaps. -

      28.4 Modula-3 typemaps

      +

      29.4 Modula-3 typemaps

      -

      28.4.1 Inputs and outputs

      +

      29.4.1 Inputs and outputs

      @@ -694,7 +694,7 @@ consist of the following parts: -

      28.4.2 Subranges, Enumerations, Sets

      +

      29.4.2 Subranges, Enumerations, Sets

      @@ -746,7 +746,7 @@ that I'd like to automate.

      -

      28.4.3 Objects

      +

      29.4.3 Objects

      @@ -759,7 +759,7 @@ is not really useful, yet.

      -

      28.4.4 Imports

      +

      29.4.4 Imports

      @@ -792,7 +792,7 @@ IMPORT M3toC;

    -

    28.4.5 Exceptions

    +

    29.4.5 Exceptions

    @@ -816,7 +816,7 @@ you should declare %typemap("m3wrapinconv:throws") blah * %{OSError.E%}.

    -

    28.4.6 Example

    +

    29.4.6 Example

    @@ -863,10 +863,10 @@ where almost everything is generated by a typemap: -

    28.5 More hints to the generator

    +

    29.5 More hints to the generator

    -

    28.5.1 Features

    +

    29.5.1 Features

    @@ -903,7 +903,7 @@ where almost everything is generated by a typemap:
    -

    28.5.2 Pragmas

    +

    29.5.2 Pragmas

    @@ -926,7 +926,7 @@ where almost everything is generated by a typemap:
    -

    28.6 Remarks

    +

    29.6 Remarks

      diff --git a/Doc/Manual/Mzscheme.html b/Doc/Manual/Mzscheme.html index 40173d720..fadda5fc9 100644 --- a/Doc/Manual/Mzscheme.html +++ b/Doc/Manual/Mzscheme.html @@ -8,7 +8,7 @@ -

      29 SWIG and MzScheme/Racket

      +

      30 SWIG and MzScheme/Racket

        @@ -24,7 +24,7 @@

        This section contains information on SWIG's support of Racket, formally known as MzScheme. -

        29.1 Creating native structures

        +

        30.1 Creating native structures

        @@ -65,7 +65,7 @@ Then in scheme, you can use regular struct access procedures like

      -

      29.2 Simple example

      +

      30.2 Simple example

      @@ -166,7 +166,7 @@ Some points of interest:

    • The above requests mzc to create an extension using the CGC garbage-collector. The alternative -- the 3m collector -- has generally better performance, but work is still required for SWIG to emit code which is compatible with it.
    -

    29.3 External documentation

    +

    30.3 External documentation

    diff --git a/Doc/Manual/Ocaml.html b/Doc/Manual/Ocaml.html index ec46d6e50..aa6679f9a 100644 --- a/Doc/Manual/Ocaml.html +++ b/Doc/Manual/Ocaml.html @@ -6,7 +6,7 @@ -

    30 SWIG and Ocaml

    +

    31 SWIG and Ocaml

      @@ -80,7 +80,7 @@ If you're not familiar with the Objective Caml language, you can visit The Ocaml Website.

      -

      30.1 Preliminaries

      +

      31.1 Preliminaries

      @@ -99,7 +99,7 @@ file Examples/Makefile illustrate how to compile and link SWIG modules that will be loaded dynamically. This has only been tested on Linux so far.

      -

      30.1.1 Running SWIG

      +

      31.1.1 Running SWIG

      @@ -122,7 +122,7 @@ you will compile the file example_wrap.c with ocamlc or the resulting .ml and .mli files as well, and do the final link with -custom (not needed for native link).

      -

      30.1.2 Compiling the code

      +

      31.1.2 Compiling the code

      @@ -158,7 +158,7 @@ the user more freedom with respect to custom typing.

    -

    30.1.3 The camlp4 module

    +

    31.1.3 The camlp4 module

    @@ -234,7 +234,7 @@ let b = C_string (getenv "PATH") -

    30.1.4 Using your module

    +

    31.1.4 Using your module

    @@ -248,7 +248,7 @@ When linking any ocaml bytecode with your module, use the -custom option is not needed when you build native code.

    -

    30.1.5 Compilation problems and compiling with C++

    +

    31.1.5 Compilation problems and compiling with C++

    @@ -259,7 +259,7 @@ liberal with pointer types may not compile under the C++ compiler. Most code meant to be compiled as C++ will not have problems.

    -

    30.2 The low-level Ocaml/C interface

    +

    31.2 The low-level Ocaml/C interface

    @@ -360,7 +360,7 @@ is that you must append them to the return list with swig_result = caml_list_a signature for a function that uses value in this way.

    -

    30.2.1 The generated module

    +

    31.2.1 The generated module

    @@ -394,7 +394,7 @@ it describes the output SWIG will generate for class definitions. -

    30.2.2 Enums

    +

    31.2.2 Enums

    @@ -457,7 +457,7 @@ val x : Enum_test.c_obj = C_enum `a -

    30.2.2.1 Enum typing in Ocaml

    +

    31.2.2.1 Enum typing in Ocaml

    @@ -470,10 +470,10 @@ functions imported from different modules. You must convert values to master values using the swig_val function before sharing them with another module.

    -

    30.2.3 Arrays

    +

    31.2.3 Arrays

    -

    30.2.3.1 Simple types of bounded arrays

    +

    31.2.3.1 Simple types of bounded arrays

    @@ -494,7 +494,7 @@ arrays of simple types with known bounds in your code, but this only works for arrays whose bounds are completely specified.

    -

    30.2.3.2 Complex and unbounded arrays

    +

    31.2.3.2 Complex and unbounded arrays

    @@ -507,7 +507,7 @@ SWIG can't predict which of these methods will be used in the array, so you have to specify it for yourself in the form of a typemap.

    -

    30.2.3.3 Using an object

    +

    31.2.3.3 Using an object

    @@ -521,7 +521,7 @@ Consider writing an object when the ending condition of your array is complex, such as using a required sentinel, etc.

    -

    30.2.3.4 Example typemap for a function taking float * and int

    +

    31.2.3.4 Example typemap for a function taking float * and int

    @@ -572,7 +572,7 @@ void printfloats( float *tab, int len ); -

    30.2.4 C++ Classes

    +

    31.2.4 C++ Classes

    @@ -615,7 +615,7 @@ the underlying pointer, so using create_[x]_from_ptr alters the returned value for the same object.

    -

    30.2.4.1 STL vector and string Example

    +

    31.2.4.1 STL vector and string Example

    @@ -695,7 +695,7 @@ baz # -

    30.2.4.2 C++ Class Example

    +

    31.2.4.2 C++ Class Example

    @@ -725,7 +725,7 @@ public: }; -

    30.2.4.3 Compiling the example

    +

    31.2.4.3 Compiling the example

    @@ -743,7 +743,7 @@ bash-2.05a$ ocamlmktop -custom swig.cmo -I `camlp4 -where` \
       -L$QTPATH/lib -cclib -lqt
     
    -

    30.2.4.4 Sample Session

    +

    31.2.4.4 Sample Session

    @@ -770,10 +770,10 @@ Assuming you have a working installation of QT, you will see a window
     containing the string "hi" in a button.  
     

    -

    30.2.5 Director Classes

    +

    31.2.5 Director Classes

    -

    30.2.5.1 Director Introduction

    +

    31.2.5.1 Director Introduction

    @@ -800,7 +800,7 @@ class foo { };

    -

    30.2.5.2 Overriding Methods in Ocaml

    +

    31.2.5.2 Overriding Methods in Ocaml

    @@ -828,7 +828,7 @@ In this example, I'll examine the objective caml code involved in providing an overloaded class. This example is contained in Examples/ocaml/shapes.

    -

    30.2.5.3 Director Usage Example

    +

    31.2.5.3 Director Usage Example

    @@ -887,7 +887,7 @@ in a more effortless style in ocaml, while leaving the "engine" part of the program in C++.

    -

    30.2.5.4 Creating director objects

    +

    31.2.5.4 Creating director objects

    @@ -928,7 +928,7 @@ object from causing a core dump, as long as the object is destroyed properly.

    -

    30.2.5.5 Typemaps for directors, directorin, directorout, directorargout

    +

    31.2.5.5 Typemaps for directors, directorin, directorout, directorargout

    @@ -939,7 +939,7 @@ well as a function return value in the same way you provide function arguments, and to receive arguments the same way you normally receive function returns.

    -

    30.2.5.6 directorin typemap

    +

    31.2.5.6 directorin typemap

    @@ -950,7 +950,7 @@ code receives when you are called. In general, a simple directorin typ can use the same body as a simple out typemap.

    -

    30.2.5.7 directorout typemap

    +

    31.2.5.7 directorout typemap

    @@ -961,7 +961,7 @@ for the same type, except when there are special requirements for object ownership, etc.

    -

    30.2.5.8 directorargout typemap

    +

    31.2.5.8 directorargout typemap

    @@ -978,7 +978,7 @@ In the event that you don't specify all of the necessary values, integral values will read zero, and struct or object returns have undefined results.

    -

    30.2.6 Exceptions

    +

    31.2.6 Exceptions

    diff --git a/Doc/Manual/Octave.html b/Doc/Manual/Octave.html index bc6873c4b..9c3489fb8 100644 --- a/Doc/Manual/Octave.html +++ b/Doc/Manual/Octave.html @@ -8,7 +8,7 @@ -

    31 SWIG and Octave

    +

    32 SWIG and Octave

      @@ -55,7 +55,7 @@ More information can be found at O Also, there are a dozen or so examples in the Examples/octave directory, and hundreds in the test suite (Examples/test-suite and Examples/test-suite/octave).

      -

      31.1 Preliminaries

      +

      32.1 Preliminaries

      @@ -63,7 +63,7 @@ As of SWIG 3.0.0, the Octave module has been tested with Octave versions 3.0.5, Use of Octave versions older than 3.x.x is not recommended, as these versions are no longer tested with SWIG.

      -

      31.2 Running SWIG

      +

      32.2 Running SWIG

      @@ -95,7 +95,7 @@ The -c++ option is also required when wrapping C++ code: This creates a C++ source file "example_wrap.cpp". A C++ file is generated even when wrapping C code as Octave is itself written in C++ and requires wrapper code to be in the same language. The generated C++ source file contains the low-level wrappers that need to be compiled and linked with the rest of your C/C++ application (in this case, the gcd implementation) to create an extension module.

      -

      31.2.1 Command-line options

      +

      32.2.1 Command-line options

      @@ -118,7 +118,7 @@ The special name "." loads C global variables into the module namespace, i.e. al The -opprefix options sets the prefix of the names of global/friend operator functions.

      -

      31.2.2 Compiling a dynamic module

      +

      32.2.2 Compiling a dynamic module

      @@ -145,7 +145,7 @@ $ mkoctfile example_wrap.cpp example.c

      octave:1> swigexample
      -

      31.2.3 Using your module

      +

      32.2.3 Using your module

      @@ -163,10 +163,10 @@ octave:4> swigexample.cvar.Foo=4; octave:5> swigexample.cvar.Foo ans = 4

    -

    31.3 A tour of basic C/C++ wrapping

    +

    32.3 A tour of basic C/C++ wrapping

    -

    31.3.1 Modules

    +

    32.3.1 Modules

    @@ -211,7 +211,7 @@ octave:4> swigexample.gcd(4,6) ans = 2 -

    31.3.2 Functions

    +

    32.3.2 Functions

    @@ -228,7 +228,7 @@ int fact(int n);

    octave:1> swigexample.fact(4)
     24 
    -

    31.3.3 Global variables

    +

    32.3.3 Global variables

    @@ -281,7 +281,7 @@ octave:2> swigexample.PI=3.142; octave:3> swigexample.PI ans = 3.1420 -

    31.3.4 Constants and enums

    +

    32.3.4 Constants and enums

    @@ -303,7 +303,7 @@ swigexample.SCONST="Hello World" swigexample.SUNDAY=0 .... -

    31.3.5 Pointers

    +

    32.3.5 Pointers

    @@ -350,7 +350,7 @@ octave:2> f=swigexample.fopen("not there","r"); error: value on right hand side of assignment is undefined error: evaluating assignment expression near line 2, column 2 -

    31.3.6 Structures and C++ classes

    +

    32.3.6 Structures and C++ classes

    @@ -485,7 +485,7 @@ ans = 1 Depending on the ownership setting of a swig_ref, it may call C++ destructors when its reference count goes to zero. See the section on memory management below for details.

    -

    31.3.7 C++ inheritance

    +

    32.3.7 C++ inheritance

    @@ -494,7 +494,7 @@ This information contains the full class hierarchy. When an indexing operation ( the tree is walked to find a match in the current class as well as any of its bases. The lookup is then cached in the swig_ref.

    -

    31.3.8 C++ overloaded functions

    +

    32.3.8 C++ overloaded functions

    @@ -504,7 +504,7 @@ The dispatch function selects which overload to call (if any) based on the passe typecheck typemaps are used to analyze each argument, as well as assign precedence. See the chapter on typemaps for details.

    -

    31.3.9 C++ operators

    +

    32.3.9 C++ operators

    @@ -608,7 +608,7 @@ On the C++ side, the default mappings are as follows: Octave can also utilise friend (i.e. non-member) operators with a simple %rename: see the example in the Examples/octave/operator directory.

    -

    31.3.10 Class extension with %extend

    +

    32.3.10 Class extension with %extend

    @@ -638,7 +638,7 @@ octave:3> printf("%s\n",a); octave:4> a.__str() 4 -

    31.3.11 C++ templates

    +

    32.3.11 C++ templates

    @@ -715,14 +715,14 @@ ans = -

    31.3.12 C++ Smart Pointers

    +

    32.3.12 C++ Smart Pointers

    C++ smart pointers are fully supported as in other modules.

    -

    31.3.13 Directors (calling Octave from C++ code)

    +

    32.3.13 Directors (calling Octave from C++ code)

    @@ -803,14 +803,14 @@ c-side routine called octave-side routine called -

    31.3.14 Threads

    +

    32.3.14 Threads

    The use of threads in wrapped Director code is not supported; i.e., an Octave-side implementation of a C++ class must be called from the Octave interpreter's thread. Anything fancier (apartment/queue model, whatever) is left to the user. Without anything fancier, this amounts to the limitation that Octave must drive the module... like, for example, an optimization package that calls Octave to evaluate an objective function.

    -

    31.3.15 Memory management

    +

    32.3.15 Memory management

    @@ -844,14 +844,14 @@ The %newobject directive may be used to control this behavior for pointers retur In the case where one wishes for the C++ side to own an object that was created in Octave (especially a Director object), one can use the __disown() method to invert this logic. Then letting the Octave reference count go to zero will not destroy the object, but destroying the object will invalidate the Octave-side object if it still exists (and call destructors of other C++ bases in the case of multiple inheritance/subclass()'ing).

    -

    31.3.16 STL support

    +

    32.3.16 STL support

    Various STL library files are provided for wrapping STL containers.

    -

    31.3.17 Matrix typemaps

    +

    32.3.17 Matrix typemaps

    diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html index 010eb48df..8bc7cbfd3 100644 --- a/Doc/Manual/Perl5.html +++ b/Doc/Manual/Perl5.html @@ -6,7 +6,7 @@ -

    32 SWIG and Perl5

    +

    33 SWIG and Perl5

      @@ -96,7 +96,7 @@ later. We're no longer testing regularly with older versions, but Perl 5.6 seems to mostly work, while older versions don't.

      -

      32.1 Overview

      +

      33.1 Overview

      @@ -117,7 +117,7 @@ described. Advanced customization features, typemaps, and other options are found near the end of the chapter.

      -

      32.2 Preliminaries

      +

      33.2 Preliminaries

      @@ -142,7 +142,7 @@ To build the module, you will need to compile the file example_wrap.c and link it with the rest of your program.

      -

      32.2.1 Getting the right header files

      +

      33.2.1 Getting the right header files

      @@ -174,7 +174,7 @@ $ perl -e 'use Config; print "$Config{archlib}\n";'

    -

    32.2.2 Compiling a dynamic module

    +

    33.2.2 Compiling a dynamic module

    @@ -207,7 +207,7 @@ the target should be named `example.so', `example.sl', or the appropriate dynamic module name on your system.

    -

    32.2.3 Building a dynamic module with MakeMaker

    +

    33.2.3 Building a dynamic module with MakeMaker

    @@ -241,7 +241,7 @@ the preferred approach to compilation. More information about MakeMaker can be found in "Programming Perl, 2nd ed." by Larry Wall, Tom Christiansen, and Randal Schwartz.

    -

    32.2.4 Building a static version of Perl

    +

    33.2.4 Building a static version of Perl

    @@ -310,7 +310,7 @@ added to it. Depending on your machine, you may need to link with additional libraries such as -lsocket, -lnsl, -ldl, etc.

    -

    32.2.5 Using the module

    +

    33.2.5 Using the module

    @@ -463,7 +463,7 @@ system configuration (this requires root access and you will need to read the man pages).

    -

    32.2.6 Compilation problems and compiling with C++

    +

    33.2.6 Compilation problems and compiling with C++

    @@ -606,7 +606,7 @@ have to find the macro that conflicts and add an #undef into the .i file. Pleas any conflicting macros you find to swig-user mailing list.

    -

    32.2.7 Compiling for 64-bit platforms

    +

    33.2.7 Compiling for 64-bit platforms

    @@ -633,7 +633,7 @@ also introduce problems on platforms that support more than one linking standard (e.g., -o32 and -n32 on Irix).

    -

    32.3 Building Perl Extensions under Windows

    +

    33.3 Building Perl Extensions under Windows

    @@ -644,7 +644,7 @@ section assumes you are using SWIG with Microsoft Visual C++ although the procedure may be similar with other compilers.

    -

    32.3.1 Running SWIG from Developer Studio

    +

    33.3.1 Running SWIG from Developer Studio

    @@ -707,7 +707,7 @@ print "$a\n"; -

    32.3.2 Using other compilers

    +

    33.3.2 Using other compilers

    @@ -715,7 +715,7 @@ SWIG is known to work with Cygwin and may work with other compilers on Windows. For general hints and suggestions refer to the Windows chapter.

    -

    32.4 The low-level interface

    +

    33.4 The low-level interface

    @@ -725,7 +725,7 @@ can be used to control your application. However, it is also used to construct more user-friendly proxy classes as described in the next section.

    -

    32.4.1 Functions

    +

    33.4.1 Functions

    @@ -748,7 +748,7 @@ use example; $a = &example::fact(2); -

    32.4.2 Global variables

    +

    33.4.2 Global variables

    @@ -818,7 +818,7 @@ extern char *path; // Declared later in the input -

    32.4.3 Constants

    +

    33.4.3 Constants

    @@ -858,7 +858,7 @@ print example::FOO,"\n"; -

    32.4.4 Pointers

    +

    33.4.4 Pointers

    @@ -967,7 +967,7 @@ as XS and xsubpp. Given the advancement of the SWIG typesystem and the SWIG and XS, this is no longer supported.

    -

    32.4.5 Structures

    +

    33.4.5 Structures

    @@ -1101,7 +1101,7 @@ void Bar_f_set(Bar *b, Foo *val) { -

    32.4.6 C++ classes

    +

    33.4.6 C++ classes

    @@ -1166,7 +1166,7 @@ provides direct access to C++ objects. A higher level interface using Perl prox can be built using these low-level accessors. This is described shortly.

    -

    32.4.7 C++ classes and type-checking

    +

    33.4.7 C++ classes and type-checking

    @@ -1202,7 +1202,7 @@ If necessary, the type-checker also adjusts the value of the pointer (as is nece multiple inheritance is used).

    -

    32.4.8 C++ overloaded functions

    +

    33.4.8 C++ overloaded functions

    @@ -1246,7 +1246,7 @@ example::Spam_foo_d($s,3.14); Please refer to the "SWIG Basics" chapter for more information.

    -

    32.4.9 Operators

    +

    33.4.9 Operators

    @@ -1273,7 +1273,7 @@ The following C++ operators are currently supported by the Perl module:

  • operator or
  • -

    32.4.10 Modules and packages

    +

    33.4.10 Modules and packages

    @@ -1368,7 +1368,7 @@ print Foo::fact(4),"\n"; # Call a function in package FooBar --> -

    32.5 Input and output parameters

    +

    33.5 Input and output parameters

    @@ -1587,7 +1587,7 @@ print "$c\n"; Note: The REFERENCE feature is only currently supported for numeric types (integers and floating point).

    -

    32.6 Exception handling

    +

    33.6 Exception handling

    @@ -1752,7 +1752,7 @@ This is still supported, but it is deprecated. The newer %exception di functionality, but it has additional capabilities that make it more powerful.

    -

    32.7 Remapping datatypes with typemaps

    +

    33.7 Remapping datatypes with typemaps

    @@ -1769,7 +1769,7 @@ Typemaps are only used if you want to change some aspect of the primitive C-Perl interface.

    -

    32.7.1 A simple typemap example

    +

    33.7.1 A simple typemap example

    @@ -1873,7 +1873,7 @@ example::count("e","Hello World"); -

    32.7.2 Perl5 typemaps

    +

    33.7.2 Perl5 typemaps

    @@ -1978,7 +1978,7 @@ Return of C++ member data (all languages). Check value of input parameter. -

    32.7.3 Typemap variables

    +

    33.7.3 Typemap variables

    @@ -2049,7 +2049,7 @@ properly assigned. The Perl name of the wrapper function being created. -

    32.7.4 Useful functions

    +

    33.7.4 Useful functions

    @@ -2118,7 +2118,7 @@ int sv_isa(SV *, char *0; -

    32.8 Typemap Examples

    +

    33.8 Typemap Examples

    @@ -2127,7 +2127,7 @@ might look at the files "perl5.swg" and "typemaps.i" in the SWIG library.

    -

    32.8.1 Converting a Perl5 array to a char **

    +

    33.8.1 Converting a Perl5 array to a char **

    @@ -2219,7 +2219,7 @@ print @$b,"\n"; # Print it out -

    32.8.2 Return values

    +

    33.8.2 Return values

    @@ -2248,7 +2248,7 @@ can be done using the EXTEND() macro as in: } -

    32.8.3 Returning values from arguments

    +

    33.8.3 Returning values from arguments

    @@ -2302,7 +2302,7 @@ print "multout(7,13) = @r\n"; ($x,$y) = multout(7,13); -

    32.8.4 Accessing array structure members

    +

    33.8.4 Accessing array structure members

    @@ -2365,7 +2365,7 @@ the "in" typemap in the previous section would be used to convert an to copy the converted array into a C data structure.

    -

    32.8.5 Turning Perl references into C pointers

    +

    33.8.5 Turning Perl references into C pointers

    @@ -2430,7 +2430,7 @@ print "$c\n"; -

    32.8.6 Pointer handling

    +

    33.8.6 Pointer handling

    @@ -2509,7 +2509,7 @@ For example: -

    32.9 Proxy classes

    +

    33.9 Proxy classes

    @@ -2525,7 +2525,7 @@ to the underlying code. This section describes the implementation details of the proxy interface.

    -

    32.9.1 Preliminaries

    +

    33.9.1 Preliminaries

    @@ -2547,7 +2547,7 @@ SWIG creates a collection of high-level Perl wrappers. In your scripts, you wil high level wrappers. The wrappers, in turn, interact with the low-level procedural module.

    -

    32.9.2 Structure and class wrappers

    +

    33.9.2 Structure and class wrappers

    @@ -2673,7 +2673,7 @@ $v->DESTROY(); -

    32.9.3 Object Ownership

    +

    33.9.3 Object Ownership

    @@ -2760,7 +2760,7 @@ counting, garbage collection, or advanced features one might find in sophisticated languages.

    -

    32.9.4 Nested Objects

    +

    33.9.4 Nested Objects

    @@ -2813,7 +2813,7 @@ $p->{f}->{x} = 0.0; %${$p->{v}} = ( x=>0, y=>0, z=>0); -

    32.9.5 Proxy Functions

    +

    33.9.5 Proxy Functions

    @@ -2847,7 +2847,7 @@ This function replaces the original function, but operates in an identical manner.

    -

    32.9.6 Inheritance

    +

    33.9.6 Inheritance

    @@ -2923,7 +2923,7 @@ particular, inheritance of data members is extremely tricky (and I'm not even sure if it really works).

    -

    32.9.7 Modifying the proxy methods

    +

    33.9.7 Modifying the proxy methods

    @@ -2951,7 +2951,7 @@ public: }; -

    32.10 Adding additional Perl code

    +

    33.10 Adding additional Perl code

    @@ -3002,7 +3002,7 @@ set_transform($im, $a); -

    32.11 Cross language polymorphism

    +

    33.11 Cross language polymorphism

    @@ -3036,7 +3036,7 @@ proxy classes, director classes, and C wrapper functions takes care of all the cross-language method routing transparently.

    -

    32.11.1 Enabling directors

    +

    33.11.1 Enabling directors

    @@ -3126,7 +3126,7 @@ sub one { -

    32.11.2 Director classes

    +

    33.11.2 Director classes

    @@ -3206,7 +3206,7 @@ so there is no need for the extra overhead involved with routing the calls through Perl.

    -

    32.11.3 Ownership and object destruction

    +

    33.11.3 Ownership and object destruction

    @@ -3255,7 +3255,7 @@ sub DESTROY { -

    32.11.4 Exception unrolling

    +

    33.11.4 Exception unrolling

    @@ -3311,7 +3311,7 @@ Swig::DirectorMethodException is thrown, Perl will register the exception as soon as the C wrapper function returns.

    -

    32.11.5 Overhead and code bloat

    +

    33.11.5 Overhead and code bloat

    @@ -3345,7 +3345,7 @@ directive) for only those methods that are likely to be extended in Perl.

    -

    32.11.6 Typemaps

    +

    33.11.6 Typemaps

    diff --git a/Doc/Manual/Php.html b/Doc/Manual/Php.html index 493c861f8..7e5cccf6a 100644 --- a/Doc/Manual/Php.html +++ b/Doc/Manual/Php.html @@ -7,7 +7,7 @@ -

    33 SWIG and PHP

    +

    34 SWIG and PHP

      @@ -79,7 +79,7 @@ your extension into php directly, you will need the complete PHP source tree available.

      -

      33.1 Generating PHP Extensions

      +

      34.1 Generating PHP Extensions

      @@ -126,7 +126,7 @@ and it doesn't play nicely with package system. We don't recommend this approach, or provide explicit support for it.

      -

      33.1.1 Building a loadable extension

      +

      34.1.1 Building a loadable extension

      @@ -141,7 +141,7 @@ least work for Linux though): gcc -shared example_wrap.o -o example.so

    -

    33.1.2 Using PHP Extensions

    +

    34.1.2 Using PHP Extensions

    @@ -172,7 +172,7 @@ attempts to do the dl() call for you: include("example.php"); -

    33.2 Basic PHP interface

    +

    34.2 Basic PHP interface

    @@ -183,7 +183,7 @@ other symbols unless care is taken to %rename them. At present SWIG doesn't have support for the namespace feature added in PHP 5.3.

    -

    33.2.1 Constants

    +

    34.2.1 Constants

    @@ -260,7 +260,7 @@ is treated as true by the if test, when the value of the intended constant would be treated as false!

    -

    33.2.2 Global Variables

    +

    34.2.2 Global Variables

    @@ -309,7 +309,7 @@ undefined. At this time SWIG does not support custom accessor methods.

    -

    33.2.3 Functions

    +

    34.2.3 Functions

    @@ -362,7 +362,7 @@ print $s; # The value of $s was not changed. --> -

    33.2.4 Overloading

    +

    34.2.4 Overloading

    @@ -418,7 +418,7 @@ taking the integer argument.

    --> -

    33.2.5 Pointers and References

    +

    34.2.5 Pointers and References

    @@ -563,7 +563,7 @@ PHP in a number of ways: by using unset on an existing variable, or assigning NULL to a variable.

    -

    33.2.6 Structures and C++ classes

    +

    34.2.6 Structures and C++ classes

    @@ -624,7 +624,7 @@ Would be used in the following way from PHP5: Member variables and methods are accessed using the -> operator.

    -

    33.2.6.1 Using -noproxy

    +

    34.2.6.1 Using -noproxy

    @@ -650,7 +650,7 @@ Complex_im_set($obj,$d); Complex_im_get($obj); -

    33.2.6.2 Constructors and Destructors

    +

    34.2.6.2 Constructors and Destructors

    @@ -691,7 +691,7 @@ the programmer can either reassign the variable or call unset($v)

    -

    33.2.6.3 Static Member Variables

    +

    34.2.6.3 Static Member Variables

    @@ -734,7 +734,7 @@ Ko::threats(10); echo "There have now been " . Ko::threats() . " threats\n"; -

    33.2.6.4 Static Member Functions

    +

    34.2.6.4 Static Member Functions

    @@ -756,7 +756,7 @@ Ko::threats(); -

    33.2.7 PHP Pragmas, Startup and Shutdown code

    +

    34.2.7 PHP Pragmas, Startup and Shutdown code

    @@ -844,7 +844,7 @@ The %rinit and %rshutdown statements are very similar but inse into the request init (PHP_RINIT_FUNCTION) and request shutdown (PHP_RSHUTDOWN_FUNCTION) code respectively.

    -

    33.3 Cross language polymorphism

    +

    34.3 Cross language polymorphism

    @@ -879,7 +879,7 @@ wrapper functions takes care of all the cross-language method routing transparently.

    -

    33.3.1 Enabling directors

    +

    34.3.1 Enabling directors

    @@ -968,7 +968,7 @@ class MyFoo extends Foo { -

    33.3.2 Director classes

    +

    34.3.2 Director classes

    @@ -1048,7 +1048,7 @@ so there is no need for the extra overhead involved with routing the calls through PHP.

    -

    33.3.3 Ownership and object destruction

    +

    34.3.3 Ownership and object destruction

    @@ -1104,7 +1104,7 @@ In this example, we are assuming that FooContainer will take care of deleting all the Foo pointers it contains at some point.

    -

    33.3.4 Exception unrolling

    +

    34.3.4 Exception unrolling

    @@ -1163,7 +1163,7 @@ Swig::DirectorMethodException is thrown, PHP will register the exception as soon as the C wrapper function returns.

    -

    33.3.5 Overhead and code bloat

    +

    34.3.5 Overhead and code bloat

    @@ -1196,7 +1196,7 @@ optimized by selectively enabling director methods (using the %feature directive) for only those methods that are likely to be extended in PHP.

    -

    33.3.6 Typemaps

    +

    34.3.6 Typemaps

    @@ -1210,7 +1210,7 @@ need to be supported.

    -

    33.3.7 Miscellaneous

    +

    34.3.7 Miscellaneous

    Director typemaps for STL classes are mostly in place, and hence you diff --git a/Doc/Manual/Pike.html b/Doc/Manual/Pike.html index 3ede1a992..44c6930f8 100644 --- a/Doc/Manual/Pike.html +++ b/Doc/Manual/Pike.html @@ -6,7 +6,7 @@ -

    34 SWIG and Pike

    +

    35 SWIG and Pike

      @@ -46,10 +46,10 @@ least, make sure you read the "SWIG Basics" chapter.

      -

      34.1 Preliminaries

      +

      35.1 Preliminaries

      -

      34.1.1 Running SWIG

      +

      35.1.1 Running SWIG

      @@ -94,7 +94,7 @@ can use the -o option:

      $ swig -pike -o pseudonym.c example.i
      -

      34.1.2 Getting the right header files

      +

      35.1.2 Getting the right header files

      @@ -114,7 +114,7 @@ You're looking for files with the names global.h, program.h and so on.

      -

      34.1.3 Using your module

      +

      35.1.3 Using your module

      @@ -129,10 +129,10 @@ Pike v7.4 release 10 running Hilfe v3.5 (Incremental Pike Frontend) (1) Result: 24

    -

    34.2 Basic C/C++ Mapping

    +

    35.2 Basic C/C++ Mapping

    -

    34.2.1 Modules

    +

    35.2.1 Modules

    @@ -143,7 +143,7 @@ concerned), SWIG's %module directive doesn't really have any significance.

    -

    34.2.2 Functions

    +

    35.2.2 Functions

    @@ -168,7 +168,7 @@ exactly as you'd expect it to: (1) Result: 24 -

    34.2.3 Global variables

    +

    35.2.3 Global variables

    @@ -197,7 +197,7 @@ will result in two functions, Foo_get() and Foo_set(): (3) Result: 3.141590 -

    34.2.4 Constants and enumerated types

    +

    35.2.4 Constants and enumerated types

    @@ -205,7 +205,7 @@ Enumerated types in C/C++ declarations are wrapped as Pike constants, not as Pike enums.

    -

    34.2.5 Constructors and Destructors

    +

    35.2.5 Constructors and Destructors

    @@ -213,7 +213,7 @@ Constructors are wrapped as create() methods, and destructors are wrapped as destroy() methods, for Pike classes.

    -

    34.2.6 Static Members

    +

    35.2.6 Static Members

    diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index 9b86652f4..bdb1ada30 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -6,7 +6,7 @@ -

    35 SWIG and Python

    +

    36 SWIG and Python

      @@ -141,7 +141,7 @@ very least, make sure you read the "SWIG Basics" chapter.

      -

      35.1 Overview

      +

      36.1 Overview

      @@ -168,10 +168,10 @@ described followed by a discussion of low-level implementation details.

      -

      35.2 Preliminaries

      +

      36.2 Preliminaries

      -

      35.2.1 Running SWIG

      +

      36.2.1 Running SWIG

      @@ -269,7 +269,7 @@ The following sections have further practical examples and details on how you might go about compiling and using the generated files.

      -

      35.2.2 Using distutils

      +

      36.2.2 Using distutils

      @@ -361,7 +361,7 @@ This same approach works on all platforms if the appropriate compiler is install can even build extensions to the standard Windows Python using MingGW)

      -

      35.2.3 Hand compiling a dynamic module

      +

      36.2.3 Hand compiling a dynamic module

      @@ -409,7 +409,7 @@ module actually consists of two files; socket.py and

      -

      35.2.4 Static linking

      +

      36.2.4 Static linking

      @@ -488,7 +488,7 @@ If using static linking, you might want to rely on a different approach (perhaps using distutils).

      -

      35.2.5 Using your module

      +

      36.2.5 Using your module

      @@ -645,7 +645,7 @@ system configuration (this requires root access and you will need to read the man pages).

      -

      35.2.6 Compilation of C++ extensions

      +

      36.2.6 Compilation of C++ extensions

      @@ -737,7 +737,7 @@ erratic program behavior. If working with lots of software components, you might want to investigate using a more formal standard such as COM.

      -

      35.2.7 Compiling for 64-bit platforms

      +

      36.2.7 Compiling for 64-bit platforms

      @@ -774,7 +774,7 @@ and -m64 allow you to choose the desired binary format for your python extension.

      -

      35.2.8 Building Python Extensions under Windows

      +

      36.2.8 Building Python Extensions under Windows

      @@ -903,7 +903,7 @@ SWIG Wiki.

      -

      35.3 A tour of basic C/C++ wrapping

      +

      36.3 A tour of basic C/C++ wrapping

      @@ -912,7 +912,7 @@ to your C/C++ code. Functions are wrapped as functions, classes are wrapped as This section briefly covers the essential aspects of this wrapping.

      -

      35.3.1 Modules

      +

      36.3.1 Modules

      @@ -925,7 +925,7 @@ module name, make sure you don't use the same name as a built-in Python command or standard module name.

      -

      35.3.2 Functions

      +

      36.3.2 Functions

      @@ -949,7 +949,7 @@ like you think it does: >>>

    -

    35.3.3 Global variables

    +

    36.3.3 Global variables

    @@ -1087,7 +1087,7 @@ that starts with a leading underscore. SWIG does not create cvar if there are no global variables in a module.

    -

    35.3.4 Constants and enums

    +

    36.3.4 Constants and enums

    @@ -1127,7 +1127,7 @@ other object. Unfortunately, there is no easy way for SWIG to generate code that prevents this. You will just have to be careful.

    -

    35.3.5 Pointers

    +

    36.3.5 Pointers

    @@ -1268,7 +1268,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return None if the conversion can't be performed.

    -

    35.3.6 Structures

    +

    36.3.6 Structures

    @@ -1457,7 +1457,7 @@ everything works just like you would expect. For example: -

    35.3.7 C++ classes

    +

    36.3.7 C++ classes

    @@ -1546,7 +1546,7 @@ they are accessed through cvar like this: -

    35.3.8 C++ inheritance

    +

    36.3.8 C++ inheritance

    @@ -1601,7 +1601,7 @@ then the function spam() accepts Foo * or a pointer to any cla It is safe to use multiple inheritance with SWIG.

    -

    35.3.9 Pointers, references, values, and arrays

    +

    36.3.9 Pointers, references, values, and arrays

    @@ -1662,7 +1662,7 @@ treated as a returning value, and it will follow the same allocation/deallocation process.

    -

    35.3.10 C++ overloaded functions

    +

    36.3.10 C++ overloaded functions

    @@ -1785,7 +1785,7 @@ first declaration takes precedence. Please refer to the "SWIG and C++" chapter for more information about overloading.

    -

    35.3.11 C++ operators

    +

    36.3.11 C++ operators

    @@ -1874,7 +1874,7 @@ Also, be aware that certain operators don't map cleanly to Python. For instance overloaded assignment operators don't map to Python semantics and will be ignored.

    -

    35.3.12 C++ namespaces

    +

    36.3.12 C++ namespaces

    @@ -1941,7 +1941,7 @@ utilizes thousands of small deeply nested namespaces each with identical symbol names, well, then you get what you deserve.

    -

    35.3.13 C++ templates

    +

    36.3.13 C++ templates

    @@ -1995,7 +1995,7 @@ Some more complicated examples will appear later.

    -

    35.3.14 C++ Smart Pointers

    +

    36.3.14 C++ Smart Pointers

    @@ -2079,7 +2079,7 @@ simply use the __deref__() method. For example: -

    35.3.15 C++ reference counted objects

    +

    36.3.15 C++ reference counted objects

    @@ -2088,7 +2088,7 @@ Python examples of memory management using referencing counting.

    -

    35.4 Further details on the Python class interface

    +

    36.4 Further details on the Python class interface

    @@ -2111,7 +2111,7 @@ the -builtin option are in the Built-in section.

    -

    35.4.1 Proxy classes

    +

    36.4.1 Proxy classes

    @@ -2200,7 +2200,7 @@ you can attach new Python methods to the class and you can even inherit from it by Python built-in types until Python 2.2).

    -

    35.4.2 Built-in Types

    +

    36.4.2 Built-in Types

    @@ -2244,7 +2244,7 @@ please refer to the python documentation:

    http://docs.python.org/extending/newtypes.html

    -

    35.4.2.1 Limitations

    +

    36.4.2.1 Limitations

    Use of the -builtin option implies a couple of limitations: @@ -2412,7 +2412,7 @@ assert(issubclass(B.Derived, A.Base)) -

    35.4.2.2 Operator overloads -- use them!

    +

    36.4.2.2 Operator overloads -- use them!

    The entire justification for the -builtin option is improved @@ -2513,7 +2513,7 @@ structs.

    -

    35.4.3 Memory management

    +

    36.4.3 Memory management

    NOTE: Although this section refers to proxy objects, everything here also applies @@ -2708,7 +2708,7 @@ It is also possible to deal with situations like this using typemaps--an advanced topic discussed later.

    -

    35.4.4 Python 2.2 and classic classes

    +

    36.4.4 Python 2.2 and classic classes

    @@ -2745,7 +2745,7 @@ class itself. In Python-2.1 and earlier, they have to be accessed as a global function or through an instance (see the earlier section).

    -

    35.5 Cross language polymorphism

    +

    36.5 Cross language polymorphism

    @@ -2779,7 +2779,7 @@ proxy classes, director classes, and C wrapper functions takes care of all the cross-language method routing transparently.

    -

    35.5.1 Enabling directors

    +

    36.5.1 Enabling directors

    @@ -2869,7 +2869,7 @@ class MyFoo(mymodule.Foo): -

    35.5.2 Director classes

    +

    36.5.2 Director classes

    @@ -2951,7 +2951,7 @@ so there is no need for the extra overhead involved with routing the calls through Python.

    -

    35.5.3 Ownership and object destruction

    +

    36.5.3 Ownership and object destruction

    @@ -3018,7 +3018,7 @@ deleting all the Foo pointers it contains at some point. Note that no hard references to the Foo objects remain in Python.

    -

    35.5.4 Exception unrolling

    +

    36.5.4 Exception unrolling

    @@ -3077,7 +3077,7 @@ Swig::DirectorMethodException is thrown, Python will register the exception as soon as the C wrapper function returns.

    -

    35.5.5 Overhead and code bloat

    +

    36.5.5 Overhead and code bloat

    @@ -3111,7 +3111,7 @@ directive) for only those methods that are likely to be extended in Python.

    -

    35.5.6 Typemaps

    +

    36.5.6 Typemaps

    @@ -3125,7 +3125,7 @@ need to be supported.

    -

    35.5.7 Miscellaneous

    +

    36.5.7 Miscellaneous

    @@ -3172,7 +3172,7 @@ methods that return const references.

    -

    35.6 Common customization features

    +

    36.6 Common customization features

    @@ -3185,7 +3185,7 @@ This section describes some common SWIG features that are used to improve your the interface to an extension module.

    -

    35.6.1 C/C++ helper functions

    +

    36.6.1 C/C++ helper functions

    @@ -3266,7 +3266,7 @@ hard to implement. It is possible to clean this up using Python code, typemaps, customization features as covered in later sections.

    -

    35.6.2 Adding additional Python code

    +

    36.6.2 Adding additional Python code

    @@ -3494,7 +3494,7 @@ The same applies for overloaded constructors.

    -

    35.6.3 Class extension with %extend

    +

    36.6.3 Class extension with %extend

    @@ -3583,7 +3583,7 @@ Vector(12,14,16) in any way---the extensions only show up in the Python interface.

    -

    35.6.4 Exception handling with %exception

    +

    36.6.4 Exception handling with %exception

    @@ -3709,7 +3709,7 @@ The language-independent exception.i library file can also be used to raise exceptions. See the SWIG Library chapter.

    -

    35.7 Tips and techniques

    +

    36.7 Tips and techniques

    @@ -3719,7 +3719,7 @@ strings, binary data, and arrays. This chapter discusses the common techniques solving these problems.

    -

    35.7.1 Input and output parameters

    +

    36.7.1 Input and output parameters

    @@ -3932,7 +3932,7 @@ void foo(Bar *OUTPUT); may not have the intended effect since typemaps.i does not define an OUTPUT rule for Bar.

    -

    35.7.2 Simple pointers

    +

    36.7.2 Simple pointers

    @@ -4001,7 +4001,7 @@ If you replace %pointer_functions() by %pointer_class(type,name)SWIG Library chapter for further details.

    -

    35.7.3 Unbounded C Arrays

    +

    36.7.3 Unbounded C Arrays

    @@ -4063,7 +4063,7 @@ well suited for applications in which you need to create buffers, package binary data, etc.

    -

    35.7.4 String handling

    +

    36.7.4 String handling

    @@ -4132,7 +4132,7 @@ If you need to return binary data, you might use the also be used to extra binary data from arbitrary pointers.

    -

    35.8 Typemaps

    +

    36.8 Typemaps

    @@ -4149,7 +4149,7 @@ Typemaps are only used if you want to change some aspect of the primitive C-Python interface or if you want to elevate your guru status.

    -

    35.8.1 What is a typemap?

    +

    36.8.1 What is a typemap?

    @@ -4265,7 +4265,7 @@ parameter is omitted): -

    35.8.2 Python typemaps

    +

    36.8.2 Python typemaps

    @@ -4306,7 +4306,7 @@ a look at the SWIG library version 1.3.20 or so.

    -

    35.8.3 Typemap variables

    +

    36.8.3 Typemap variables

    @@ -4377,7 +4377,7 @@ properly assigned. The Python name of the wrapper function being created. -

    35.8.4 Useful Python Functions

    +

    36.8.4 Useful Python Functions

    @@ -4505,7 +4505,7 @@ write me -

    35.9 Typemap Examples

    +

    36.9 Typemap Examples

    @@ -4514,7 +4514,7 @@ might look at the files "python.swg" and "typemaps.i" in the SWIG library.

    -

    35.9.1 Converting Python list to a char **

    +

    36.9.1 Converting Python list to a char **

    @@ -4594,7 +4594,7 @@ memory allocation is used to allocate memory for the array, the the C function.

    -

    35.9.2 Expanding a Python object into multiple arguments

    +

    36.9.2 Expanding a Python object into multiple arguments

    @@ -4673,7 +4673,7 @@ to supply the argument count. This is automatically set by the typemap code. F -

    35.9.3 Using typemaps to return arguments

    +

    36.9.3 Using typemaps to return arguments

    @@ -4761,7 +4761,7 @@ function can now be used as follows: >>> -

    35.9.4 Mapping Python tuples into small arrays

    +

    36.9.4 Mapping Python tuples into small arrays

    @@ -4810,7 +4810,7 @@ array, such an approach would not be recommended for huge arrays, but for small structures, this approach works fine.

    -

    35.9.5 Mapping sequences to C arrays

    +

    36.9.5 Mapping sequences to C arrays

    @@ -4899,7 +4899,7 @@ static int convert_darray(PyObject *input, double *ptr, int size) { -

    35.9.6 Pointer handling

    +

    36.9.6 Pointer handling

    @@ -4996,7 +4996,7 @@ class object (if applicable). -

    35.10 Docstring Features

    +

    36.10 Docstring Features

    @@ -5024,7 +5024,7 @@ of your users much simpler.

    -

    35.10.1 Module docstring

    +

    36.10.1 Module docstring

    @@ -5058,7 +5058,7 @@ layout of controls on a panel, etc. to be loaded from an XML file." -

    35.10.2 %feature("autodoc")

    +

    36.10.2 %feature("autodoc")

    @@ -5086,7 +5086,7 @@ four levels for autodoc controlled by the value given to the feature, %feature("autodoc", "level"). The four values for level are covered in the following sub-sections. -

    35.10.2.1 %feature("autodoc", "0")

    +

    36.10.2.1 %feature("autodoc", "0")

    @@ -5115,7 +5115,7 @@ def function_name(*args, **kwargs): -

    35.10.2.2 %feature("autodoc", "1")

    +

    36.10.2.2 %feature("autodoc", "1")

    @@ -5140,7 +5140,7 @@ def function_name(*args, **kwargs): -

    35.10.2.3 %feature("autodoc", "2")

    +

    36.10.2.3 %feature("autodoc", "2")

    @@ -5200,7 +5200,7 @@ def function_name(*args, **kwargs): -

    35.10.2.4 %feature("autodoc", "3")

    +

    36.10.2.4 %feature("autodoc", "3")

    @@ -5225,7 +5225,7 @@ def function_name(*args, **kwargs): -

    35.10.2.5 %feature("autodoc", "docstring")

    +

    36.10.2.5 %feature("autodoc", "docstring")

    @@ -5244,7 +5244,7 @@ void GetPosition(int* OUTPUT, int* OUTPUT); -

    35.10.3 %feature("docstring")

    +

    36.10.3 %feature("docstring")

    @@ -5276,7 +5276,7 @@ with more than one line. -

    35.11 Python Packages

    +

    36.11 Python Packages

    Python has concepts of modules and packages. Modules are separate units of @@ -5334,7 +5334,7 @@ users may need to use special features such as the package option in th %module directive or import related command line options. These are explained in the following sections.

    -

    35.11.1 Setting the Python package

    +

    36.11.1 Setting the Python package

    @@ -5388,7 +5388,7 @@ pkg1/pkg2/_foo.so # (shared library built from C/C++ code generated by SWI -

    35.11.2 Absolute and relative imports

    +

    36.11.2 Absolute and relative imports

    Suppose, we have the following hierarchy of files:

    @@ -5527,7 +5527,7 @@ uses relative imports. Second case is, when one puts import directives in __init__.py to import symbols from submodules or subpackages and the submodule depends on other submodules (discussed later).

    -

    35.11.3 Enforcing absolute import semantics

    +

    36.11.3 Enforcing absolute import semantics

    As you may know, there is an incompatibility in import semantics (for the @@ -5564,7 +5564,7 @@ from __future__ import absolute_import -

    35.11.4 Importing from __init__.py

    +

    36.11.4 Importing from __init__.py

    Imports in __init__.py are handy when you want to populate a @@ -5675,7 +5675,7 @@ effect (note, that the Python 2 case also needs the -relativeimport workaround).

    -

    35.12 Python 3 Support

    +

    36.12 Python 3 Support

    @@ -5702,7 +5702,7 @@ The following are Python 3.0 new features that are currently supported by SWIG.

    -

    35.12.1 Function annotation

    +

    36.12.1 Function annotation

    @@ -5735,7 +5735,7 @@ For detailed usage of function annotation, see PEP 3107.

    -

    35.12.2 Buffer interface

    +

    36.12.2 Buffer interface

    @@ -5887,7 +5887,7 @@ modify the buffer. -

    35.12.3 Abstract base classes

    +

    36.12.3 Abstract base classes

    diff --git a/Doc/Manual/R.html b/Doc/Manual/R.html index ce9523ced..5de390eab 100644 --- a/Doc/Manual/R.html +++ b/Doc/Manual/R.html @@ -6,7 +6,7 @@ -

    36 SWIG and R

    +

    37 SWIG and R

      @@ -33,7 +33,7 @@ compile and run an R interface to QuantLib running on Mandriva Linux with gcc. The R bindings also work on Microsoft Windows using Visual C++.

      -

      36.1 Bugs

      +

      37.1 Bugs

      @@ -45,7 +45,7 @@ Currently the following features are not implemented or broken:

    • C Array wrappings
    -

    36.2 Using R and SWIG

    +

    37.2 Using R and SWIG

    @@ -119,7 +119,7 @@ Without it, inheritance of wrapped objects may fail. These two files can be loaded in any order

    -

    36.3 Precompiling large R files

    +

    37.3 Precompiling large R files

    In cases where the R file is large, one make save a lot of loading @@ -137,7 +137,7 @@ will save a large amount of loading time. -

    36.4 General policy

    +

    37.4 General policy

    @@ -146,7 +146,7 @@ wrapping over the underlying functions and rely on the R type system to provide R syntax.

    -

    36.5 Language conventions

    +

    37.5 Language conventions

    @@ -155,7 +155,7 @@ and [ are overloaded to allow for R syntax (one based indices and slices)

    -

    36.6 C++ classes

    +

    37.6 C++ classes

    @@ -167,7 +167,7 @@ keep track of the pointer object which removes the necessity for a lot of the proxy class baggage you see in other languages.

    -

    36.7 Enumerations

    +

    37.7 Enumerations

    diff --git a/Doc/Manual/Ruby.html b/Doc/Manual/Ruby.html index 9719239a9..cdebfe07b 100644 --- a/Doc/Manual/Ruby.html +++ b/Doc/Manual/Ruby.html @@ -7,7 +7,7 @@ -

    37 SWIG and Ruby

    +

    38 SWIG and Ruby

      @@ -144,7 +144,7 @@

      This chapter describes SWIG's support of Ruby.

      -

      37.1 Preliminaries

      +

      38.1 Preliminaries

      SWIG 1.3 is known to work with Ruby versions 1.6 and later. @@ -159,7 +159,7 @@ read the "SWIG Basics" chapter. It is also assumed that the reader has a basic understanding of Ruby.

      -

      37.1.1 Running SWIG

      +

      38.1.1 Running SWIG

      To build a Ruby module, run SWIG using the -ruby @@ -183,7 +183,7 @@ if compiling a C++ extension) that contains all of the code needed to build a Ruby extension module. To finish building the module, you need to compile this file and link it with the rest of your program.

      -

      37.1.2 Getting the right header files

      +

      38.1.2 Getting the right header files

      In order to compile the wrapper code, the compiler needs the ruby.h @@ -206,7 +206,7 @@ installed, you can run Ruby to find out. For example:

    -

    37.1.3 Compiling a dynamic module

    +

    38.1.3 Compiling a dynamic module

    Ruby extension modules are typically compiled into shared @@ -279,7 +279,7 @@ manual pages for your compiler and linker to determine the correct set of options. You might also check the SWIG Wiki for additional information.

    -

    37.1.4 Using your module

    +

    38.1.4 Using your module

    Ruby module names must be capitalized, @@ -309,7 +309,7 @@ begins with:

    will result in an extension module using the feature name "example" and Ruby module name "Example".

    -

    37.1.5 Static linking

    +

    38.1.5 Static linking

    An alternative approach to dynamic linking is to rebuild the @@ -324,7 +324,7 @@ finding the Ruby source, adding an entry to the ext/Setup file, adding your directory to the list of extensions in the file, and finally rebuilding Ruby.

    -

    37.1.6 Compilation of C++ extensions

    +

    38.1.6 Compilation of C++ extensions

    On most machines, C++ extension modules should be linked @@ -356,7 +356,7 @@ $libs = append_library($libs, "supc++") create_makefile('example')

    -

    37.2 Building Ruby Extensions under Windows 95/NT

    +

    38.2 Building Ruby Extensions under Windows 95/NT

    Building a SWIG extension to Ruby under Windows 95/NT is @@ -381,7 +381,7 @@ order to build extensions, you may need to download the source distribution to the Ruby package, as you will need the Ruby header files.

    -

    37.2.1 Running SWIG from Developer Studio

    +

    38.2.1 Running SWIG from Developer Studio

    If you are developing your application within Microsoft @@ -445,13 +445,13 @@ Foo = 3.0 -

    37.3 The Ruby-to-C/C++ Mapping

    +

    38.3 The Ruby-to-C/C++ Mapping

    This section describes the basics of how SWIG maps C or C++ declarations in your SWIG interface files to Ruby constructs.

    -

    37.3.1 Modules

    +

    38.3.1 Modules

    The SWIG %module directive specifies @@ -523,7 +523,7 @@ option to wrap everything into the global module, take care that the names of your constants, classes and methods don't conflict with any of Ruby's built-in names.

    -

    37.3.2 Functions

    +

    38.3.2 Functions

    Global functions are wrapped as Ruby module methods. For @@ -557,7 +557,7 @@ irb(main):002:0> Example.fact(4) 24 -

    37.3.3 Variable Linking

    +

    38.3.3 Variable Linking

    C/C++ global variables are wrapped as a pair of singleton @@ -619,7 +619,7 @@ directive. For example:

    effect until it is explicitly disabled using %mutable.

    -

    37.3.4 Constants

    +

    38.3.4 Constants

    C/C++ constants are wrapped as module constants initialized @@ -647,7 +647,7 @@ irb(main):002:0> Example::PI 3.14159 -

    37.3.5 Pointers

    +

    38.3.5 Pointers

    "Opaque" pointers to arbitrary C/C++ types (i.e. types that @@ -671,7 +671,7 @@ returns an instance of an internally generated Ruby class:

    A NULL pointer is always represented by the Ruby nil object.

    -

    37.3.6 Structures

    +

    38.3.6 Structures

    C/C++ structs are wrapped as Ruby classes, with accessor @@ -776,7 +776,7 @@ void Bar_f_set(Bar *b, Foo *val) { } -

    37.3.7 C++ classes

    +

    38.3.7 C++ classes

    Like structs, C++ classes are wrapped by creating a new Ruby @@ -831,7 +831,7 @@ Ale 3 -

    37.3.8 C++ Inheritance

    +

    38.3.8 C++ Inheritance

    The SWIG type-checker is fully aware of C++ inheritance. @@ -984,7 +984,7 @@ inherit from both Base1 and Base2 (i.e. they exhibit "Duck Typing").

    -

    37.3.9 C++ Overloaded Functions

    +

    38.3.9 C++ Overloaded Functions

    C++ overloaded functions, methods, and constructors are @@ -1074,7 +1074,7 @@ arises--in this case, the first declaration takes precedence.

    Please refer to the "SWIG and C++" chapter for more information about overloading.

    -

    37.3.10 C++ Operators

    +

    38.3.10 C++ Operators

    For the most part, overloaded operators are handled @@ -1116,7 +1116,7 @@ c = Example.add_complex(a, b) is discussed in the section on operator overloading.

    -

    37.3.11 C++ namespaces

    +

    38.3.11 C++ namespaces

    SWIG is aware of C++ namespaces, but namespace names do not @@ -1173,7 +1173,7 @@ and create extension modules for each namespace separately. If your program utilizes thousands of small deeply nested namespaces each with identical symbol names, well, then you get what you deserve.

    -

    37.3.12 C++ templates

    +

    38.3.12 C++ templates

    C++ templates don't present a huge problem for SWIG. However, @@ -1215,7 +1215,7 @@ irb(main):004:0> p.second 4 -

    37.3.13 C++ Standard Template Library (STL)

    +

    38.3.13 C++ Standard Template Library (STL)

    On a related note, the standard SWIG library contains a @@ -1308,7 +1308,7 @@ puts v shown in these examples. More details can be found in the SWIG and C++ chapter.

    -

    37.3.14 C++ STL Functors

    +

    38.3.14 C++ STL Functors

    Some containers in the STL allow you to modify their default @@ -1369,7 +1369,7 @@ b -

    37.3.15 C++ STL Iterators

    +

    38.3.15 C++ STL Iterators

    The STL is well known for the use of iterators. There @@ -1452,7 +1452,7 @@ i

    If you'd rather have STL classes without any iterators, you should define -DSWIG_NO_EXPORT_ITERATOR_METHODS when running swig.

    -

    37.3.16 C++ Smart Pointers

    +

    38.3.16 C++ Smart Pointers

    In certain C++ programs, it is common to use classes that @@ -1517,7 +1517,7 @@ method. For example:

    irb(main):004:0> f = p.__deref__() # Returns underlying Foo *
    -

    37.3.17 Cross-Language Polymorphism

    +

    38.3.17 Cross-Language Polymorphism

    SWIG's Ruby module supports cross-language polymorphism @@ -1526,7 +1526,7 @@ module. Rather than duplicate the information presented in the 37.3.17.1 Exception Unrolling +

    38.3.17.1 Exception Unrolling

    Whenever a C++ director class routes one of its virtual @@ -1549,7 +1549,7 @@ method is "wrapped" using the rb_rescue2() function from Ruby's C API. If any Ruby exception is raised, it will be caught here and a C++ exception is raised in its place.

    -

    37.4 Naming

    +

    38.4 Naming

    Ruby has several common naming conventions. Constants are @@ -1587,7 +1587,7 @@ generated by SWIG, it is turned off by default in SWIG 1.3.28. However, it is planned to become the default option in future releases.

    -

    37.4.1 Defining Aliases

    +

    38.4.1 Defining Aliases

    It's a fairly common practice in the Ruby built-ins and @@ -1657,7 +1657,7 @@ matching rules used for other kinds of features apply (see the chapter on "Customization Features") for more details).

    -

    37.4.2 Predicate Methods

    +

    38.4.2 Predicate Methods

    Ruby methods that return a boolean value and end in a @@ -1706,7 +1706,7 @@ using SWIG's "features" mechanism and so the same name matching rules used for other kinds of features apply (see the chapter on "Customization Features") for more details).

    -

    37.4.3 Bang Methods

    +

    38.4.3 Bang Methods

    Ruby methods that modify an object in-place and end in an @@ -1738,7 +1738,7 @@ using SWIG's "features" mechanism and so the same name matching rules used for other kinds of features apply (see the chapter on "Customization Features") for more details).

    -

    37.4.4 Getters and Setters

    +

    38.4.4 Getters and Setters

    Often times a C++ library will expose properties through @@ -1773,7 +1773,7 @@ irb(main):003:0> puts foo.value %rename("value=") Foo::setValue(int value); -

    37.5 Input and output parameters

    +

    38.5 Input and output parameters

    A common problem in some C programs is handling parameters @@ -1912,10 +1912,10 @@ void get_dimensions(Matrix *m, int *rows, int*columns);

    r, c = Example.get_dimensions(m)
    -

    37.6 Exception handling

    +

    38.6 Exception handling

    -

    37.6.1 Using the %exception directive

    +

    38.6.1 Using the %exception directive

    The SWIG %exception directive can be @@ -2024,7 +2024,7 @@ methods and functions named getitem and setitem. limited to C++ exception handling. See the chapter on Customization Features for more examples.

    -

    37.6.2 Handling Ruby Blocks

    +

    38.6.2 Handling Ruby Blocks

    One of the highlights of Ruby and most of its standard library @@ -2091,7 +2091,7 @@ a special in typemap, like:

    For more information on typemaps, see Typemaps.

    -

    37.6.3 Raising exceptions

    +

    38.6.3 Raising exceptions

    There are three ways to raise exceptions from C++ code to @@ -2248,7 +2248,7 @@ function. The first argument passed to rb_raise() is the exception type. You can raise a custom exception type or one of the built-in Ruby exception types.

    -

    37.6.4 Exception classes

    +

    38.6.4 Exception classes

    Starting with SWIG 1.3.28, the Ruby module supports the %exceptionclass @@ -2285,7 +2285,7 @@ end

    For another example look at swig/Examples/ruby/exception_class.

    -

    37.7 Typemaps

    +

    38.7 Typemaps

    This section describes how you can modify SWIG's default @@ -2300,7 +2300,7 @@ a required part of using SWIG---the default wrapping behavior is enough in most cases. Typemaps are only used if you want to change some aspect of the primitive C-Ruby interface.

    -

    37.7.1 What is a typemap?

    +

    38.7.1 What is a typemap?

    A typemap is nothing more than a code generation rule that is @@ -2457,7 +2457,7 @@ to be used as follows (notice how the length parameter is omitted):

    2 -

    37.7.2 Typemap scope

    +

    38.7.2 Typemap scope

    Once defined, a typemap remains in effect for all of the @@ -2503,7 +2503,7 @@ where the class itself is defined. For example:

    }; -

    37.7.3 Copying a typemap

    +

    38.7.3 Copying a typemap

    A typemap is copied by using assignment. For example:

    @@ -2545,7 +2545,7 @@ rules as for %apply (char *buf, int len) { (char *buffer, int size) }; // Multiple arguments -

    37.7.4 Deleting a typemap

    +

    38.7.4 Deleting a typemap

    A typemap can be deleted by simply defining no code. For @@ -2570,7 +2570,7 @@ defined by typemaps, clearing a fundamental type like int will make that type unusable unless you also define a new set of typemaps immediately after the clear operation.

    -

    37.7.5 Placement of typemaps

    +

    38.7.5 Placement of typemaps

    Typemap declarations can be declared in the global scope, @@ -2641,13 +2641,13 @@ In this example, this is done using the class declaration class string .

    -

    37.7.6 Ruby typemaps

    +

    38.7.6 Ruby typemaps

    The following list details all of the typemap methods that can be used by the Ruby module:

    -

    37.7.6.1 "in" typemap

    +

    38.7.6.1 "in" typemap

    Converts Ruby objects to input @@ -2714,7 +2714,7 @@ arguments to be specified. For example:

    At this time, only zero or one arguments may be converted.

    -

    37.7.6.2 "typecheck" typemap

    +

    38.7.6.2 "typecheck" typemap

    The "typecheck" typemap is used to support overloaded @@ -2736,7 +2736,7 @@ program uses overloaded methods, you should also define a collection of "typecheck" typemaps. More details about this follow in a later section on "Typemaps and Overloading."

    -

    37.7.6.3 "out" typemap

    +

    38.7.6.3 "out" typemap

    Converts return value of a C function @@ -2787,7 +2787,7 @@ version of the C datatype matched by the typemap.

    -

    37.7.6.4 "arginit" typemap

    +

    38.7.6.4 "arginit" typemap

    The "arginit" typemap is used to set the initial value of a @@ -2802,7 +2802,7 @@ applications. For example:

    } -

    37.7.6.5 "default" typemap

    +

    38.7.6.5 "default" typemap

    The "default" typemap is used to turn an argument into a @@ -2827,7 +2827,7 @@ arguments that follow must have default values. See the 37.7.6.6 "check" typemap +

    38.7.6.6 "check" typemap

    The "check" typemap is used to supply value checking code @@ -2842,7 +2842,7 @@ arguments have been converted. For example:

    } -

    37.7.6.7 "argout" typemap

    +

    38.7.6.7 "argout" typemap

    The "argout" typemap is used to return values from arguments. @@ -2896,7 +2896,7 @@ some function like SWIG_Ruby_AppendOutput.

    See the typemaps.i library for examples.

    -

    37.7.6.8 "freearg" typemap

    +

    38.7.6.8 "freearg" typemap

    The "freearg" typemap is used to cleanup argument data. It is @@ -2923,7 +2923,7 @@ This code is also placed into a special variable $cleanup that may be used in other typemaps whenever a wrapper function needs to abort prematurely.

    -

    37.7.6.9 "newfree" typemap

    +

    38.7.6.9 "newfree" typemap

    The "newfree" typemap is used in conjunction with the %newobject @@ -2947,7 +2947,7 @@ string *foo();

    See Object ownership and %newobject for further details.

    -

    37.7.6.10 "memberin" typemap

    +

    38.7.6.10 "memberin" typemap

    The "memberin" typemap is used to copy data from an @@ -2965,21 +2965,21 @@ example:

    already provides a default implementation for arrays, strings, and other objects.

    -

    37.7.6.11 "varin" typemap

    +

    38.7.6.11 "varin" typemap

    The "varin" typemap is used to convert objects in the target language to C for the purposes of assigning to a C/C++ global variable. This is implementation specific.

    -

    37.7.6.12 "varout" typemap

    +

    38.7.6.12 "varout" typemap

    The "varout" typemap is used to convert a C/C++ object to an object in the target language when reading a C/C++ global variable. This is implementation specific.

    -

    37.7.6.13 "throws" typemap

    +

    38.7.6.13 "throws" typemap

    The "throws" typemap is only used when SWIG parses a C++ @@ -3020,7 +3020,7 @@ specification yet they do throw exceptions, SWIG cannot know how to deal with them. For a neat way to handle these, see the Exception handling with %exception section.

    -

    37.7.6.14 directorin typemap

    +

    38.7.6.14 directorin typemap

    Converts C++ objects in director @@ -3079,7 +3079,7 @@ referring to the class itself. -

    37.7.6.15 directorout typemap

    +

    38.7.6.15 directorout typemap

    Converts Ruby objects in director @@ -3152,7 +3152,7 @@ exception.

    -

    37.7.6.16 directorargout typemap

    +

    38.7.6.16 directorargout typemap

    Output argument processing in director @@ -3210,19 +3210,19 @@ referring to the instance of the class itself -

    37.7.6.17 ret typemap

    +

    38.7.6.17 ret typemap

    Cleanup of function return values

    -

    37.7.6.18 globalin typemap

    +

    38.7.6.18 globalin typemap

    Setting of C global variables

    -

    37.7.7 Typemap variables

    +

    38.7.7 Typemap variables

    @@ -3272,7 +3272,7 @@ so that their values can be properly assigned.

    The Ruby name of the wrapper function being created.
    -

    37.7.8 Useful Functions

    +

    38.7.8 Useful Functions

    When you write a typemap, you usually have to work directly @@ -3287,7 +3287,7 @@ stick to the swig functions instead of the native Ruby functions. That should help you avoid having to rewrite a lot of typemaps across multiple languages.

    -

    37.7.8.1 C Datatypes to Ruby Objects

    +

    38.7.8.1 C Datatypes to Ruby Objects

    @@ -3329,7 +3329,7 @@ SWIG_From_float(float)
    -

    37.7.8.2 Ruby Objects to C Datatypes

    +

    38.7.8.2 Ruby Objects to C Datatypes

    Here, while the Ruby versions return the value directly, the SWIG @@ -3397,7 +3397,7 @@ versions do not, but return a status value to indicate success (SWIG_OK -

    37.7.8.3 Macros for VALUE

    +

    38.7.8.3 Macros for VALUE

    RSTRING_LEN(str)

    @@ -3420,7 +3420,7 @@ versions do not, but return a status value to indicate success (SWIG_OK
    pointer to array storage
    -

    37.7.8.4 Exceptions

    +

    38.7.8.4 Exceptions

    void rb_raise(VALUE exception, const char *fmt, @@ -3499,7 +3499,7 @@ message to standard error if Ruby was invoked with the -w flag. The given format string fmt and remaining arguments are interpreted as with printf(). -

    37.7.8.5 Iterators

    +

    38.7.8.5 Iterators

    void rb_iter_break()

    @@ -3545,14 +3545,14 @@ VALUE), VALUE value)

    Equivalent to Ruby's throw.
    -

    37.7.9 Typemap Examples

    +

    38.7.9 Typemap Examples

    This section includes a few examples of typemaps. For more examples, you might look at the examples in the Example/ruby directory.

    -

    37.7.10 Converting a Ruby array to a char **

    +

    38.7.10 Converting a Ruby array to a char **

    A common problem in many C programs is the processing of @@ -3617,7 +3617,7 @@ array. Since dynamic memory allocation is used to allocate memory for the array, the "freearg" typemap is used to later release this memory after the execution of the C function.

    -

    37.7.11 Collecting arguments in a hash

    +

    38.7.11 Collecting arguments in a hash

    Ruby's solution to the "keyword arguments" capability of some @@ -3831,7 +3831,7 @@ memory leak. Fortunately, this typemap is a lot easier to write:

    program that uses the extension, can be found in the Examples/ruby/hashargs directory of the SWIG distribution.

    -

    37.7.12 Pointer handling

    +

    38.7.12 Pointer handling

    Occasionally, it might be necessary to convert pointer values @@ -3890,7 +3890,7 @@ For example:

    } -

    37.7.12.1 Ruby Datatype Wrapping

    +

    38.7.12.1 Ruby Datatype Wrapping

    VALUE Data_Wrap_Struct(VALUE class, void @@ -3917,7 +3917,7 @@ as above. type c-type from the data object obj and assigns that pointer to ptr. -

    37.7.13 Example: STL Vector to Ruby Array

    +

    38.7.13 Example: STL Vector to Ruby Array

    Another use for macros and type maps is to create a Ruby array @@ -4009,7 +4009,7 @@ STL with ruby, you are advised to use the standard swig STL library, which does much more than this. Refer to the section called the C++ Standard Template Library. -

    37.8 Docstring Features

    +

    38.8 Docstring Features

    @@ -4043,7 +4043,7 @@ generate ri documentation from a c wrap file, you could do:

    $ rdoc -r file_wrap.c -

    37.8.1 Module docstring

    +

    38.8.1 Module docstring

    @@ -4073,7 +4073,7 @@ layout of controls on a panel, etc. to be loaded from an XML file." %module(docstring=DOCSTRING) xrc -

    37.8.2 %feature("autodoc")

    +

    38.8.2 %feature("autodoc")

    Since SWIG does know everything about the function it wraps, @@ -4094,7 +4094,7 @@ several options for autodoc controlled by the value given to the feature, described below.

    -

    37.8.2.1 %feature("autodoc", "0")

    +

    38.8.2.1 %feature("autodoc", "0")

    @@ -4118,7 +4118,7 @@ Then Ruby code like this will be generated: ... -

    37.8.2.2 %feature("autodoc", "1")

    +

    38.8.2.2 %feature("autodoc", "1")

    @@ -4138,7 +4138,7 @@ this: ... -

    37.8.2.3 %feature("autodoc", "2")

    +

    38.8.2.3 %feature("autodoc", "2")

    @@ -4150,7 +4150,7 @@ parameter types with the "2" option will result in Ruby code like this:

    -

    37.8.2.4 %feature("autodoc", "3")

    +

    38.8.2.4 %feature("autodoc", "3")

    @@ -4171,7 +4171,7 @@ Parameters: bar - Bar -

    37.8.2.5 %feature("autodoc", "docstring")

    +

    38.8.2.5 %feature("autodoc", "docstring")

    @@ -4187,7 +4187,7 @@ generated string. For example: void GetPosition(int* OUTPUT, int* OUTPUT); -

    37.8.3 %feature("docstring")

    +

    38.8.3 %feature("docstring")

    @@ -4198,10 +4198,10 @@ docstring associated with classes, function or methods are output. If an item already has an autodoc string then it is combined with the docstring and they are output together.

    -

    37.9 Advanced Topics

    +

    38.9 Advanced Topics

    -

    37.9.1 Operator overloading

    +

    38.9.1 Operator overloading

    SWIG allows operator overloading with, by using the %extend @@ -4382,7 +4382,7 @@ separate method for handling inequality since Ruby parses the expression a != b as !(a == b).

    -

    37.9.2 Creating Multi-Module Packages

    +

    38.9.2 Creating Multi-Module Packages

    The chapter on Working @@ -4508,7 +4508,7 @@ irb(main):005:0> c.getX() 5.0 -

    37.9.3 Specifying Mixin Modules

    +

    38.9.3 Specifying Mixin Modules

    The Ruby language doesn't support multiple inheritance, but @@ -4575,7 +4575,7 @@ matching rules used for other kinds of features apply (see the chapter on "Customization Features") for more details).

    -

    37.10 Memory Management

    +

    38.10 Memory Management

    One of the most common issues in generating SWIG bindings for @@ -4598,7 +4598,7 @@ to C++ (or vice versa) depending on what function or methods are invoked. Clearly, developing a SWIG wrapper requires a thorough understanding of how the underlying library manages memory.

    -

    37.10.1 Mark and Sweep Garbage Collector

    +

    38.10.1 Mark and Sweep Garbage Collector

    Ruby uses a mark and sweep garbage collector. When the garbage @@ -4630,7 +4630,7 @@ any memory has been allocated in creating the underlying C struct or C++ struct, then a "free" function must be defined that deallocates this memory.

    -

    37.10.2 Object Ownership

    +

    38.10.2 Object Ownership

    As described above, memory management depends on clearly @@ -4775,7 +4775,7 @@ public:

    This code can be seen in swig/examples/ruby/tracking.

    -

    37.10.3 Object Tracking

    +

    38.10.3 Object Tracking

    The remaining parts of this section will use the class library @@ -5000,7 +5000,7 @@ However, if you implement your own free functions (see below) you may also have to call the SWIG_RubyRemoveTracking and RubyUnlinkObjects methods.

    -

    37.10.4 Mark Functions

    +

    38.10.4 Mark Functions

    With a bit more testing, we see that our class library still @@ -5129,7 +5129,7 @@ irb(main):016:0>

    This code can be seen in swig/examples/ruby/mark_function.

    -

    37.10.5 Free Functions

    +

    38.10.5 Free Functions

    By default, SWIG creates a "free" function that is called when @@ -5296,7 +5296,7 @@ been freed, and thus raises a runtime exception.

    This code can be seen in swig/examples/ruby/free_function.

    -

    37.10.6 Embedded Ruby and the C++ Stack

    +

    38.10.6 Embedded Ruby and the C++ Stack

    As has been said, the Ruby GC runs and marks objects before diff --git a/Doc/Manual/Tcl.html b/Doc/Manual/Tcl.html index 45eebbf5e..c12701ac9 100644 --- a/Doc/Manual/Tcl.html +++ b/Doc/Manual/Tcl.html @@ -6,7 +6,7 @@ -

    38 SWIG and Tcl

    +

    39 SWIG and Tcl

      @@ -83,7 +83,7 @@ Tcl 8.0 or a later release. Earlier releases of SWIG supported Tcl 7.x, but this is no longer supported.

      -

      38.1 Preliminaries

      +

      39.1 Preliminaries

      @@ -109,7 +109,7 @@ build a Tcl extension module. To finish building the module, you need to compile this file and link it with the rest of your program.

      -

      38.1.1 Getting the right header files

      +

      39.1.1 Getting the right header files

      @@ -127,7 +127,7 @@ this is the case, you should probably make a symbolic link so that tcl.h -

      38.1.2 Compiling a dynamic module

      +

      39.1.2 Compiling a dynamic module

      @@ -163,7 +163,7 @@ The name of the module is specified using the %module directive or the -module command line option.

      -

      38.1.3 Static linking

      +

      39.1.3 Static linking

      @@ -229,7 +229,7 @@ minimal in most situations (and quite frankly not worth the extra hassle in the opinion of this author).

      -

      38.1.4 Using your module

      +

      39.1.4 Using your module

      @@ -357,7 +357,7 @@ to the default system configuration (this requires root access and you will need the man pages).

      -

      38.1.5 Compilation of C++ extensions

      +

      39.1.5 Compilation of C++ extensions

      @@ -440,7 +440,7 @@ erratic program behavior. If working with lots of software components, you might want to investigate using a more formal standard such as COM.

      -

      38.1.6 Compiling for 64-bit platforms

      +

      39.1.6 Compiling for 64-bit platforms

      @@ -467,7 +467,7 @@ also introduce problems on platforms that support more than one linking standard (e.g., -o32 and -n32 on Irix).

      -

      38.1.7 Setting a package prefix

      +

      39.1.7 Setting a package prefix

      @@ -486,7 +486,7 @@ option will append the prefix to the name when creating a command and call it "Foo_bar".

      -

      38.1.8 Using namespaces

      +

      39.1.8 Using namespaces

      @@ -508,7 +508,7 @@ When the -namespace option is used, objects in the module are always accessed with the namespace name such as Foo::bar.

      -

      38.2 Building Tcl/Tk Extensions under Windows 95/NT

      +

      39.2 Building Tcl/Tk Extensions under Windows 95/NT

      @@ -519,7 +519,7 @@ covers the process of using SWIG with Microsoft Visual C++. although the procedure may be similar with other compilers.

      -

      38.2.1 Running SWIG from Developer Studio

      +

      39.2.1 Running SWIG from Developer Studio

      @@ -577,7 +577,7 @@ MSDOS > tclsh80 %

    -

    38.2.2 Using NMAKE

    +

    39.2.2 Using NMAKE

    @@ -640,7 +640,7 @@ to get you started. With a little practice, you'll be making lots of Tcl extensions.

    -

    38.3 A tour of basic C/C++ wrapping

    +

    39.3 A tour of basic C/C++ wrapping

    @@ -651,7 +651,7 @@ classes. This section briefly covers the essential aspects of this wrapping.

    -

    38.3.1 Modules

    +

    39.3.1 Modules

    @@ -685,7 +685,7 @@ To fix this, supply an extra argument to load like this: -

    38.3.2 Functions

    +

    39.3.2 Functions

    @@ -710,7 +710,7 @@ like you think it does: % -

    38.3.3 Global variables

    +

    39.3.3 Global variables

    @@ -790,7 +790,7 @@ extern char *path; // Read-only (due to %immutable) -

    38.3.4 Constants and enums

    +

    39.3.4 Constants and enums

    @@ -874,7 +874,7 @@ When an identifier name is given, it is used to perform an implicit hash-table l conversion. This allows the global statement to be omitted.

    -

    38.3.5 Pointers

    +

    39.3.5 Pointers

    @@ -970,7 +970,7 @@ C-style cast may return a bogus result whereas as the C++-style cast will return None if the conversion can't be performed.

    -

    38.3.6 Structures

    +

    39.3.6 Structures

    @@ -1252,7 +1252,7 @@ Note: Tcl only destroys the underlying object if it has ownership. See the memory management section that appears shortly.

    -

    38.3.7 C++ classes

    +

    39.3.7 C++ classes

    @@ -1319,7 +1319,7 @@ In Tcl, the static member is accessed as follows: -

    38.3.8 C++ inheritance

    +

    39.3.8 C++ inheritance

    @@ -1368,7 +1368,7 @@ For instance: It is safe to use multiple inheritance with SWIG.

    -

    38.3.9 Pointers, references, values, and arrays

    +

    39.3.9 Pointers, references, values, and arrays

    @@ -1422,7 +1422,7 @@ to hold the result and a pointer is returned (Tcl will release this memory when the return value is garbage collected).

    -

    38.3.10 C++ overloaded functions

    +

    39.3.10 C++ overloaded functions

    @@ -1545,7 +1545,7 @@ first declaration takes precedence. Please refer to the "SWIG and C++" chapter for more information about overloading.

    -

    38.3.11 C++ operators

    +

    39.3.11 C++ operators

    @@ -1647,7 +1647,7 @@ There are ways to make this operator appear as part of the class using the % Keep reading.

    -

    38.3.12 C++ namespaces

    +

    39.3.12 C++ namespaces

    @@ -1711,7 +1711,7 @@ utilizes thousands of small deeply nested namespaces each with identical symbol names, well, then you get what you deserve.

    -

    38.3.13 C++ templates

    +

    39.3.13 C++ templates

    @@ -1763,7 +1763,7 @@ More details can be found in the SWIG and C++ -

    38.3.14 C++ Smart Pointers

    +

    39.3.14 C++ Smart Pointers

    @@ -1847,7 +1847,7 @@ simply use the __deref__() method. For example: -

    38.4 Further details on the Tcl class interface

    +

    39.4 Further details on the Tcl class interface

    @@ -1860,7 +1860,7 @@ of low-level details were omitted. This section provides a brief overview of how the proxy classes work.

    -

    38.4.1 Proxy classes

    +

    39.4.1 Proxy classes

    @@ -1925,7 +1925,7 @@ function. This allows objects to be encapsulated objects that look a lot like as shown in the last section.

    -

    38.4.2 Memory management

    +

    39.4.2 Memory management

    @@ -2113,7 +2113,7 @@ typemaps--an advanced topic discussed later.

    -

    38.5 Input and output parameters

    +

    39.5 Input and output parameters

    @@ -2301,7 +2301,7 @@ set c [lindex $dim 1] -

    38.6 Exception handling

    +

    39.6 Exception handling

    @@ -2435,7 +2435,7 @@ Since SWIG's exception handling is user-definable, you are not limited to C++ ex See the chapter on "Customization Features" for more examples.

    -

    38.7 Typemaps

    +

    39.7 Typemaps

    @@ -2452,7 +2452,7 @@ Typemaps are only used if you want to change some aspect of the primitive C-Tcl interface.

    -

    38.7.1 What is a typemap?

    +

    39.7.1 What is a typemap?

    @@ -2569,7 +2569,7 @@ parameter is omitted): -

    38.7.2 Tcl typemaps

    +

    39.7.2 Tcl typemaps

    @@ -2707,7 +2707,7 @@ Initialize an argument to a value before any conversions occur. Examples of these methods will appear shortly.

    -

    38.7.3 Typemap variables

    +

    39.7.3 Typemap variables

    @@ -2778,7 +2778,7 @@ properly assigned. The Tcl name of the wrapper function being created. -

    38.7.4 Converting a Tcl list to a char **

    +

    39.7.4 Converting a Tcl list to a char **

    @@ -2840,7 +2840,7 @@ argv[2] = Larry 3 -

    38.7.5 Returning values in arguments

    +

    39.7.5 Returning values in arguments

    @@ -2882,7 +2882,7 @@ result, a Tcl function using these typemaps will work like this : % -

    38.7.6 Useful functions

    +

    39.7.6 Useful functions

    @@ -2959,7 +2959,7 @@ int Tcl_IsShared(Tcl_Obj *obj); -

    38.7.7 Standard typemaps

    +

    39.7.7 Standard typemaps

    @@ -3043,7 +3043,7 @@ work) -

    38.7.8 Pointer handling

    +

    39.7.8 Pointer handling

    @@ -3119,7 +3119,7 @@ For example: -

    38.8 Turning a SWIG module into a Tcl Package.

    +

    39.8 Turning a SWIG module into a Tcl Package.

    @@ -3191,7 +3191,7 @@ As a final note, most SWIG examples do not yet use the to use the load command instead.

    -

    38.9 Building new kinds of Tcl interfaces (in Tcl)

    +

    39.9 Building new kinds of Tcl interfaces (in Tcl)

    @@ -3290,7 +3290,7 @@ danger of blowing something up (although it is easily accomplished with an out of bounds array access).

    -

    38.9.1 Proxy classes

    +

    39.9.1 Proxy classes

    @@ -3411,7 +3411,7 @@ short, but clever Tcl script can be combined with SWIG to do many interesting things.

    -

    38.10 Tcl/Tk Stubs

    +

    39.10 Tcl/Tk Stubs

    From a6d71e6c57dedcdf520f1d62026fe35a43fbb549 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Fri, 2 May 2014 00:04:23 +0200 Subject: [PATCH 005/152] configure.ac: fix to Javascript configuration - setting SKIP_JAVASCRIPT assumes that JSCENABLED/JSV8ENABLED are empty when jsc/v8 are not available --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 6d70f1da8..46c7479d0 100644 --- a/configure.ac +++ b/configure.ac @@ -1203,7 +1203,7 @@ else if test -z "$JSCORELIB"; then AC_MSG_RESULT(not found) - JSCENABLED=0 + JSCENABLED= else JSCOREDYNAMICLINKING="$JSCORELIB" JSCENABLED=1 @@ -1270,7 +1270,7 @@ else if test "$JSV8LIB" = "" ; then AC_MSG_RESULT(not found) - JSV8ENABLED=0 + JSV8ENABLED= else AC_MSG_RESULT($JSV8LIBDIR) JSV8ENABLED=1 From 00a02a3d9c84c531087a072979681e00f93e3f2a Mon Sep 17 00:00:00 2001 From: xantares Date: Sat, 10 May 2014 12:09:52 +0200 Subject: [PATCH 006/152] Fix duplicate entry --- Examples/test-suite/common.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 2a4591524..c8789cb99 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -409,7 +409,6 @@ CPP_TEST_CASES += \ template_partial_specialization \ template_partial_specialization_typedef \ template_qualifier \ - template_qualifier \ template_ref_type \ template_rename \ template_retvalue \ From 55bda53145d2898bd4642926b25209c12738e558 Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Sat, 10 May 2014 22:16:26 +0400 Subject: [PATCH 007/152] C nested classes symbol table should be in global space --- Source/CParse/parser.y | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 7e7e5633f..26af7be2d 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -3515,6 +3515,9 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE { } else { cplus_mode = CPLUS_PUBLIC; } + if (!cparse_cplusplus) { + set_scope_to_global(); + } Swig_symbol_newscope(); Swig_symbol_setscopename($3); Swig_inherit_base_symbols(bases); From 4fe6622f64fe05eb14ff397c903970898b78c87a Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Fri, 2 May 2014 00:41:43 +0200 Subject: [PATCH 008/152] configure.ac: print configured languages at end of configuration --- configure.ac | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/configure.ac b/configure.ac index 46c7479d0..eeabd11b4 100644 --- a/configure.ac +++ b/configure.ac @@ -2678,4 +2678,40 @@ AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig]) AC_CONFIG_FILES([CCache/ccache_swig_config.h]) AC_OUTPUT + +langs="" +test -n "$SKIP_ALLEGROCL" || langs="$langs allegrocl" +test -n "$SKIP_CFFI" || langs="$langs cffi" +test -n "$SKIP_CHICKEN" || langs="$langs chicken" +test -n "$SKIP_CLISP" || langs="$langs clisp" +test -n "$SKIP_CSHARP" || langs="$langs csharp" +test -n "$SKIP_D" || langs="$langs d" +test -n "$SKIP_GO" || langs="$langs go" +test -n "$SKIP_GUILE" || langs="$langs guile" +test -n "$SKIP_JAVA" || langs="$langs java" +test -n "$SKIP_JAVASCRIPT" || langs="$langs javascript" +test -n "$SKIP_LUA" || langs="$langs lua" +test -n "$SKIP_MODULA3" || langs="$langs modula3" +test -n "$SKIP_MZSCHEME" || langs="$langs mzscheme" +test -n "$SKIP_OCAML" || langs="$langs ocaml" +test -n "$SKIP_OCTAVE" || langs="$langs octave" +test -n "$SKIP_PERL5" || langs="$langs perl5" +test -n "$SKIP_PHP" || langs="$langs php" +test -n "$SKIP_PIKE" || langs="$langs pike" +test -n "$SKIP_PYTHON" || langs="$langs python" +test -n "$SKIP_R" || langs="$langs r" +test -n "$SKIP_RUBY" || langs="$langs ruby" +test -n "$SKIP_TCL" || langs="$langs tcl" +test -n "$SKIP_UFFI" || langs="$langs uffi" + +echo " +======================================================== + +SWIG is configured for use with the following languages: + +$langs + +======================================================== +" + dnl configure.ac ends here From 6fc07c5dc9a05669174b2c03881619bcb492ec5b Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Fri, 2 May 2014 01:28:15 +0200 Subject: [PATCH 009/152] Fix segmentation fault in some Javascript examples - memory allocated with malloc() was then being freed with delete[], which is overridden by Javascript libraries (jsc), leading to segfault - replacing malloc with %new_array seems to work though --- Lib/javascript/jsc/javascriptstrings.swg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/javascript/jsc/javascriptstrings.swg b/Lib/javascript/jsc/javascriptstrings.swg index 0581c1920..10a0e252a 100644 --- a/Lib/javascript/jsc/javascriptstrings.swg +++ b/Lib/javascript/jsc/javascriptstrings.swg @@ -8,7 +8,7 @@ SWIG_JSC_AsCharPtrAndSize(JSContextRef context, JSValueRef valRef, char** cptr, if(JSValueIsString(context, valRef)) { JSStringRef js_str = JSValueToStringCopy(context, valRef, NULL); size_t len = JSStringGetMaximumUTF8CStringSize(js_str); - char* cstr = (char*) malloc(len * sizeof(char)); + char* cstr = (char*) %new_array(len, char); /* JSStringGetUTF8CString returns the length including 0-terminator */ len = JSStringGetUTF8CString(js_str, cstr, len); From 96153c7c0a9200f39d0dc66ffbea2426cd2a4d95 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Fri, 25 Apr 2014 17:01:14 +0200 Subject: [PATCH 010/152] Regenerate configured Makefile if Makefile.in or config.status have changed --- CCache/Makefile.in | 4 ++++ Examples/Makefile.in | 4 ++++ Examples/test-suite/common.mk | 7 +++++++ Examples/test-suite/errors/Makefile.in | 3 +++ Makefile.in | 5 +++++ Tools/javascript/Makefile.in | 16 ++++++++++++---- 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/CCache/Makefile.in b/CCache/Makefile.in index abe78c277..3513222ca 100644 --- a/CCache/Makefile.in +++ b/CCache/Makefile.in @@ -27,6 +27,10 @@ HEADERS = ccache.h mdfour.h all: $(PACKAGE_NAME)$(EXEEXT) +# Regenerate Makefile if Makefile.in or config.status have changed. +Makefile: $(srcdir)/Makefile.in ./config.status + $(SHELL) ./config.status + # Note that HTML documentation is actually generated and used from the main SWIG documentation Makefile docs: $(PACKAGE_NAME).1 web/ccache-man.html diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 326f678c7..a0acd0fb8 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -21,6 +21,10 @@ # 'method' describes what is being built. #--------------------------------------------------------------- +# Regenerate Makefile if Makefile.in or config.status have changed. +Makefile: @srcdir@/Makefile.in ../config.status + cd .. && $(SHELL) ./config.status Examples/Makefile + TARGET = CC = @CC@ CXX = @CXX@ diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index c8789cb99..bdd1cd471 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -71,6 +71,13 @@ LIBPREFIX = lib ACTION = check INTERFACEDIR = $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/ +# Regenerate Makefile if Makefile.in or config.status have changed. +ifeq (,$(TEST_SUITE_SUBDIR)) +TEST_SUITE_SUBDIR = $(LANGUAGE) +endif +Makefile: $(srcdir)/Makefile.in ../../../config.status + cd ../../../ && $(SHELL) ./config.status $(EXAMPLES)/$(TEST_SUITE)/$(TEST_SUITE_SUBDIR)/Makefile + # # Please keep test cases in alphabetical order. # Note that any whitespace after the last entry in each list will break make diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in index e4ba7b751..843283e7c 100644 --- a/Examples/test-suite/errors/Makefile.in +++ b/Examples/test-suite/errors/Makefile.in @@ -31,6 +31,9 @@ C_ERROR_TEST_CASES := $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CAS ERROR_TEST_CASES := $(CPP_ERROR_TEST_CASES:=.cpptest) \ $(C_ERROR_TEST_CASES:=.ctest) +# For rebuilding Makefile from Makefile.in in common.mk +TEST_SUITE_SUBDIR = errors + include $(srcdir)/../common.mk diff --git a/Makefile.in b/Makefile.in index 06e4724c7..53ac47de5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -243,11 +243,13 @@ check-%-examples : # individual example %.actionexample: + @cd Examples && $(MAKE) Makefile @echo $(ACTION)ing Examples/$(LANGUAGE)/$* @(cd Examples/$(LANGUAGE)/$* && $(MAKE) $(FLAGS) $(chk-set-env) $(ACTION) RUNPIPE=$(RUNPIPE)) # gcj individual example java.actionexample: + @cd Examples && $(MAKE) Makefile @if $(skip-gcj); then \ echo "skipping Examples/$(LANGUAGE)/java $(ACTION) (gcj test)"; \ else \ @@ -283,6 +285,9 @@ check-test-suite: \ check-javascript-test-suite check-%-test-suite: + @if test -d Examples/test-suite/$*; then \ + cd Examples/test-suite/$* && $(MAKE) Makefile; \ + fi @if test -z "$(skip-$*)"; then \ echo $* unknown; \ exit 1; \ diff --git a/Tools/javascript/Makefile.in b/Tools/javascript/Makefile.in index 373c5d952..6fbca2384 100644 --- a/Tools/javascript/Makefile.in +++ b/Tools/javascript/Makefile.in @@ -11,6 +11,8 @@ # interpreter (see 'Tools/javascript'). # # ---------------------------------------------------------------- +all: javascript + CC = @CC@ # HACK: under OSX a g++ compiled interpreter is seg-faulting when loading module libraries # with 'c++' it works... probably some missing flags? @@ -29,15 +31,21 @@ JSCXXSHARED = @JSCXXSHARED@ JSV8ENABLED = @JSV8ENABLED@ JSCENABLED = @JSCENABLED@ +srcdir = @srcdir@ + +# Regenerate Makefile if Makefile.in or config.status have changed. +Makefile: $(srcdir)/Makefile.in ../../config.status + cd ../.. && $(SHELL) ./config.status Tools/javascript/Makefile + # These settings are provided by 'configure' (see '/configure.in') ifeq (1, $(JSV8ENABLED)) - JS_INTERPRETER_SRC_V8 = v8_shell.cxx - JS_INTERPRETER_ENABLE_V8 = -DENABLE_V8 +JS_INTERPRETER_SRC_V8 = v8_shell.cxx +JS_INTERPRETER_ENABLE_V8 = -DENABLE_V8 endif ifeq (1, $(JSCENABLED)) - JS_INTERPRETER_SRC_JSC = jsc_shell.cxx - JS_INTERPRETER_ENABLE_JSC = -DENABLE_JSC +JS_INTERPRETER_SRC_JSC = jsc_shell.cxx +JS_INTERPRETER_ENABLE_JSC = -DENABLE_JSC endif JS_INTERPRETER_DEFINES = $(JS_INTERPRETER_ENABLE_JSC) $(JS_INTERPRETER_ENABLE_V8) From e0b987b32faf68075890f7b6579661245247fd01 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Sat, 29 Mar 2014 16:31:32 +0100 Subject: [PATCH 011/152] CCache/Makefile.in: fix to allow out of source tree check/install --- CCache/Makefile.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CCache/Makefile.in b/CCache/Makefile.in index 3513222ca..ae77ae745 100644 --- a/CCache/Makefile.in +++ b/CCache/Makefile.in @@ -14,7 +14,7 @@ NOSOFTLINKSTEST= CC=@CC@ CFLAGS=@CFLAGS@ -I. SWIG=swig -SWIG_LIB=../../Lib +SWIG_LIB=../$(srcdir)/../Lib EXEEXT=@EXEEXT@ # Use standard autoconf approach to transform executable name using --program-prefix and --program-suffix @@ -38,7 +38,7 @@ $(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(PACKAGE_NAME).1: ccache.yo - -yodl2man -o $(PACKAGE_NAME).1 ccache.yo + -yodl2man -o $(PACKAGE_NAME).1 $(srcdir)/ccache.yo web/ccache-man.html: ccache.yo yodl2html -o web/ccache-man.html ccache.yo @@ -50,7 +50,7 @@ install: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1 ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT) @echo "Installing $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1" ${INSTALLCMD} -d $(DESTDIR)${mandir}/man1 - ${INSTALLCMD} -m 644 ${srcdir}/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1 + ${INSTALLCMD} -m 644 $(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1 uninstall: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1 rm -f $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT) @@ -62,7 +62,7 @@ clean: check : test test: test.sh - SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' ./test.sh + SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' $(srcdir)/test.sh check: test From 72e6b5349e62c44b42de448fab6c9b005811d025 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Fri, 2 May 2014 17:43:06 +0200 Subject: [PATCH 012/152] Add "make maintainer-clean" to Travis CI build --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 890382c40..26cb18910 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,6 +77,7 @@ script: - if test -n "$SWIGLANG"; then make -s check-$SWIGLANG-version; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi + - make maintainer-clean branches: only: - master From f574a34155e4ede49b1b023494e0a1637ab89f8f Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Sun, 11 May 2014 23:21:10 +0200 Subject: [PATCH 013/152] Allow examples and test-suite to be built out of source tree - Examples/Makefile.in rules use SRCDIR as the relative source directory - ./config.status replicates Examples/ source directory tree in build directory, and copies each Makefile to build directory, prefixed with a header which sets SRCDIR to source directory - Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir - Examples/test-suite/errors/Makefile.in needs to filter out source directory from SWIG error messages - Lua: embedded interpreters are passed location of run-time test - Python: copy run-time scripts to build directory because of 2to3 conversion; import_packages example copies __init__.py from source directory; test-suite sets SCRIPTDIR to location of run-time tests - Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir can be substituted with SRCDIR; removed './' from require() statements so that NODE_PATH can be used to point Node.js to build directory --- .gitignore | 3 + Examples/Makefile.in | 524 ++++++++++-------- Examples/android/class/Makefile | 6 +- Examples/android/extend/Makefile | 6 +- Examples/android/simple/Makefile | 6 +- Examples/chicken/class/Makefile | 10 +- Examples/chicken/constants/Makefile | 6 +- Examples/chicken/multimap/Makefile | 6 +- Examples/chicken/overload/Makefile | 6 +- Examples/chicken/simple/Makefile | 6 +- Examples/csharp/arrays/Makefile | 8 +- Examples/csharp/callback/Makefile | 8 +- Examples/csharp/class/Makefile | 8 +- Examples/csharp/enum/Makefile | 8 +- Examples/csharp/extend/Makefile | 8 +- Examples/csharp/funcptr/Makefile | 8 +- Examples/csharp/nested/Makefile | 8 +- Examples/csharp/reference/Makefile | 8 +- Examples/csharp/simple/Makefile | 8 +- Examples/csharp/template/Makefile | 8 +- Examples/csharp/variables/Makefile | 8 +- Examples/d/callback/Makefile | 8 +- Examples/d/class/Makefile | 8 +- Examples/d/constants/Makefile | 8 +- Examples/d/enum/Makefile | 8 +- Examples/d/extend/Makefile | 8 +- Examples/d/funcptr/Makefile | 8 +- Examples/d/simple/Makefile | 8 +- Examples/d/variables/Makefile | 8 +- Examples/go/callback/Makefile | 6 +- Examples/go/class/Makefile | 6 +- Examples/go/constants/Makefile | 6 +- Examples/go/enum/Makefile | 6 +- Examples/go/extend/Makefile | 6 +- Examples/go/funcptr/Makefile | 6 +- Examples/go/multimap/Makefile | 6 +- Examples/go/pointer/Makefile | 6 +- Examples/go/reference/Makefile | 6 +- Examples/go/simple/Makefile | 6 +- Examples/go/template/Makefile | 6 +- Examples/go/variables/Makefile | 6 +- Examples/guile/class/Makefile | 8 +- Examples/guile/constants/Makefile | 6 +- Examples/guile/matrix/Makefile | 6 +- Examples/guile/multimap/Makefile | 8 +- Examples/guile/multivalue/Makefile | 8 +- Examples/guile/port/Makefile | 6 +- Examples/guile/simple/Makefile | 6 +- Examples/guile/std_vector/Makefile | 8 +- Examples/java/callback/Makefile | 8 +- Examples/java/class/Makefile | 8 +- Examples/java/constants/Makefile | 8 +- Examples/java/enum/Makefile | 8 +- Examples/java/extend/Makefile | 8 +- Examples/java/funcptr/Makefile | 8 +- Examples/java/multimap/Makefile | 8 +- Examples/java/native/Makefile | 8 +- Examples/java/nested/Makefile | 8 +- Examples/java/pointer/Makefile | 8 +- Examples/java/reference/Makefile | 8 +- Examples/java/simple/Makefile | 8 +- Examples/java/template/Makefile | 8 +- Examples/java/typemap/Makefile | 8 +- Examples/java/variables/Makefile | 8 +- Examples/javascript/class/Makefile | 2 +- Examples/javascript/class/binding.gyp | 8 - Examples/javascript/class/binding.gyp.in | 9 + Examples/javascript/class/example.js | 2 +- Examples/javascript/class/runme.js | 2 +- Examples/javascript/constant/Makefile | 2 +- Examples/javascript/constant/binding.gyp | 8 - Examples/javascript/constant/binding.gyp.in | 9 + Examples/javascript/constant/example.js | 2 +- Examples/javascript/constant/runme.js | 2 +- Examples/javascript/enum/Makefile | 2 +- Examples/javascript/enum/binding.gyp | 8 - Examples/javascript/enum/binding.gyp.in | 9 + Examples/javascript/enum/example.js | 2 +- Examples/javascript/enum/runme.js | 2 +- Examples/javascript/example.mk | 8 +- Examples/javascript/exception/Makefile | 2 +- .../exception/{binding.gyp => binding.gyp.in} | 3 +- Examples/javascript/exception/example.js | 2 +- Examples/javascript/exception/runme.js | 2 +- Examples/javascript/functor/Makefile | 2 +- Examples/javascript/functor/binding.gyp | 8 - Examples/javascript/functor/binding.gyp.in | 9 + Examples/javascript/functor/example.js | 2 +- Examples/javascript/functor/runme.js | 2 +- Examples/javascript/nspace/Makefile | 2 +- Examples/javascript/nspace/binding.gyp | 8 - Examples/javascript/nspace/binding.gyp.in | 9 + Examples/javascript/nspace/example.js | 2 +- Examples/javascript/nspace/runme.js | 2 +- Examples/javascript/operator/Makefile | 2 +- Examples/javascript/operator/binding.gyp | 8 - Examples/javascript/operator/binding.gyp.in | 9 + Examples/javascript/operator/example.js | 2 +- Examples/javascript/operator/runme.js | 2 +- Examples/javascript/overload/Makefile | 2 +- Examples/javascript/overload/binding.gyp | 8 - Examples/javascript/overload/binding.gyp.in | 9 + Examples/javascript/overload/example.js | 2 +- Examples/javascript/overload/runme.js | 2 +- Examples/javascript/pointer/Makefile | 2 +- Examples/javascript/pointer/binding.gyp | 8 - Examples/javascript/pointer/binding.gyp.in | 9 + Examples/javascript/pointer/example.js | 2 +- Examples/javascript/pointer/runme.js | 2 +- Examples/javascript/reference/Makefile | 2 +- Examples/javascript/reference/binding.gyp | 8 - Examples/javascript/reference/binding.gyp.in | 9 + Examples/javascript/reference/example.js | 2 +- Examples/javascript/reference/runme.js | 2 +- Examples/javascript/simple/Makefile | 2 +- Examples/javascript/simple/binding.gyp | 8 - Examples/javascript/simple/binding.gyp.in | 9 + Examples/javascript/simple/example.js | 2 +- Examples/javascript/simple/runme.js | 2 +- Examples/javascript/template/Makefile | 2 +- Examples/javascript/template/binding.gyp | 8 - Examples/javascript/template/binding.gyp.in | 9 + Examples/javascript/template/example.js | 2 +- Examples/javascript/template/runme.js | 2 +- Examples/javascript/variables/Makefile | 2 +- Examples/javascript/variables/binding.gyp | 8 - Examples/javascript/variables/binding.gyp.in | 9 + Examples/javascript/variables/example.js | 2 +- Examples/javascript/variables/runme.js | 2 +- Examples/lua/arrays/Makefile | 8 +- Examples/lua/class/Makefile | 8 +- Examples/lua/constants/Makefile | 8 +- Examples/lua/dual/Makefile | 10 +- Examples/lua/embed/Makefile | 6 +- Examples/lua/embed/embed.c | 9 +- Examples/lua/embed2/Makefile | 6 +- Examples/lua/embed2/embed2.c | 9 +- Examples/lua/embed3/Makefile | 6 +- Examples/lua/embed3/embed3.cpp | 10 +- Examples/lua/exception/Makefile | 8 +- Examples/lua/funcptr3/Makefile | 8 +- Examples/lua/functest/Makefile | 8 +- Examples/lua/functor/Makefile | 8 +- Examples/lua/import/Makefile | 12 +- Examples/lua/nspace/Makefile | 8 +- Examples/lua/owner/Makefile | 8 +- Examples/lua/pointer/Makefile | 8 +- Examples/lua/simple/Makefile | 8 +- Examples/lua/variables/Makefile | 8 +- Examples/modula3/class/Makefile | 6 +- Examples/modula3/enum/Makefile | 6 +- Examples/modula3/exception/Makefile | 8 +- Examples/modula3/reference/Makefile | 6 +- Examples/modula3/simple/Makefile | 6 +- Examples/modula3/typemap/Makefile | 6 +- Examples/mzscheme/multimap/Makefile | 6 +- Examples/mzscheme/simple/Makefile | 6 +- Examples/mzscheme/std_vector/Makefile | 4 +- Examples/ocaml/argout_ref/Makefile | 8 +- Examples/ocaml/contract/Makefile | 10 +- Examples/ocaml/scoped_enum/Makefile | 10 +- Examples/ocaml/shapes/Makefile | 10 +- Examples/ocaml/simple/Makefile | 10 +- Examples/ocaml/std_string/Makefile | 8 +- Examples/ocaml/std_vector/Makefile | 8 +- Examples/ocaml/stl/Makefile | 12 +- Examples/ocaml/string_from_ptr/Makefile | 10 +- Examples/ocaml/strings_test/Makefile | 10 +- Examples/octave/callback/Makefile | 6 +- Examples/octave/class/Makefile | 6 +- Examples/octave/constants/Makefile | 6 +- Examples/octave/contract/Makefile | 6 +- Examples/octave/enum/Makefile | 6 +- Examples/octave/extend/Makefile | 6 +- Examples/octave/funcptr/Makefile | 6 +- Examples/octave/funcptr2/Makefile | 6 +- Examples/octave/functor/Makefile | 6 +- Examples/octave/module_load/Makefile | 8 +- Examples/octave/operator/Makefile | 6 +- Examples/octave/pointer/Makefile | 6 +- Examples/octave/reference/Makefile | 6 +- Examples/octave/simple/Makefile | 6 +- Examples/octave/template/Makefile | 6 +- Examples/octave/variables/Makefile | 6 +- Examples/perl5/callback/Makefile | 8 +- Examples/perl5/class/Makefile | 8 +- Examples/perl5/constants/Makefile | 8 +- Examples/perl5/constants2/Makefile | 8 +- Examples/perl5/extend/Makefile | 8 +- Examples/perl5/funcptr/Makefile | 8 +- Examples/perl5/import/Makefile | 12 +- Examples/perl5/inline/Makefile | 4 +- Examples/perl5/java/Makefile | 10 +- Examples/perl5/multimap/Makefile | 8 +- Examples/perl5/multiple_inheritance/Makefile | 8 +- Examples/perl5/pointer/Makefile | 8 +- Examples/perl5/reference/Makefile | 8 +- Examples/perl5/simple/Makefile | 8 +- Examples/perl5/value/Makefile | 8 +- Examples/perl5/variables/Makefile | 8 +- Examples/perl5/xmlstring/Makefile | 8 +- Examples/php/callback/Makefile | 8 +- Examples/php/class/Makefile | 8 +- Examples/php/constants/Makefile | 8 +- Examples/php/cpointer/Makefile | 8 +- Examples/php/disown/Makefile | 8 +- Examples/php/enum/Makefile | 8 +- Examples/php/extend/Makefile | 8 +- Examples/php/funcptr/Makefile | 8 +- Examples/php/overloading/Makefile | 8 +- Examples/php/pointer/Makefile | 8 +- Examples/php/pragmas/Makefile | 8 +- Examples/php/proxy/Makefile | 8 +- Examples/php/reference/Makefile | 8 +- Examples/php/simple/Makefile | 8 +- Examples/php/sync/Makefile | 8 +- Examples/php/value/Makefile | 8 +- Examples/php/variables/Makefile | 8 +- Examples/pike/class/Makefile | 8 +- Examples/pike/constants/Makefile | 8 +- Examples/pike/enum/Makefile | 8 +- Examples/pike/overload/Makefile | 8 +- Examples/pike/simple/Makefile | 8 +- Examples/pike/template/Makefile | 8 +- Examples/python/callback/Makefile | 8 +- Examples/python/class/Makefile | 8 +- Examples/python/constants/Makefile | 8 +- Examples/python/contract/Makefile | 8 +- Examples/python/docstrings/Makefile | 8 +- Examples/python/enum/Makefile | 8 +- Examples/python/exception/Makefile | 8 +- Examples/python/exceptproxy/Makefile | 8 +- Examples/python/extend/Makefile | 8 +- Examples/python/funcptr/Makefile | 8 +- Examples/python/funcptr2/Makefile | 8 +- Examples/python/functor/Makefile | 8 +- Examples/python/import/Makefile | 12 +- Examples/python/import_packages/Makefile | 11 +- .../import_packages/from_init1/Makefile | 4 +- .../import_packages/from_init1/py2/Makefile | 2 +- .../from_init1/py2/pkg2/Makefile | 12 +- .../import_packages/from_init1/py3/Makefile | 2 +- .../from_init1/py3/pkg2/Makefile | 12 +- .../import_packages/from_init2/Makefile | 4 +- .../import_packages/from_init2/py2/Makefile | 2 +- .../from_init2/py2/pkg2/Makefile | 6 +- .../from_init2/py2/pkg2/pkg3/Makefile | 6 +- .../import_packages/from_init2/py3/Makefile | 2 +- .../from_init2/py3/pkg2/Makefile | 6 +- .../from_init2/py3/pkg2/pkg3/Makefile | 6 +- .../import_packages/from_init3/Makefile | 4 +- .../import_packages/from_init3/py2/Makefile | 2 +- .../from_init3/py2/pkg2/Makefile | 6 +- .../from_init3/py2/pkg2/pkg3/Makefile | 2 +- .../from_init3/py2/pkg2/pkg3/pkg4/Makefile | 6 +- .../import_packages/from_init3/py3/Makefile | 2 +- .../from_init3/py3/pkg2/Makefile | 6 +- .../from_init3/py3/pkg2/pkg3/Makefile | 2 +- .../from_init3/py3/pkg2/pkg3/pkg4/Makefile | 6 +- .../import_packages/relativeimport1/Makefile | 4 +- .../relativeimport1/py2/Makefile | 2 +- .../relativeimport1/py2/pkg2/Makefile | 6 +- .../relativeimport1/py2/pkg2/pkg3/Makefile | 6 +- .../relativeimport1/py3/Makefile | 2 +- .../relativeimport1/py3/pkg2/Makefile | 6 +- .../relativeimport1/py3/pkg2/pkg3/Makefile | 6 +- .../import_packages/relativeimport2/Makefile | 4 +- .../relativeimport2/py2/Makefile | 2 +- .../relativeimport2/py2/pkg2/Makefile | 6 +- .../relativeimport2/py2/pkg2/pkg3/Makefile | 2 +- .../py2/pkg2/pkg3/pkg4/Makefile | 6 +- .../relativeimport2/py3/Makefile | 2 +- .../relativeimport2/py3/pkg2/Makefile | 6 +- .../relativeimport2/py3/pkg2/pkg3/Makefile | 2 +- .../py3/pkg2/pkg3/pkg4/Makefile | 6 +- .../import_packages/same_modnames1/Makefile | 4 +- .../same_modnames1/pkg1/Makefile | 6 +- .../same_modnames1/pkg2/Makefile | 6 +- .../import_packages/same_modnames2/Makefile | 4 +- .../same_modnames2/pkg1/Makefile | 6 +- .../same_modnames2/pkg1/pkg2/Makefile | 6 +- Examples/python/import_template/Makefile | 12 +- Examples/python/java/Makefile | 10 +- Examples/python/libffi/Makefile | 8 +- Examples/python/multimap/Makefile | 8 +- Examples/python/operator/Makefile | 8 +- .../python/performance/constructor/Makefile | 10 +- Examples/python/performance/func/Makefile | 10 +- .../python/performance/hierarchy/Makefile | 10 +- .../performance/hierarchy_operator/Makefile | 10 +- Examples/python/performance/operator/Makefile | 10 +- Examples/python/pointer/Makefile | 8 +- Examples/python/reference/Makefile | 8 +- Examples/python/simple/Makefile | 8 +- Examples/python/smartptr/Makefile | 8 +- Examples/python/std_map/Makefile | 8 +- Examples/python/std_vector/Makefile | 8 +- Examples/python/swigrun/Makefile | 8 +- Examples/python/template/Makefile | 8 +- Examples/python/varargs/Makefile | 8 +- Examples/python/variables/Makefile | 8 +- Examples/r/class/Makefile | 6 +- Examples/r/simple/Makefile | 6 +- Examples/ruby/class/Makefile | 8 +- Examples/ruby/constants/Makefile | 8 +- Examples/ruby/enum/Makefile | 8 +- Examples/ruby/exception_class/Makefile | 8 +- Examples/ruby/free_function/Makefile | 8 +- Examples/ruby/funcptr/Makefile | 8 +- Examples/ruby/funcptr2/Makefile | 8 +- Examples/ruby/functor/Makefile | 8 +- Examples/ruby/hashargs/Makefile | 8 +- Examples/ruby/import/Makefile | 12 +- Examples/ruby/import_template/Makefile | 12 +- Examples/ruby/java/Makefile | 10 +- Examples/ruby/mark_function/Makefile | 8 +- Examples/ruby/multimap/Makefile | 8 +- Examples/ruby/operator/Makefile | 8 +- Examples/ruby/overloading/Makefile | 8 +- Examples/ruby/pointer/Makefile | 8 +- Examples/ruby/reference/Makefile | 8 +- Examples/ruby/simple/Makefile | 8 +- Examples/ruby/std_vector/Makefile | 8 +- Examples/ruby/template/Makefile | 8 +- Examples/ruby/value/Makefile | 8 +- Examples/ruby/variables/Makefile | 8 +- Examples/tcl/class/Makefile | 8 +- Examples/tcl/constants/Makefile | 8 +- Examples/tcl/contract/Makefile | 8 +- Examples/tcl/enum/Makefile | 8 +- Examples/tcl/funcptr/Makefile | 8 +- Examples/tcl/import/Makefile | 12 +- Examples/tcl/java/Makefile | 10 +- Examples/tcl/multimap/Makefile | 8 +- Examples/tcl/operator/Makefile | 8 +- Examples/tcl/pointer/Makefile | 8 +- Examples/tcl/reference/Makefile | 8 +- Examples/tcl/simple/Makefile | 8 +- Examples/tcl/std_vector/Makefile | 8 +- Examples/tcl/value/Makefile | 8 +- Examples/tcl/variables/Makefile | 8 +- Examples/test-suite/allegrocl/Makefile.in | 6 + Examples/test-suite/cffi/Makefile.in | 6 + Examples/test-suite/chicken/Makefile.in | 7 + Examples/test-suite/clisp/Makefile.in | 6 + Examples/test-suite/common.mk | 14 +- Examples/test-suite/csharp/Makefile.in | 13 +- Examples/test-suite/d/Makefile.in | 10 +- Examples/test-suite/errors/Makefile.in | 19 +- Examples/test-suite/go/Makefile.in | 20 +- Examples/test-suite/guile/Makefile.in | 12 +- Examples/test-suite/java/Makefile.in | 13 +- Examples/test-suite/javascript/Makefile.in | 27 +- .../javascript/abstract_access_runme.js | 2 +- .../javascript/abstract_inherit_runme.js | 2 +- .../javascript/abstract_typedef2_runme.js | 2 +- .../javascript/abstract_typedef_runme.js | 2 +- .../javascript/abstract_virtual_runme.js | 2 +- .../javascript/array_member_runme.js | 2 +- .../javascript/arrays_global_runme.js | 2 +- .../test-suite/javascript/callback_runme.js | 2 +- .../javascript/char_binary_runme.js | 2 +- .../javascript/char_strings_runme.js | 2 +- .../javascript/class_ignore_runme.js | 2 +- .../javascript/class_scope_weird_runme.js | 2 +- .../javascript/complextest_runme.js | 2 +- .../test-suite/javascript/constover_runme.js | 2 +- .../javascript/constructor_copy_runme.js | 2 +- .../test-suite/javascript/cpp_enum_runme.js | 2 +- .../javascript/cpp_namespace_runme.js | 2 +- .../test-suite/javascript/cpp_static_runme.js | 2 +- .../javascript/director_alternating_runme.js | 2 +- .../test-suite/javascript/disown_runme.js | 2 +- .../javascript/dynamic_cast_runme.js | 2 +- Examples/test-suite/javascript/empty_runme.js | 2 +- .../javascript/enum_template_runme.js | 2 +- .../test-suite/javascript/infinity_runme.js | 2 +- .../namespace_virtual_method_runme.js | 2 +- .../javascript/node_template/binding.gyp.in | 2 +- .../javascript/nspace_extend_runme.js | 2 +- .../test-suite/javascript/nspace_runme.js | 2 +- .../javascript/overload_copy_runme.js | 2 +- .../javascript/preproc_include_runme.js | 2 +- .../test-suite/javascript/preproc_runme.js | 2 +- .../test-suite/javascript/rename1_runme.js | 2 +- .../test-suite/javascript/rename2_runme.js | 2 +- .../test-suite/javascript/rename3_runme.js | 2 +- .../test-suite/javascript/rename4_runme.js | 2 +- .../javascript/rename_scope_runme.js | 2 +- .../javascript/rename_simple_runme.js | 2 +- .../javascript/ret_by_value_runme.js | 2 +- Examples/test-suite/javascript/setup_test.sh | 6 - .../javascript/string_simple_runme.js | 2 +- .../javascript/struct_value_runme.js | 2 +- .../javascript/template_static_runme.js | 2 +- .../javascript/typedef_class_runme.js | 2 +- .../javascript/typedef_inherit_runme.js | 2 +- .../javascript/typedef_scope_runme.js | 2 +- .../javascript/typemap_arrays_runme.js | 2 +- .../javascript/typemap_delete_runme.js | 2 +- .../javascript/typemap_namespace_runme.js | 2 +- .../javascript/typemap_ns_using_runme.js | 2 +- .../test-suite/javascript/using1_runme.js | 2 +- .../test-suite/javascript/using2_runme.js | 2 +- .../test-suite/javascript/varargs_runme.js | 2 +- Examples/test-suite/lua/Makefile.in | 11 +- Examples/test-suite/mzscheme/Makefile.in | 6 + Examples/test-suite/ocaml/Makefile.in | 6 + Examples/test-suite/octave/Makefile.in | 13 +- Examples/test-suite/perl5/Makefile.in | 13 +- Examples/test-suite/php/Makefile.in | 15 +- Examples/test-suite/pike/Makefile.in | 6 + Examples/test-suite/python/Makefile.in | 43 +- Examples/test-suite/r/Makefile.in | 6 + Examples/test-suite/ruby/Makefile.in | 11 +- Examples/test-suite/tcl/Makefile.in | 11 +- Examples/test-suite/uffi/Makefile.in | 6 + Makefile.in | 4 +- Tools/javascript/Makefile.in | 2 +- configure.ac | 35 ++ 420 files changed, 1772 insertions(+), 1510 deletions(-) delete mode 100644 Examples/javascript/class/binding.gyp create mode 100644 Examples/javascript/class/binding.gyp.in delete mode 100644 Examples/javascript/constant/binding.gyp create mode 100644 Examples/javascript/constant/binding.gyp.in delete mode 100644 Examples/javascript/enum/binding.gyp create mode 100644 Examples/javascript/enum/binding.gyp.in rename Examples/javascript/exception/{binding.gyp => binding.gyp.in} (89%) delete mode 100644 Examples/javascript/functor/binding.gyp create mode 100644 Examples/javascript/functor/binding.gyp.in delete mode 100644 Examples/javascript/nspace/binding.gyp create mode 100644 Examples/javascript/nspace/binding.gyp.in delete mode 100644 Examples/javascript/operator/binding.gyp create mode 100644 Examples/javascript/operator/binding.gyp.in delete mode 100644 Examples/javascript/overload/binding.gyp create mode 100644 Examples/javascript/overload/binding.gyp.in delete mode 100644 Examples/javascript/pointer/binding.gyp create mode 100644 Examples/javascript/pointer/binding.gyp.in delete mode 100644 Examples/javascript/reference/binding.gyp create mode 100644 Examples/javascript/reference/binding.gyp.in delete mode 100644 Examples/javascript/simple/binding.gyp create mode 100644 Examples/javascript/simple/binding.gyp.in delete mode 100644 Examples/javascript/template/binding.gyp create mode 100644 Examples/javascript/template/binding.gyp.in delete mode 100644 Examples/javascript/variables/binding.gyp create mode 100644 Examples/javascript/variables/binding.gyp.in delete mode 100644 Examples/test-suite/javascript/setup_test.sh diff --git a/.gitignore b/.gitignore index d4d70b010..ce6a3c4b7 100644 --- a/.gitignore +++ b/.gitignore @@ -136,3 +136,6 @@ Examples/test-suite/uffi/*/ # Scratch directories Examples/scratch + +# Out of source tree build directories +_build*/ diff --git a/Examples/Makefile.in b/Examples/Makefile.in index a0acd0fb8..dcfbd83b9 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -25,11 +25,28 @@ Makefile: @srcdir@/Makefile.in ../config.status cd .. && $(SHELL) ./config.status Examples/Makefile +# SRCDIR is the relative path to the current source directory +# - For in-source-tree builds, SRCDIR with be either '', +# or '../' for some of the test suites (e.g. C#, Java) +# - For out-of-source-tree builds, SRCDIR will be a relative +# path ending with a '/' + +# SRCDIR_SRCS, etc. are $(SRCS), etc. with $(SRCDIR) prepended +SRCDIR_SRCS = $(addprefix $(SRCDIR),$(SRCS)) +SRCDIR_CSRCS = $(addprefix $(SRCDIR),$(CSRCS)) +SRCDIR_CXXSRCS = $(addprefix $(SRCDIR),$(CXXSRCS)) + +ifeq (,$(SRCDIR)) +SRCDIR_INCLUDE = -I. +else +SRCDIR_INCLUDE = -I. -I$(SRCDIR) +endif + TARGET = CC = @CC@ CXX = @CXX@ -CFLAGS = @PLATCFLAGS@ -CXXFLAGS = @BOOST_CPPFLAGS@ @PLATCXXFLAGS@ +CFLAGS = $(SRCDIR_INCLUDE) @PLATCFLAGS@ +CXXFLAGS = $(SRCDIR_INCLUDE) @BOOST_CPPFLAGS@ @PLATCXXFLAGS@ prefix = @prefix@ exec_prefix= @exec_prefix@ SRCS = @@ -37,7 +54,7 @@ INCLUDES = LIBS = INTERFACE = INTERFACEDIR = -INTERFACEPATH = $(INTERFACEDIR)$(INTERFACE) +INTERFACEPATH = $(SRCDIR)$(INTERFACEDIR)$(INTERFACE) SWIGOPT = SWIG = swig @@ -130,38 +147,38 @@ TCL_DLNK = @TCLDYNAMICLINKING@ TCL_SO = @TCL_SO@ TCLLDSHARED = @TCLLDSHARED@ TCLCXXSHARED = @TCLCXXSHARED@ -TCL_SCRIPT = $(RUNME).tcl +TCL_SCRIPT = $(SRCDIR)$(RUNME).tcl # ----------------------------------------------------------- # Build a new version of the tclsh shell # ----------------------------------------------------------- -tclsh: $(SRCS) - $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACEPATH) - $(CC) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \ +tclsh: $(SRCDIR_SRCS) + $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \ $(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET) -tclsh_cpp: $(SRCS) - $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \ +tclsh_cpp: $(SRCDIR_SRCS) + $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \ $(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET) # ----------------------------------------------------------- # Build a Tcl dynamic loadable module (you might need to tweak this) # ----------------------------------------------------------- -tcl: $(SRCS) - $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) +tcl: $(SRCDIR_SRCS) + $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) $(TCLLDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO) # ----------------------------------------------------------- # Build a Tcl7.5 dynamic loadable module for C++ # ----------------------------------------------------------- -tcl_cpp: $(SRCS) - $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) +tcl_cpp: $(SRCDIR_SRCS) + $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) $(TCLCXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO) # ----------------------------------------------------------------- @@ -205,44 +222,44 @@ PERL5_CCCDLFLAGS = @PERL5CCCDLFLAGS@ PERL5_LDFLAGS = @PERL5LDFLAGS@ PERL = @PERL@ PERL5_LIB = -L$(PERL5_INCLUDE) -l@PERL5LIB@ @LIBS@ $(SYSLIBS) -PERL5_SCRIPT = $(RUNME).pl +PERL5_SCRIPT = $(SRCDIR)$(RUNME).pl # ---------------------------------------------------------------- # Build a Perl5 dynamically loadable module (C) # ---------------------------------------------------------------- -perl5: $(SRCS) - $(SWIG) -perl5 $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c -Dbool=char $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) +perl5: $(SRCDIR_SRCS) + $(SWIG) -perl5 $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c -Dbool=char $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) $(LDSHARED) $(CFLAGS) $(PERL5_CCDLFLAGS) $(OBJS) $(IOBJS) $(PERL5_LDFLAGS) $(PERL5_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- # Build a Perl5 dynamically loadable module (C++) # ---------------------------------------------------------------- -perl5_cpp: $(SRCS) - $(SWIG) -perl5 -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) +perl5_cpp: $(SRCDIR_SRCS) + $(SWIG) -perl5 -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) $(CXXSHARED) $(CXXFLAGS) $(PERL5_CCDLFLAGS) $(OBJS) $(IOBJS) $(PERL5_LDFLAGS) $(PERL5_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- # Build a module from existing XS C source code. (ie. from xsubpp). # ---------------------------------------------------------------- -perl5_xs: $(SRCS) - $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(INCLUDES) -I$(PERL5_INCLUDE) +perl5_xs: $(SRCDIR_SRCS) + $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(LDSHARED) $(CFLAGS) $(OBJS) $(LIBS) -o $(TARGET)$(SO) # ---------------------------------------------------------------- # Build a statically linked Perl5 executable # ---------------------------------------------------------------- -perl5_static: $(SRCS) - $(SWIG) -perl5 -static -lperlmain.i $(SWIGOPT) $(INTERFACEPATH) - $(CC) $(CFLAGS) -Dbool=char $(SRCS) $(ISRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) +perl5_static: $(SRCDIR_SRCS) + $(SWIG) -perl5 -static -lperlmain.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) -Dbool=char $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) -perl5_static_cpp: $(SRCS) - $(SWIG) -perl5 -c++ -static -lperlmain.i $(SWIGOPT) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) +perl5_static_cpp: $(SRCDIR_SRCS) + $(SWIG) -perl5 -c++ -static -lperlmain.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) # ----------------------------------------------------------------- # Running a Perl5 example @@ -271,15 +288,17 @@ perl5_clean: ##### PYTHON ###### ################################################################## +PYTHON_FLAGS = + # Make sure these locate your Python installation ifeq (,$(PY3)) PYTHON_INCLUDE= $(DEFS) @PYINCLUDE@ PYTHON_LIB = @PYLIB@ - PYTHON = @PYTHON@ + PYTHON = @PYTHON@ $(PYTHON_FLAGS) else PYTHON_INCLUDE= $(DEFS) @PY3INCLUDE@ PYTHON_LIB = @PY3LIB@ - PYTHON = @PYTHON3@ + PYTHON = @PYTHON3@ $(PYTHON_FLAGS) endif # Extra Python specific linking options @@ -303,18 +322,18 @@ endif # Build a C dynamically loadable module # ---------------------------------------------------------------- -python: $(SRCS) - $(SWIGPYTHON) $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(PYTHON_INCLUDE) +python: $(SRCDIR_SRCS) + $(SWIGPYTHON) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(PYTHON_INCLUDE) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module # ----------------------------------------------------------------- -python_cpp: $(SRCS) - $(SWIGPYTHON) -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(PYTHON_INCLUDE) +python_cpp: $(SRCDIR_SRCS) + $(SWIGPYTHON) -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(PYTHON_INCLUDE) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO) # ----------------------------------------------------------------- @@ -328,14 +347,14 @@ python_cpp: $(SRCS) TKINTER = PYTHON_LIBOPTS = $(PYTHON_LINK) @LIBS@ $(TKINTER) $(SYSLIBS) -python_static: $(SRCS) - $(SWIGPYTHON) -lembed.i $(SWIGOPT) $(INTERFACEPATH) - $(CC) $(CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \ +python_static: $(SRCDIR_SRCS) + $(SWIGPYTHON) -lembed.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET) -python_static_cpp: $(SRCS) - $(SWIGPYTHON) -c++ -lembed.i $(SWIGOPT) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \ +python_static_cpp: $(SRCDIR_SRCS) + $(SWIGPYTHON) -c++ -lembed.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET) # ----------------------------------------------------------------- @@ -351,9 +370,15 @@ endif PY2TO3 = 2to3 `2to3 -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'` python_run: $(PYSCRIPT) + export PYTHONPATH=".:$$PYTHONPATH"; \ $(RUNTOOL) $(PYTHON) $(PYSCRIPT) $(RUNPIPE) -$(RUNME)3.py: $(RUNME).py +ifneq (,$(SRCDIR)) +$(RUNME).py: $(SRCDIR)$(RUNME).py + cp $< $@ +endif + +$(RUNME)3.py: $(SRCDIR)$(RUNME).py cp $< $@ $(PY2TO3) -w $@ >/dev/null 2>&1 @@ -389,26 +414,26 @@ OCTAVE_CXX = $(DEFS) @OCTAVE_CPPFLAGS@ @OCTAVE_CXXFLAGS@ OCTAVE_DLNK = @OCTAVE_LDFLAGS@ OCTAVE_SO = @OCTAVE_SO@ -OCTAVE_SCRIPT = $(RUNME).m +OCTAVE_SCRIPT = $(SRCDIR)$(RUNME).m # ---------------------------------------------------------------- # Build a C dynamically loadable module # Note: Octave requires C++ compiler when compiling C wrappers # ---------------------------------------------------------------- -octave: $(SRCS) - $(SWIG) -octave $(SWIGOPT) $(INTERFACEPATH) +octave: $(SRCDIR_SRCS) + $(SWIG) -octave $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(INCLUDES) $(OCTAVE_CXX) - $(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CSRCS) $(INCLUDES) + $(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CSRCS) $(INCLUDES) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module # ----------------------------------------------------------------- -octave_cpp: $(SRCS) - $(SWIG) -c++ -octave $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(OCTAVE_CXX) +octave_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -octave $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(OCTAVE_CXX) $(CXXSHARED) -g $(CXXFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO) # ----------------------------------------------------------------- @@ -446,20 +471,20 @@ GUILE_SO = @GUILE_SO@ GUILE_LIBS = @GUILE_LIBS@ GUILE_LIBOPTS = @LIBS@ $(SYSLIBS) GUILE_LIBPREFIX = lib -GUILE_SCRIPT = $(RUNME).scm +GUILE_SCRIPT = $(SRCDIR)$(RUNME).scm #------------------------------------------------------------------ # Build a dynamically loaded module with passive linkage #------------------------------------------------------------------ -guile: $(SRCS) - $(SWIG) -guile -Linkage passive $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ISRCS) $(SRCS) +guile: $(SRCDIR_SRCS) + $(SWIG) -guile -Linkage passive $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO) guile_cpp: $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO) -$(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO): $(SRCS) - $(SWIG) -c++ -guile -Linkage passive $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) +$(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO): $(SRCDIR_SRCS) + $(SWIG) -c++ -guile -Linkage passive $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) $(CPP_DLLIBS) -o $@ guile_externalhdr: @@ -469,34 +494,34 @@ guile_externalhdr: # Build Guile interpreter augmented with extra functions # ----------------------------------------------------------------- -guile_augmented: - $(SWIG) -guile $(SWIGOPT) $(INTERFACE) - $(CC) $(CXXFLAGS) $(SRCS) $(ISRCS) $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) -o $(TARGET) +guile_augmented: $(SRCDIR_SRCS) + $(SWIG) -guile $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CXXFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) -o $(TARGET) # ----------------------------------------------------------------- # Build statically linked Guile interpreter # ----------------------------------------------------------------- -guile_static: $(SRCS) - $(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \ +guile_static: $(SRCDIR_SRCS) + $(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile -guile_static_cpp: $(SRCS) - $(SWIG) -c++ -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \ +guile_static_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile -guile_simple: $(SRCS) - $(SWIG) -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) \ +guile_simple: $(SRCDIR_SRCS) + $(SWIG) -guile -lguilemain.i -Linkage simple $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile -guile_simple_cpp: $(SRCS) - $(SWIG) -c++ -guile -lguilemain.i -Linkage simple $(SWIGOPT) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \ +guile_simple_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -guile -lguilemain.i -Linkage simple $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile # ----------------------------------------------------------------- @@ -542,39 +567,39 @@ JAVALDSHARED = @JAVALDSHARED@ JAVACXXSHARED = @JAVACXXSHARED@ JAVACFLAGS = @JAVACFLAGS@ JAVA = @JAVA@ -JAVAC = @JAVAC@ +JAVAC = @JAVAC@ -d . # ---------------------------------------------------------------- # Build a java dynamically loadable module (C) # ---------------------------------------------------------------- -java: $(SRCS) - $(SWIG) -java $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(JAVACFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE) +java: $(SRCDIR_SRCS) + $(SWIG) -java $(SWIGOPT) -o $(ISRCS) $(realpath $(INTERFACEPATH)) + $(CC) -c $(CCSHARED) $(CFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE) $(JAVALDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) # ---------------------------------------------------------------- # Build a java dynamically loadable module (C++) # ---------------------------------------------------------------- -java_cpp: $(SRCS) - $(SWIG) -java -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(JAVACFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE) +java_cpp: $(SRCDIR_SRCS) + $(SWIG) -java -c++ $(SWIGOPT) -o $(ICXXSRCS) $(realpath $(INTERFACEPATH)) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE) $(JAVACXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) # ---------------------------------------------------------------- # Compile java files # ---------------------------------------------------------------- -java_compile: $(SRCS) - $(COMPILETOOL) $(JAVAC) $(JAVACFLAGS) $(JAVASRCS) +java_compile: $(SRCDIR_SRCS) + $(COMPILETOOL) $(JAVAC) $(JAVACFLAGS) $(addprefix $(SRCDIR),$(JAVASRCS)) # ----------------------------------------------------------------- # Run java example # ----------------------------------------------------------------- java_run: - env LD_LIBRARY_PATH=. $(RUNTOOL) $(JAVA) $(RUNME) $(RUNPIPE) + env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(JAVA) $(RUNME) $(RUNPIPE) # ----------------------------------------------------------------- # Version display @@ -617,37 +642,38 @@ NODEGYP = @NODEGYP@ javascript_wrapper: $(SWIG) -javascript $(SWIGOPT) -o $(INTERFACEDIR)$(TARGET)_wrap.c $(INTERFACEPATH) -javascript_wrapper_cpp: $(SRCS) +javascript_wrapper_cpp: $(SRCDIR_SRCS) $(SWIG) -javascript -c++ $(SWIGOPT) -o $(INTERFACEDIR)$(TARGET)_wrap.cxx $(INTERFACEPATH) -javascript_build: $(SRCS) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES) +javascript_build: $(SRCDIR_SRCS) + $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(JSINCLUDES) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) -javascript_build_cpp: $(SRCS) +javascript_build_cpp: $(SRCDIR_SRCS) ifeq (node,$(JSENGINE)) + sed -e 's|$$srcdir|./$(SRCDIR)|g' $(SRCDIR)binding.gyp.in > binding.gyp $(NODEGYP) --loglevel=silent configure build 1>>/dev/null else - $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) $(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) endif # These targets are used by the test-suite: -javascript: $(SRCS) javascript_custom_interpreter +javascript: $(SRCDIR_SRCS) javascript_custom_interpreter $(SWIG) -javascript $(SWIGOPT) $(INTERFACEPATH) ifeq (jsc, $(ENGINE)) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES) + $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(JSINCLUDES) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) else # (v8 | node) # v8 and node must be compiled as c++ - $(CXX) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXX) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) $(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) endif -javascript_cpp: $(SRCS) javascript_custom_interpreter +javascript_cpp: $(SRCDIR_SRCS) javascript_custom_interpreter $(SWIG) -javascript -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) $(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- @@ -659,10 +685,10 @@ javascript_custom_interpreter: ifeq (node,$(JSENGINE)) javascript_run: - $(RUNTOOL) $(NODEJS) $(RUNME).js $(RUNPIPE) + env NODE_PATH=$$PWD:$(SRCDIR) $(RUNTOOL) $(NODEJS) $(SRCDIR)$(RUNME).js $(RUNPIPE) else javascript_run: javascript_custom_interpreter - $(RUNTOOL) $(ROOT_DIR)/Tools/javascript/javascript -$(JSENGINE) -L $(TARGET) $(RUNME).js $(RUNPIPE) + $(RUNTOOL) $(ROOT_DIR)/Tools/javascript/javascript -$(JSENGINE) -L $(TARGET) $(SRCDIR)$(RUNME).js $(RUNPIPE) endif # ----------------------------------------------------------------- @@ -718,7 +744,7 @@ TARGETID = 1 # Build an Android dynamically loadable module (C) # ---------------------------------------------------------------- -android: $(SRCS) +android: $(SRCDIR_SRCS) $(ANDROID) $(SILENT_OPTION) update project --target $(TARGETID) --name $(PROJECTNAME) --path . $(SWIG) -java $(SWIGOPT) -o $(INTERFACEDIR)$(TARGET)_wrap.c $(INTERFACEPATH) +$(ANDROID_NDK_BUILD) $(SILENT_PIPE) @@ -728,7 +754,7 @@ android: $(SRCS) # Build an Android dynamically loadable module (C++) # ---------------------------------------------------------------- -android_cpp: $(SRCS) +android_cpp: $(SRCDIR_SRCS) $(ANDROID) $(SILENT_OPTION) update project --target $(TARGETID) --name $(PROJECTNAME) --path . $(SWIG) -java -c++ $(SWIGOPT) -o $(INTERFACEDIR)$(TARGET)_wrap.cpp $(INTERFACEPATH) +$(ANDROID_NDK_BUILD) $(SILENT_PIPE) @@ -769,13 +795,13 @@ MODULA3_INCLUDE= @MODULA3INC@ # Build a modula3 dynamically loadable module (C) # ---------------------------------------------------------------- -modula3: $(SRCS) - $(SWIG) -modula3 $(SWIGOPT) $(INTERFACEPATH) -# $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) \ +modula3: $(SRCDIR_SRCS) + $(SWIG) -modula3 $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) +# $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) \ # $(OBJS) $(IOBJS) $(LIBS) -modula3_cpp: $(SRCS) - $(SWIG) -modula3 -c++ $(SWIGOPT) $(INTERFACEPATH) +modula3_cpp: $(SRCDIR_SRCS) + $(SWIG) -modula3 -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) # ----------------------------------------------------------------- # Run modula3 example @@ -814,14 +840,14 @@ MZSCHEME_SCRIPT = $(RUNME).scm # Build a C/C++ dynamically loadable module # ---------------------------------------------------------------- -mzscheme: $(SRCS) - $(SWIG) -mzscheme $(SWIGOPT) $(INTERFACEPATH) - $(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ISRCS) $(SRCS) +mzscheme: $(SRCDIR_SRCS) + $(SWIG) -mzscheme $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ISRCS) $(SRCDIR_SRCS) $(COMPILETOOL) $(MZC) --ld $(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) -mzscheme_cpp: $(SRCS) - $(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACEPATH) - $(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS) +mzscheme_cpp: $(SRCDIR_SRCS) + $(SWIG) -mzscheme -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(CXXSHARED) $(CXXFLAGS) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS) # ----------------------------------------------------------------- @@ -829,7 +855,7 @@ mzscheme_cpp: $(SRCS) # ----------------------------------------------------------------- mzscheme_run: - env LD_LIBRARY_PATH=. $(RUNTOOL) $(MZSCHEME) -r $(MZSCHEME_SCRIPT) $(RUNPIPE) + env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(MZSCHEME) -r $(MZSCHEME_SCRIPT) $(RUNPIPE) # ----------------------------------------------------------------- # Version display @@ -869,10 +895,10 @@ OCAMLCORE=\ $(OCC) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" \ -c swigp4.ml -ocaml_static: $(SRCS) +ocaml_static: $(SRCDIR_SRCS) $(OCAMLCORE) - $(SWIG) -ocaml $(SWIGOPT) $(INTERFACEPATH) - $(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS) + $(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS) $(OCC) -g -c $(INTERFACE:%.i=%.mli) $(OCC) -g -c $(INTERFACE:%.i=%.ml) test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \ @@ -883,10 +909,10 @@ ocaml_static: $(SRCS) $(PROGFILE:%.ml=%.cmo) \ $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)" -ocaml_dynamic: $(SRCS) +ocaml_dynamic: $(SRCDIR_SRCS) $(OCAMLCORE) - $(SWIG) -ocaml $(SWIGOPT) $(INTERFACEPATH) - $(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS) + $(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS) $(CXXSHARED) $(CXXFLAGS) $(CCSHARED) $(CFLAGS) -o $(INTERFACE:%.i=%@SO@) \ $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) $(LIBS) $(OCAMLDLGEN) $(INTERFACE:%.i=%.ml) $(INTERFACE:%.i=%@SO@) > \ @@ -902,10 +928,10 @@ ocaml_dynamic: $(SRCS) -package dl -linkpkg \ $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -ocaml_static_toplevel: $(SRCS) +ocaml_static_toplevel: $(SRCDIR_SRCS) $(OCAMLCORE) - $(SWIG) -ocaml $(SWIGOPT) $(INTERFACEPATH) - $(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCS) + $(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS) $(OCC) -g -c $(INTERFACE:%.i=%.mli) $(OCC) -g -c $(INTERFACE:%.i=%.ml) test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \ @@ -917,12 +943,12 @@ ocaml_static_toplevel: $(SRCS) $(INTERFACE:%.i=%.cmo) \ $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)" -ocaml_static_cpp: $(SRCS) +ocaml_static_cpp: $(SRCDIR_SRCS) $(OCAMLCORE) - $(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH) + $(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c) $(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \ - $(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS) + $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(OCC) -g -c $(INTERFACE:%.i=%.mli) $(OCC) -g -c $(INTERFACE:%.i=%.ml) test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \ @@ -934,12 +960,12 @@ ocaml_static_cpp: $(SRCS) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \ -cclib "$(LIBS)" -cc '$(CXX) -Wno-write-strings' -ocaml_static_cpp_toplevel: $(SRCS) +ocaml_static_cpp_toplevel: $(SRCDIR_SRCS) $(OCAMLCORE) - $(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH) + $(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c) $(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \ - $(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS) + $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(OCC) -g -c $(INTERFACE:%.i=%.mli) $(OCC) -g -c $(INTERFACE:%.i=%.ml) test -z "$(PROGFILE)" || test -f "$(PROGFILE)" && \ @@ -952,12 +978,12 @@ ocaml_static_cpp_toplevel: $(SRCS) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \ -cclib "$(LIBS)" -cc '$(CXX) -Wno-write-strings' -ocaml_dynamic_cpp: $(SRCS) +ocaml_dynamic_cpp: $(SRCDIR_SRCS) $(OCAMLCORE) - $(SWIG) -ocaml -c++ $(SWIGOPT) $(INTERFACEPATH) + $(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c) $(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \ - $(ICXXSRCS:%.cxx=%.c) $(SRCS) $(CXXSRCS) -ccopt -fPIC + $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) -ccopt -fPIC $(CXXSHARED) $(CXXFLAGS) -o $(INTERFACE:%.i=%@SO@) \ $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \ $(CPP_DLLIBS) $(LIBS) @@ -1010,25 +1036,25 @@ RUBY_DLNK = @RUBYDYNAMICLINKING@ RUBY_LIBOPTS = @RUBYLINK@ @LIBS@ $(SYSLIBS) RUBY_SO = @RUBYSO@ RUBY = @RUBY@ -RUBY_SCRIPT = $(RUNME).rb +RUBY_SCRIPT = $(SRCDIR)$(RUNME).rb # ---------------------------------------------------------------- # Build a C dynamically loadable module # ---------------------------------------------------------------- -ruby: $(SRCS) - $(SWIG) -ruby $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(RUBY_INCLUDE) +ruby: $(SRCDIR_SRCS) + $(SWIG) -ruby $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(RUBY_INCLUDE) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(RUBY_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module # ----------------------------------------------------------------- -ruby_cpp: $(SRCS) - $(SWIG) -c++ -ruby $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(RUBY_INCLUDE) +ruby_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -ruby $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(RUBY_INCLUDE) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(RUBY_SO) # ----------------------------------------------------------------- @@ -1038,14 +1064,14 @@ ruby_cpp: $(SRCS) # library file # ----------------------------------------------------------------- -ruby_static: $(SRCS) - $(SWIG) -ruby -lembed.i $(SWIGOPT) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(RUBY_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \ +ruby_static: $(SRCDIR_SRCS) + $(SWIG) -ruby -lembed.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) $(RUBY_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET) -ruby_cpp_static: $(SRCS) - $(SWIG) -c++ -ruby -lembed.i $(SWIGOPT) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \ +ruby_cpp_static: $(SRCDIR_SRCS) + $(SWIG) -c++ -ruby -lembed.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET) # ----------------------------------------------------------------- @@ -1078,24 +1104,24 @@ ruby_clean: PHP = @PHP@ PHP_INCLUDE = @PHPINC@ PHP_SO = @PHP_SO@ -PHP_SCRIPT = $(RUNME).php +PHP_SCRIPT = $(SRCDIR)$(RUNME).php # ------------------------------------------------------------------- # Build a PHP dynamically loadable module (C) # ------------------------------------------------------------------- -php: $(SRCS) - $(SWIG) -php $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(PHP_INCLUDE) +php: $(SRCDIR_SRCS) + $(SWIG) -php $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(PHP_INCLUDE) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO) # -------------------------------------------------------------------- # Build a PHP dynamically loadable module (C++) # -------------------------------------------------------------------- -php_cpp: $(SRCS) - $(SWIG) -php -cppext cxx -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PHP_INCLUDE) +php_cpp: $(SRCDIR_SRCS) + $(SWIG) -php -cppext cxx -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PHP_INCLUDE) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO) # ----------------------------------------------------------------- @@ -1138,18 +1164,18 @@ PIKE_SCRIPT = $(RUNME).pike # Build a C dynamically loadable module # ---------------------------------------------------------------- -pike: $(SRCS) - $(SWIG) -pike $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(PIKE_CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(PIKE_INCLUDE) +pike: $(SRCDIR_SRCS) + $(SWIG) -pike $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(PIKE_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(PIKE_INCLUDE) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module # ----------------------------------------------------------------- -pike_cpp: $(SRCS) - $(SWIG) -c++ -pike $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(PIKE_INCLUDE) +pike_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -pike $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(PIKE_INCLUDE) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- @@ -1159,14 +1185,14 @@ pike_cpp: $(SRCS) # library file # ----------------------------------------------------------------- -pike_static: $(SRCS) - $(SWIG) -pike -lembed.i $(SWIGOPT) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(PIKE_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCS) $(INCLUDES) \ +pike_static: $(SRCDIR_SRCS) + $(SWIG) -pike -lembed.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) $(PIKE_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(PIKE_INCLUDE) $(LIBS) -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET) -pike_cpp_static: $(SRCS) - $(SWIG) -c++ -pike -lembed.i $(SWIGOPT) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) \ +pike_cpp_static: $(SRCDIR_SRCS) + $(SWIG) -c++ -pike -lembed.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(PIKE_INCLUDE) $(LIBS) -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET) # ----------------------------------------------------------------- @@ -1222,23 +1248,23 @@ CHICKEN_COMPILED_MAIN_OBJECT = $(CHICKEN_COMPILED_MAIN:.c=.@OBJEXT@) # ----------------------------------------------------------------- # This is the old way to build chicken, but it does not work correctly with exceptions -chicken_direct: $(SRCS) +chicken_direct: $(SRCDIR_SRCS) $(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH) $(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \ -dynamic -feature chicken-compile-shared \ -output-file $(CHICKEN_COMPILED_SCHEME) $(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \ - $(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCS) $(CHICKEN_COMPILED_SCHEME) + $(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCDIR_SRCS) $(CHICKEN_COMPILED_SCHEME) $(LDSHARED) $(CFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \ $(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO) -chicken_direct_cpp: $(CXXSRCS) $(CHICKSRCS) +chicken_direct_cpp: $(SRCDIR_CXXSRCS) $(CHICKSRCS) $(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH) $(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \ -dynamic -feature chicken-compile-shared \ -output-file $(CHICKEN_COMPILED_SCHEME) $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(CHICKEN_CFLAGS) \ - $(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(CHICKEN_COMPILED_SCHEME) + $(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(CHICKEN_COMPILED_SCHEME) $(CXXSHARED) $(CXXFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \ $(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO) @@ -1247,26 +1273,26 @@ chicken_direct_cpp: $(CXXSRCS) $(CHICKSRCS) # ----------------------------------------------------------------- # The following two targets are also used by the test suite -chicken_static: $(SRCS) $(CHICKSRCS) +chicken_static: $(SRCDIR_SRCS) $(CHICKSRCS) $(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH) $(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \ -output-file $(CHICKEN_COMPILED_SCHEME) $(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \ -output-file $(CHICKEN_MAIN:.scm=_chicken.c) $(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \ - $(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCS) \ + $(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCDIR_SRCS) \ $(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN) $(CC) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \ $(OBJS) $(IOBJS) $(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET) -chicken_static_cpp: $(CXXSRCS) $(CHICKSRCS) +chicken_static_cpp: $(SRCDIR_CXXSRCS) $(CHICKSRCS) $(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH) $(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \ -output-file $(CHICKEN_COMPILED_SCHEME) $(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \ -output-file $(CHICKEN_MAIN:.scm=_chicken.c) $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(CHICKEN_CFLAGS) \ - $(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCS) $(CXXSRCS) \ + $(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) \ $(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN) $(CXX) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \ $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET) @@ -1277,11 +1303,11 @@ chicken_static_cpp: $(CXXSRCS) $(CHICKSRCS) chicken: $(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH) - $(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ISRCS) -o $(TARGET)$(SO) + $(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCDIR_SRCS) $(ISRCS) -o $(TARGET)$(SO) chicken_cpp: $(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACEPATH) - $(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ICXXSRCS) $(CXXSRCS) -o $(TARGET)$(SO) + $(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCDIR_SRCS) $(ICXXSRCS) $(SRCDIR_CXXSRCS) -o $(TARGET)$(SO) chicken_externalhdr: $(SWIG) -chicken -external-runtime $(TARGET) @@ -1291,7 +1317,7 @@ chicken_externalhdr: # ----------------------------------------------------------------- chicken_run: - env LD_LIBRARY_PATH=. $(RUNTOOL) $(CHICKEN_CSI) $(CHICKEN_SCRIPT) $(RUNPIPE) + env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(CHICKEN_CSI) $(CHICKEN_SCRIPT) $(RUNPIPE) # ----------------------------------------------------------------- # Version display @@ -1327,33 +1353,39 @@ CSHARP_RUNME = $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) ./$(RUNME). # Build a CSharp dynamically loadable module (C) # ---------------------------------------------------------------- -csharp: $(SRCS) - $(SWIG) -csharp $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(CSHARPCFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) +csharp: $(SRCDIR_SRCS) + $(SWIG) -csharp $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(CSHARPCFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO) # ---------------------------------------------------------------- # Build a CSharp dynamically loadable module (C++) # ---------------------------------------------------------------- -csharp_cpp: $(SRCS) - $(SWIG) -csharp -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(CSHARPCFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) +csharp_cpp: $(SRCDIR_SRCS) + $(SWIG) -csharp -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(CSHARPCFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO) # ---------------------------------------------------------------- # Compile CSharp files # ---------------------------------------------------------------- -csharp_compile: $(SRCS) - $(COMPILETOOL) $(CSHARPCOMPILER) $(CSHARPFLAGS) $(CSHARPSRCS) +ifneq (,$(SRCDIR)) +SRCDIR_CSHARPSRCS = $(wildcard $(addprefix $(SRCDIR),$(CSHARPSRCS))) +else +SRCDIR_CSHARPSRCS = +endif + +csharp_compile: $(SRCDIR_SRCS) + $(COMPILETOOL) $(CSHARPCOMPILER) $(CSHARPFLAGS) $(CSHARPSRCS) $(SRCDIR_CSHARPSRCS) # ----------------------------------------------------------------- # Run CSharp example # ----------------------------------------------------------------- csharp_run: - env LD_LIBRARY_PATH=. $(RUNTOOL) $(CSHARP_RUNME) $(RUNPIPE) + env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(CSHARP_RUNME) $(RUNPIPE) # ----------------------------------------------------------------- # Version display @@ -1385,7 +1417,7 @@ LUA_DLNK = @LUADYNAMICLINKING@ LUA_SO = @LUA_SO@ LUA = @LUABIN@ -LUA_SCRIPT = $(RUNME).lua +LUA_SCRIPT = $(SRCDIR)$(RUNME).lua # Extra code for lua static link LUA_INTERP = ../lua.c @@ -1394,32 +1426,32 @@ LUA_INTERP = ../lua.c # Build a C dynamically loadable module # ---------------------------------------------------------------- -lua: $(SRCS) - $(SWIG) -lua $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(LUA_INCLUDE) +lua: $(SRCDIR_SRCS) + $(SWIG) -lua $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(LUA_INCLUDE) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) -o $(LIBPREFIX)$(TARGET)$(LUA_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module # ----------------------------------------------------------------- -lua_cpp: $(SRCS) - $(SWIG) -c++ -lua $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(LUA_INCLUDE) +lua_cpp: $(SRCDIR_SRCS) $(GENCXXSRCS) + $(SWIG) -c++ -lua $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(GENCXXSRCS) $(INCLUDES) $(LUA_INCLUDE) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(LUA_SO) # ----------------------------------------------------------------- # Build statically linked Lua interpreter # ----------------------------------------------------------------- -lua_static: $(SRCS) - $(SWIG) -lua -module example $(SWIGOPT) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(ISRCS) $(SRCS) $(LUA_INTERP) $(INCLUDES) \ +lua_static: $(SRCDIR_SRCS) + $(SWIG) -lua -module example $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR)$(LUA_INTERP) $(INCLUDES) \ $(LUA_INCLUDE) $(LIBS) $(LUA_LIB) -o $(TARGET) -lua_static_cpp: $(SRCS) - $(SWIG) -c++ -lua -module example $(SWIGOPT) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(LUA_INTERP) $(INCLUDES) \ +lua_static_cpp: $(SRCDIR_SRCS) $(GENCXXSRCS) + $(SWIG) -c++ -lua -module example $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(GENCXXSRCS) $(SRCDIR)$(LUA_INTERP) $(INCLUDES) \ $(LUA_INCLUDE) $(LIBS) $(LUA_LIB) -o $(TARGET) # ----------------------------------------------------------------- @@ -1430,7 +1462,7 @@ lua_run: $(RUNTOOL) $(LUA) $(LUA_SCRIPT) $(RUNPIPE) lua_embed_run: - $(RUNTOOL) ./$(TARGET) $(RUNPIPE) + $(RUNTOOL) ./$(TARGET) $(LUA_SCRIPT) $(RUNPIPE) # ----------------------------------------------------------------- # Version display @@ -1455,14 +1487,14 @@ lua_clean: ALLEGROCL = @ALLEGROCLBIN@ ALLEGROCL_SCRIPT=$(RUNME).lisp -allegrocl: $(SRCS) - $(SWIG) -allegrocl -cwrap $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS) +allegrocl: $(SRCDIR_SRCS) + $(SWIG) -allegrocl -cwrap $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) -allegrocl_cpp: $(SRCS) - $(SWIG) -c++ -allegrocl $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) +allegrocl_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -allegrocl $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- @@ -1495,11 +1527,11 @@ allegrocl_clean: CLISP = @CLISPBIN@ CLISP_SCRIPT=$(RUNME).lisp -clisp: $(SRCS) - $(SWIG) -clisp $(SWIGOPT) $(INTERFACEPATH) +clisp: $(SRCDIR_SRCS) + $(SWIG) -clisp $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) -clisp_cpp: $(SRCS) - $(SWIG) -c++ -clisp $(SWIGOPT) $(INTERFACEPATH) +clisp_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -clisp $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) # ----------------------------------------------------------------- # Run CLISP example @@ -1531,14 +1563,14 @@ clisp_clean: CFFI = @CFFIBIN@ CFFI_SCRIPT=$(RUNME).lisp -cffi: $(SRCS) - $(SWIG) -cffi $(SWIGOPT) $(INTERFACEPATH) -# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS) +cffi: $(SRCDIR_SRCS) + $(SWIG) -cffi $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) +# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) # $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) -cffi_cpp: $(SRCS) - $(SWIG) -c++ -cffi $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) +cffi_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -cffi $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- @@ -1571,14 +1603,14 @@ cffi_clean: UFFI = @UFFIBIN@ UFFI_SCRIPT=$(RUNME).lisp -uffi: $(SRCS) - $(SWIG) -uffi $(SWIGOPT) $(INTERFACEPATH) -# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCS) +uffi: $(SRCDIR_SRCS) + $(SWIG) -uffi $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) +# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) # $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) -uffi_cpp: $(SRCS) - $(SWIG) -c++ -uffi $(SWIGOPT) $(INTERFACEPATH) -# $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) +uffi_cpp: $(SRCDIR_SRCS) + $(SWIG) -c++ -uffi $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) +# $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) # $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- @@ -1622,10 +1654,10 @@ R_SCRIPT=$(RUNME).R # Build a R dynamically loadable module (C) # ---------------------------------------------------------------- -r: $(SRCS) - $(SWIG) -r $(SWIGOPT) $(INTERFACEPATH) -ifneq ($(SRCS),) - $(CC) -g -c $(CFLAGS) $(R_CFLAGS) $(SRCS) $(INCLUDES) +r: $(SRCDIR_SRCS) + $(SWIG) -r $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) +ifneq ($(SRCDIR_SRCS),) + $(CC) -g -c $(CFLAGS) $(R_CFLAGS) $(SRCDIR_SRCS) $(INCLUDES) endif +( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) $(OBJS) > /dev/null ) @@ -1633,10 +1665,10 @@ endif # Build a R dynamically loadable module (C++) # ---------------------------------------------------------------- -r_cpp: $(CXXSRCS) +r_cpp: $(SRCDIR_CXXSRCS) $(SWIG) -c++ -r $(SWIGOPT) -o $(RCXXSRCS) $(INTERFACEPATH) -ifneq ($(CXXSRCS),) - $(CXX) -g -c $(CXXFLAGS) $(R_CFLAGS) $(CXXSRCS) $(INCLUDES) +ifneq ($(SRCDIR_CXXSRCS),) + $(CXX) -g -c $(CXXFLAGS) $(R_CFLAGS) $(SRCDIR_CXXSRCS) $(INCLUDES) endif +( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) $(OBJS) > /dev/null ) @@ -1697,12 +1729,12 @@ GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@) # Build a Go module (C) # ---------------------------------------------------------------- -go: $(SRCS) - $(SWIG) -go $(GOOPT) $(GOSWIGARG) $(SWIGOPT) $(INTERFACEPATH) +go: $(SRCDIR_SRCS) + $(SWIG) -go $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) if $(GO12) || $(GO13) || $(GOGCC); then \ - $(CC) -g -c $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES); \ + $(CC) -g -c $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \ else \ - $(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES); \ + $(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \ $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \ fi $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(GOSRCS) @@ -1718,12 +1750,12 @@ go: $(SRCS) $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)); \ fi; \ fi - if test -f $(RUNME).go; then \ - $(GO) $(GOCOMPILEARG) $(RUNME).go; \ + if test -f $(SRCDIR)$(RUNME).go; then \ + $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \ if $(GOGCC) ; then \ $(COMPILETOOL) $(GO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOGCCOBJS) $(OBJS) $(IOBJS); \ elif $(GO12) || $(GO13); then \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CC) -extldflags "$(CFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \ fi; \ @@ -1733,12 +1765,12 @@ go: $(SRCS) # Build a Go module (C++) # ---------------------------------------------------------------- -go_cpp: $(SRCS) - $(SWIG) -go -c++ $(GOOPT) $(GOSWIGARG) $(SWIGOPT) $(INTERFACEPATH) +go_cpp: $(SRCDIR_SRCS) + $(SWIG) -go -c++ $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) if $(GO12) || $(GO13) || $(GOGCC); then \ - $(CXX) -g -c $(CXXFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ + $(CXX) -g -c $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ else \ - $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ + $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \ fi $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(GOSRCS) @@ -1754,12 +1786,12 @@ go_cpp: $(SRCS) $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)); \ fi; \ fi - if test -f $(RUNME).go; then \ - $(GO) $(GOCOMPILEARG) $(RUNME).go; \ + if test -f $(SRCDIR)$(RUNME).go; then \ + $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \ if $(GOGCC) ; then \ $(COMPILETOOL) $(GO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOGCCOBJS) $(OBJS) $(IOBJS) -lstdc++; \ elif $(GO12) || $(GO13); then \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \ fi; \ @@ -1770,7 +1802,7 @@ go_cpp: $(SRCS) # ----------------------------------------------------------------- go_run: - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$(RUNME) $(RUNPIPE) + env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) ./$(RUNME) $(RUNPIPE) # ----------------------------------------------------------------- # Version display @@ -1812,18 +1844,18 @@ D_RUNME = ./$(RUNME) # Build a dynamically loadable D wrapper for a C module # ---------------------------------------------------------------- -d: $(SRCS) - $(SWIGD) $(SWIGOPT) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) +d: $(SRCDIR_SRCS) + $(SWIGD) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) + $(CC) -c $(CCSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(LDSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(DLIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- # Build a dynamically loadable D wrapper for a C++ module # ---------------------------------------------------------------- -d_cpp: $(SRCS) - $(SWIGD) -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) +d_cpp: $(SRCDIR_SRCS) + $(SWIGD) -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) + $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(CXXSHARED) $(CXXFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(DLIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- @@ -1832,7 +1864,7 @@ d_cpp: $(SRCS) # Clear the DFLAGS environment variable for the compiler call itself # to work around a discrepancy in argument handling between DMD and LDC. -d_compile: $(SRCS) +d_compile: $(SRCDIR_SRCS) DFLAGS="" $(COMPILETOOL) $(DCOMPILER) $(DFLAGS) $(DSRCS) # ----------------------------------------------------------------- diff --git a/Examples/android/class/Makefile b/Examples/android/class/Makefile index cef405ece..44d33de0a 100644 --- a/Examples/android/class/Makefile +++ b/Examples/android/class/Makefile @@ -13,14 +13,14 @@ TARGETID = 1 check: build build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' INTERFACEDIR='$(INTERFACEDIR)' \ PROJECTNAME='$(PROJECTNAME)' TARGETID='$(TARGETID)' android_cpp install: - $(MAKE) -f $(TOP)/Makefile INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \ PACKAGEDIR='$(PACKAGEDIR)' PACKAGENAME='$(PACKAGENAME)' android_install clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \ PACKAGEDIR='$(PACKAGEDIR)' INTERFACEDIR='$(INTERFACEDIR)' android_clean diff --git a/Examples/android/extend/Makefile b/Examples/android/extend/Makefile index 9b796494a..3d0609a08 100644 --- a/Examples/android/extend/Makefile +++ b/Examples/android/extend/Makefile @@ -13,14 +13,14 @@ TARGETID = 1 check: build build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' INTERFACEDIR='$(INTERFACEDIR)' \ PROJECTNAME='$(PROJECTNAME)' TARGETID='$(TARGETID)' android_cpp install: - $(MAKE) -f $(TOP)/Makefile INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \ PACKAGEDIR='$(PACKAGEDIR)' PACKAGENAME='$(PACKAGENAME)' android_install clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \ PACKAGEDIR='$(PACKAGEDIR)' INTERFACEDIR='$(INTERFACEDIR)' android_clean diff --git a/Examples/android/simple/Makefile b/Examples/android/simple/Makefile index 7e7ff40e1..d71b9880c 100644 --- a/Examples/android/simple/Makefile +++ b/Examples/android/simple/Makefile @@ -13,14 +13,14 @@ TARGETID = 1 check: build build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' INTERFACEDIR='$(INTERFACEDIR)' \ PROJECTNAME='$(PROJECTNAME)' TARGETID='$(TARGETID)' android install: - $(MAKE) -f $(TOP)/Makefile INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INSTALLOPTIONS='$(INSTALLOPTIONS)' PROJECTNAME='$(PROJECTNAME)' \ PACKAGEDIR='$(PACKAGEDIR)' PACKAGENAME='$(PACKAGENAME)' android_install clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' PROJECTNAME='$(PROJECTNAME)' \ PACKAGEDIR='$(PACKAGEDIR)' INTERFACEDIR='$(INTERFACEDIR)' android_clean diff --git a/Examples/chicken/class/Makefile b/Examples/chicken/class/Makefile index cd445c867..5fafa5c15 100644 --- a/Examples/chicken/class/Makefile +++ b/Examples/chicken/class/Makefile @@ -15,24 +15,24 @@ VARIANT = #VARIANT = _static check: build - $(MAKE) -f $(TOP)/Makefile CHICKEN_SCRIPT='runme-lowlevel.scm' chicken_run - $(MAKE) -f $(TOP)/Makefile CHICKEN_SCRIPT='runme-tinyclos.scm' chicken_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CHICKEN_SCRIPT='runme-lowlevel.scm' chicken_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CHICKEN_SCRIPT='runme-tinyclos.scm' chicken_run build: $(TARGET) $(TARGET)_proxy $(TARGET): $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' \ SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \ SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp $(TARGET)_proxy: $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' \ SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT) -proxy' TARGET='$(TARGET)_proxy' \ SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp clean: - $(MAKE) -f $(TOP)/Makefile chicken_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_clean rm -f example.scm rm -f $(TARGET) diff --git a/Examples/chicken/constants/Makefile b/Examples/chicken/constants/Makefile index fe396733e..a6100f757 100644 --- a/Examples/chicken/constants/Makefile +++ b/Examples/chicken/constants/Makefile @@ -14,17 +14,17 @@ VARIANT = #VARIANT = _static check: build - $(MAKE) -f $(TOP)/Makefile chicken_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_run build: $(TARGET) $(TARGET): $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' \ SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \ SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT) clean: - $(MAKE) -f $(TOP)/Makefile chicken_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_clean rm -f example.scm rm -f $(TARGET) diff --git a/Examples/chicken/multimap/Makefile b/Examples/chicken/multimap/Makefile index d92cfede0..79282be17 100644 --- a/Examples/chicken/multimap/Makefile +++ b/Examples/chicken/multimap/Makefile @@ -14,17 +14,17 @@ VARIANT = #VARIANT = _static check: build - $(MAKE) -f $(TOP)/Makefile chicken_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_run build: $(TARGET) $(TARGET): $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' \ SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \ SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT) clean: - $(MAKE) -f $(TOP)/Makefile chicken_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_clean rm -f example.scm rm -f $(TARGET) diff --git a/Examples/chicken/overload/Makefile b/Examples/chicken/overload/Makefile index fb190e882..717abd335 100644 --- a/Examples/chicken/overload/Makefile +++ b/Examples/chicken/overload/Makefile @@ -14,17 +14,17 @@ VARIANT = #VARIANT = _static check: build - $(MAKE) -f $(TOP)/Makefile chicken_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_run build: $(TARGET) $(TARGET): $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' \ SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \ SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp clean: - $(MAKE) -f $(TOP)/Makefile chicken_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_clean rm -f example.scm rm -f $(TARGET) diff --git a/Examples/chicken/simple/Makefile b/Examples/chicken/simple/Makefile index d0d737484..9d1f34fa0 100644 --- a/Examples/chicken/simple/Makefile +++ b/Examples/chicken/simple/Makefile @@ -14,17 +14,17 @@ VARIANT = #VARIANT = _static check: build - $(MAKE) -f $(TOP)/Makefile chicken_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_run build: $(TARGET) $(TARGET): $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' \ SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \ SWIG='$(SWIG)' INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT) clean: - $(MAKE) -f $(TOP)/Makefile chicken_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_clean rm -f example.scm example-generic.scm example-clos.scm rm -f $(TARGET) diff --git a/Examples/csharp/arrays/Makefile b/Examples/csharp/arrays/Makefile index 4be092d1c..e5d733d35 100644 --- a/Examples/csharp/arrays/Makefile +++ b/Examples/csharp/arrays/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -unsafe -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/callback/Makefile b/Examples/csharp/callback/Makefile index 6c58abd28..4f4c84b9a 100644 --- a/Examples/csharp/callback/Makefile +++ b/Examples/csharp/callback/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/class/Makefile b/Examples/csharp/class/Makefile index 6c58abd28..4f4c84b9a 100644 --- a/Examples/csharp/class/Makefile +++ b/Examples/csharp/class/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/enum/Makefile b/Examples/csharp/enum/Makefile index 6c58abd28..4f4c84b9a 100644 --- a/Examples/csharp/enum/Makefile +++ b/Examples/csharp/enum/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/extend/Makefile b/Examples/csharp/extend/Makefile index 6c58abd28..4f4c84b9a 100644 --- a/Examples/csharp/extend/Makefile +++ b/Examples/csharp/extend/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/funcptr/Makefile b/Examples/csharp/funcptr/Makefile index ed15cb28e..99cdfa38a 100644 --- a/Examples/csharp/funcptr/Makefile +++ b/Examples/csharp/funcptr/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/nested/Makefile b/Examples/csharp/nested/Makefile index 6c58abd28..4f4c84b9a 100644 --- a/Examples/csharp/nested/Makefile +++ b/Examples/csharp/nested/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/reference/Makefile b/Examples/csharp/reference/Makefile index 6c58abd28..4f4c84b9a 100644 --- a/Examples/csharp/reference/Makefile +++ b/Examples/csharp/reference/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/simple/Makefile b/Examples/csharp/simple/Makefile index ed15cb28e..99cdfa38a 100644 --- a/Examples/csharp/simple/Makefile +++ b/Examples/csharp/simple/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/template/Makefile b/Examples/csharp/template/Makefile index 23fe2eec9..2d0e07009 100644 --- a/Examples/csharp/template/Makefile +++ b/Examples/csharp/template/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp_cpp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/csharp/variables/Makefile b/Examples/csharp/variables/Makefile index ed15cb28e..99cdfa38a 100644 --- a/Examples/csharp/variables/Makefile +++ b/Examples/csharp/variables/Makefile @@ -8,12 +8,12 @@ CSHARPSRCS = *.cs CSHARPFLAGS= -nologo -debug+ -out:runme.exe check: build - $(MAKE) -f $(TOP)/Makefile csharp_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' csharp - $(MAKE) -f $(TOP)/Makefile CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CSHARPSRCS='$(CSHARPSRCS)' CSHARPFLAGS='$(CSHARPFLAGS)' csharp_compile clean: - $(MAKE) -f $(TOP)/Makefile csharp_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' csharp_clean diff --git a/Examples/d/callback/Makefile b/Examples/d/callback/Makefile index eda18f13c..72edc17a5 100644 --- a/Examples/d/callback/Makefile +++ b/Examples/d/callback/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/d/class/Makefile b/Examples/d/class/Makefile index eda18f13c..72edc17a5 100644 --- a/Examples/d/class/Makefile +++ b/Examples/d/class/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/d/constants/Makefile b/Examples/d/constants/Makefile index d537ce281..609c7f660 100644 --- a/Examples/d/constants/Makefile +++ b/Examples/d/constants/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/d/enum/Makefile b/Examples/d/enum/Makefile index eda18f13c..72edc17a5 100644 --- a/Examples/d/enum/Makefile +++ b/Examples/d/enum/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/d/extend/Makefile b/Examples/d/extend/Makefile index eda18f13c..72edc17a5 100644 --- a/Examples/d/extend/Makefile +++ b/Examples/d/extend/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d_cpp; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/d/funcptr/Makefile b/Examples/d/funcptr/Makefile index 2ba893ca7..6554c3c73 100644 --- a/Examples/d/funcptr/Makefile +++ b/Examples/d/funcptr/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/d/simple/Makefile b/Examples/d/simple/Makefile index a8808c9c5..f5eed3210 100644 --- a/Examples/d/simple/Makefile +++ b/Examples/d/simple/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/d/variables/Makefile b/Examples/d/variables/Makefile index a8808c9c5..f5eed3210 100644 --- a/Examples/d/variables/Makefile +++ b/Examples/d/variables/Makefile @@ -15,13 +15,13 @@ DFLAGS = -ofrunme check: build cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_run build: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ - $(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile clean: cd $(WORKING_DIR); \ - $(MAKE) -f $(TOP)/Makefile d_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' d_clean diff --git a/Examples/go/callback/Makefile b/Examples/go/callback/Makefile index 46a14b417..bf5275f14 100644 --- a/Examples/go/callback/Makefile +++ b/Examples/go/callback/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/class/Makefile b/Examples/go/class/Makefile index 72605caa5..de067cdd8 100644 --- a/Examples/go/class/Makefile +++ b/Examples/go/class/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/constants/Makefile b/Examples/go/constants/Makefile index 9fa967366..8fb07fd6b 100644 --- a/Examples/go/constants/Makefile +++ b/Examples/go/constants/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/enum/Makefile b/Examples/go/enum/Makefile index 1ceecc15c..2e2f1b2bd 100644 --- a/Examples/go/enum/Makefile +++ b/Examples/go/enum/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/extend/Makefile b/Examples/go/extend/Makefile index 67da89286..290694210 100644 --- a/Examples/go/extend/Makefile +++ b/Examples/go/extend/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/funcptr/Makefile b/Examples/go/funcptr/Makefile index 2c32c45fc..82031c9d5 100644 --- a/Examples/go/funcptr/Makefile +++ b/Examples/go/funcptr/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/multimap/Makefile b/Examples/go/multimap/Makefile index 0c5ec395f..4d739162b 100644 --- a/Examples/go/multimap/Makefile +++ b/Examples/go/multimap/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/pointer/Makefile b/Examples/go/pointer/Makefile index 12e94f939..9f1f3fda0 100644 --- a/Examples/go/pointer/Makefile +++ b/Examples/go/pointer/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/reference/Makefile b/Examples/go/reference/Makefile index 41a944239..e136f6fae 100644 --- a/Examples/go/reference/Makefile +++ b/Examples/go/reference/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/simple/Makefile b/Examples/go/simple/Makefile index 907da8821..5bc16549d 100644 --- a/Examples/go/simple/Makefile +++ b/Examples/go/simple/Makefile @@ -5,11 +5,11 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/template/Makefile b/Examples/go/template/Makefile index 51cd97a80..a1d674836 100644 --- a/Examples/go/template/Makefile +++ b/Examples/go/template/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_cpp clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/go/variables/Makefile b/Examples/go/variables/Makefile index 1f144929c..d0da605e0 100644 --- a/Examples/go/variables/Makefile +++ b/Examples/go/variables/Makefile @@ -6,11 +6,11 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' go clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' go_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' go_clean diff --git a/Examples/guile/class/Makefile b/Examples/guile/class/Makefile index 8de4f292b..48426a8fb 100644 --- a/Examples/guile/class/Makefile +++ b/Examples/guile/class/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile guile_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' guile_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static_cpp clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean diff --git a/Examples/guile/constants/Makefile b/Examples/guile/constants/Makefile index 2b6965e9e..d3f58ebdc 100644 --- a/Examples/guile/constants/Makefile +++ b/Examples/guile/constants/Makefile @@ -5,11 +5,11 @@ TARGET = my-guile INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_augmented_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_augmented_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_augmented clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean diff --git a/Examples/guile/matrix/Makefile b/Examples/guile/matrix/Makefile index a32210e65..53638c867 100644 --- a/Examples/guile/matrix/Makefile +++ b/Examples/guile/matrix/Makefile @@ -5,11 +5,11 @@ TARGET = matrix INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' GUILE_RUNOPTIONS='-e do-test' guile_augmented_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' GUILE_RUNOPTIONS='-e do-test' guile_augmented_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' LIBS='-lm' guile_augmented clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean diff --git a/Examples/guile/multimap/Makefile b/Examples/guile/multimap/Makefile index 4ca82a3d3..b8f5e9b5a 100644 --- a/Examples/guile/multimap/Makefile +++ b/Examples/guile/multimap/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile guile_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' guile_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean diff --git a/Examples/guile/multivalue/Makefile b/Examples/guile/multivalue/Makefile index 4ca82a3d3..b8f5e9b5a 100644 --- a/Examples/guile/multivalue/Makefile +++ b/Examples/guile/multivalue/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile guile_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' guile_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean diff --git a/Examples/guile/port/Makefile b/Examples/guile/port/Makefile index d6ec0ac24..95a3a479f 100644 --- a/Examples/guile/port/Makefile +++ b/Examples/guile/port/Makefile @@ -5,12 +5,12 @@ TARGET = port INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_augmented_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_augmented_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_augmented clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean rm -f test.out diff --git a/Examples/guile/simple/Makefile b/Examples/guile/simple/Makefile index da4eb9015..517e41c64 100644 --- a/Examples/guile/simple/Makefile +++ b/Examples/guile/simple/Makefile @@ -5,11 +5,11 @@ TARGET = my-guile INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_augmented_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_augmented_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_augmented clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean diff --git a/Examples/guile/std_vector/Makefile b/Examples/guile/std_vector/Makefile index fd7a8439a..d7f5de217 100644 --- a/Examples/guile/std_vector/Makefile +++ b/Examples/guile/std_vector/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile guile_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' guile_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' guile_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='my-guile' INTERFACE='$(INTERFACE)' guile_static_cpp clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' guile_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' guile_clean diff --git a/Examples/java/callback/Makefile b/Examples/java/callback/Makefile index 8f274e7cb..13cfd1708 100644 --- a/Examples/java/callback/Makefile +++ b/Examples/java/callback/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/class/Makefile b/Examples/java/class/Makefile index 8f274e7cb..13cfd1708 100644 --- a/Examples/java/class/Makefile +++ b/Examples/java/class/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/constants/Makefile b/Examples/java/constants/Makefile index 4e21fc4cd..637ce0ead 100644 --- a/Examples/java/constants/Makefile +++ b/Examples/java/constants/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/enum/Makefile b/Examples/java/enum/Makefile index 8f274e7cb..13cfd1708 100644 --- a/Examples/java/enum/Makefile +++ b/Examples/java/enum/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/extend/Makefile b/Examples/java/extend/Makefile index 8f274e7cb..13cfd1708 100644 --- a/Examples/java/extend/Makefile +++ b/Examples/java/extend/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/funcptr/Makefile b/Examples/java/funcptr/Makefile index e9e29f3a3..c0b1927ca 100644 --- a/Examples/java/funcptr/Makefile +++ b/Examples/java/funcptr/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/multimap/Makefile b/Examples/java/multimap/Makefile index e9e29f3a3..c0b1927ca 100644 --- a/Examples/java/multimap/Makefile +++ b/Examples/java/multimap/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/native/Makefile b/Examples/java/native/Makefile index e858cbe77..fa67e48a4 100644 --- a/Examples/java/native/Makefile +++ b/Examples/java/native/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/nested/Makefile b/Examples/java/nested/Makefile index 8f274e7cb..13cfd1708 100644 --- a/Examples/java/nested/Makefile +++ b/Examples/java/nested/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/pointer/Makefile b/Examples/java/pointer/Makefile index e9e29f3a3..c0b1927ca 100644 --- a/Examples/java/pointer/Makefile +++ b/Examples/java/pointer/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/reference/Makefile b/Examples/java/reference/Makefile index 8f274e7cb..13cfd1708 100644 --- a/Examples/java/reference/Makefile +++ b/Examples/java/reference/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/simple/Makefile b/Examples/java/simple/Makefile index e9e29f3a3..c0b1927ca 100644 --- a/Examples/java/simple/Makefile +++ b/Examples/java/simple/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/template/Makefile b/Examples/java/template/Makefile index 4e21fc4cd..637ce0ead 100644 --- a/Examples/java/template/Makefile +++ b/Examples/java/template/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java_cpp - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/typemap/Makefile b/Examples/java/typemap/Makefile index e858cbe77..fa67e48a4 100644 --- a/Examples/java/typemap/Makefile +++ b/Examples/java/typemap/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/java/variables/Makefile b/Examples/java/variables/Makefile index e9e29f3a3..c0b1927ca 100644 --- a/Examples/java/variables/Makefile +++ b/Examples/java/variables/Makefile @@ -7,12 +7,12 @@ SWIGOPT = JAVASRCS = *.java check: build - $(MAKE) -f $(TOP)/Makefile java_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' java - $(MAKE) -f $(TOP)/Makefile JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' JAVASRCS='$(JAVASRCS)' JAVAFLAGS='$(JAVAFLAGS)' java_compile clean: - $(MAKE) -f $(TOP)/Makefile java_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' java_clean diff --git a/Examples/javascript/class/Makefile b/Examples/javascript/class/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/class/Makefile +++ b/Examples/javascript/class/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/class/binding.gyp b/Examples/javascript/class/binding.gyp deleted file mode 100644 index 54eebfaa0..000000000 --- a/Examples/javascript/class/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/class/binding.gyp.in b/Examples/javascript/class/binding.gyp.in new file mode 100644 index 000000000..c56a650e9 --- /dev/null +++ b/Examples/javascript/class/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/class/example.js b/Examples/javascript/class/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/class/example.js +++ b/Examples/javascript/class/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/class/runme.js b/Examples/javascript/class/runme.js index e1d5d9797..6a77b8d8e 100644 --- a/Examples/javascript/class/runme.js +++ b/Examples/javascript/class/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); // ----- Object creation ----- diff --git a/Examples/javascript/constant/Makefile b/Examples/javascript/constant/Makefile index ea04c7df8..0402f8d09 100644 --- a/Examples/javascript/constant/Makefile +++ b/Examples/javascript/constant/Makefile @@ -1,3 +1,3 @@ SRCS = -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/constant/binding.gyp b/Examples/javascript/constant/binding.gyp deleted file mode 100644 index 69af46b22..000000000 --- a/Examples/javascript/constant/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/constant/binding.gyp.in b/Examples/javascript/constant/binding.gyp.in new file mode 100644 index 000000000..59779aef4 --- /dev/null +++ b/Examples/javascript/constant/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/constant/example.js b/Examples/javascript/constant/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/constant/example.js +++ b/Examples/javascript/constant/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/constant/runme.js b/Examples/javascript/constant/runme.js index f4b55881e..f29d1a850 100644 --- a/Examples/javascript/constant/runme.js +++ b/Examples/javascript/constant/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); console.log("ICONST = " + example.ICONST + " (should be 42)"); console.log("FCONST = " + example.FCONST + " (should be 2.1828)"); diff --git a/Examples/javascript/enum/Makefile b/Examples/javascript/enum/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/enum/Makefile +++ b/Examples/javascript/enum/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/enum/binding.gyp b/Examples/javascript/enum/binding.gyp deleted file mode 100644 index 54eebfaa0..000000000 --- a/Examples/javascript/enum/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/enum/binding.gyp.in b/Examples/javascript/enum/binding.gyp.in new file mode 100644 index 000000000..c56a650e9 --- /dev/null +++ b/Examples/javascript/enum/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/enum/example.js b/Examples/javascript/enum/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/enum/example.js +++ b/Examples/javascript/enum/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/enum/runme.js b/Examples/javascript/enum/runme.js index d4e89e8c8..851d43c4b 100644 --- a/Examples/javascript/enum/runme.js +++ b/Examples/javascript/enum/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); // ----- Object creation ----- diff --git a/Examples/javascript/example.mk b/Examples/javascript/example.mk index 274eff1a3..5a335bba4 100644 --- a/Examples/javascript/example.mk +++ b/Examples/javascript/example.mk @@ -15,13 +15,13 @@ INTERFACE = example.i SWIGOPT=-$(JSENGINE) check: build - $(MAKE) -f $(EXAMPLES_TOP)/Makefile JSENGINE='$(JSENGINE)' TARGET='$(TARGET)' javascript_run + $(MAKE) -f $(EXAMPLES_TOP)/Makefile SRCDIR='$(SRCDIR)' JSENGINE='$(JSENGINE)' TARGET='$(TARGET)' javascript_run build: - $(MAKE) -f $(EXAMPLES_TOP)/Makefile CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(EXAMPLES_TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' javascript_wrapper_cpp - $(MAKE) -f $(EXAMPLES_TOP)/Makefile CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(EXAMPLES_TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' JSENGINE='$(JSENGINE)' javascript_build_cpp clean: - $(MAKE) -f $(EXAMPLES_TOP)/Makefile javascript_clean + $(MAKE) -f $(EXAMPLES_TOP)/Makefile SRCDIR='$(SRCDIR)' javascript_clean diff --git a/Examples/javascript/exception/Makefile b/Examples/javascript/exception/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/exception/Makefile +++ b/Examples/javascript/exception/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/exception/binding.gyp b/Examples/javascript/exception/binding.gyp.in similarity index 89% rename from Examples/javascript/exception/binding.gyp rename to Examples/javascript/exception/binding.gyp.in index 2be0a17a2..577a5c2e3 100644 --- a/Examples/javascript/exception/binding.gyp +++ b/Examples/javascript/exception/binding.gyp.in @@ -2,7 +2,8 @@ "targets": [ { "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ], + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"], 'defines': [ 'BUILDING_NODE_EXTENSION=1', ], diff --git a/Examples/javascript/exception/example.js b/Examples/javascript/exception/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/exception/example.js +++ b/Examples/javascript/exception/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/exception/runme.js b/Examples/javascript/exception/runme.js index 977f51ebc..43ce66d6d 100644 --- a/Examples/javascript/exception/runme.js +++ b/Examples/javascript/exception/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); console.log("Trying to catch some exceptions."); t = new example.Test(); diff --git a/Examples/javascript/functor/Makefile b/Examples/javascript/functor/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/functor/Makefile +++ b/Examples/javascript/functor/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/functor/binding.gyp b/Examples/javascript/functor/binding.gyp deleted file mode 100644 index 54eebfaa0..000000000 --- a/Examples/javascript/functor/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/functor/binding.gyp.in b/Examples/javascript/functor/binding.gyp.in new file mode 100644 index 000000000..c56a650e9 --- /dev/null +++ b/Examples/javascript/functor/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/functor/example.js b/Examples/javascript/functor/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/functor/example.js +++ b/Examples/javascript/functor/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/functor/runme.js b/Examples/javascript/functor/runme.js index dc12470f4..28dc64320 100644 --- a/Examples/javascript/functor/runme.js +++ b/Examples/javascript/functor/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); a = new example.intSum(0); b = new example.doubleSum(100.0); diff --git a/Examples/javascript/nspace/Makefile b/Examples/javascript/nspace/Makefile index ea04c7df8..0402f8d09 100644 --- a/Examples/javascript/nspace/Makefile +++ b/Examples/javascript/nspace/Makefile @@ -1,3 +1,3 @@ SRCS = -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/nspace/binding.gyp b/Examples/javascript/nspace/binding.gyp deleted file mode 100644 index 69af46b22..000000000 --- a/Examples/javascript/nspace/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/nspace/binding.gyp.in b/Examples/javascript/nspace/binding.gyp.in new file mode 100644 index 000000000..59779aef4 --- /dev/null +++ b/Examples/javascript/nspace/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/nspace/example.js b/Examples/javascript/nspace/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/nspace/example.js +++ b/Examples/javascript/nspace/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/nspace/runme.js b/Examples/javascript/nspace/runme.js index d6a49d8d4..fad73477d 100644 --- a/Examples/javascript/nspace/runme.js +++ b/Examples/javascript/nspace/runme.js @@ -3,7 +3,7 @@ // This file illustrates class C++ interface generated // by SWIG. -var example = require("./example"); +var example = require("example"); // Calling a module function ( aka global function ) if (example.module_function() !== 7) { diff --git a/Examples/javascript/operator/Makefile b/Examples/javascript/operator/Makefile index ea04c7df8..0402f8d09 100644 --- a/Examples/javascript/operator/Makefile +++ b/Examples/javascript/operator/Makefile @@ -1,3 +1,3 @@ SRCS = -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/operator/binding.gyp b/Examples/javascript/operator/binding.gyp deleted file mode 100644 index 69af46b22..000000000 --- a/Examples/javascript/operator/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/operator/binding.gyp.in b/Examples/javascript/operator/binding.gyp.in new file mode 100644 index 000000000..59779aef4 --- /dev/null +++ b/Examples/javascript/operator/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/operator/example.js b/Examples/javascript/operator/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/operator/example.js +++ b/Examples/javascript/operator/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/operator/runme.js b/Examples/javascript/operator/runme.js index a700918d6..f72ca1c28 100644 --- a/Examples/javascript/operator/runme.js +++ b/Examples/javascript/operator/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); a = new example.Complex(2,3); b = new example.Complex(-5,10); diff --git a/Examples/javascript/overload/Makefile b/Examples/javascript/overload/Makefile index ea04c7df8..0402f8d09 100644 --- a/Examples/javascript/overload/Makefile +++ b/Examples/javascript/overload/Makefile @@ -1,3 +1,3 @@ SRCS = -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/overload/binding.gyp b/Examples/javascript/overload/binding.gyp deleted file mode 100644 index 69af46b22..000000000 --- a/Examples/javascript/overload/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/overload/binding.gyp.in b/Examples/javascript/overload/binding.gyp.in new file mode 100644 index 000000000..59779aef4 --- /dev/null +++ b/Examples/javascript/overload/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/overload/example.js b/Examples/javascript/overload/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/overload/example.js +++ b/Examples/javascript/overload/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/overload/runme.js b/Examples/javascript/overload/runme.js index 1e6c861a6..1c23e3b6b 100644 --- a/Examples/javascript/overload/runme.js +++ b/Examples/javascript/overload/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); example.f(); example.f(1); diff --git a/Examples/javascript/pointer/Makefile b/Examples/javascript/pointer/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/pointer/Makefile +++ b/Examples/javascript/pointer/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/pointer/binding.gyp b/Examples/javascript/pointer/binding.gyp deleted file mode 100644 index 54eebfaa0..000000000 --- a/Examples/javascript/pointer/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/pointer/binding.gyp.in b/Examples/javascript/pointer/binding.gyp.in new file mode 100644 index 000000000..c56a650e9 --- /dev/null +++ b/Examples/javascript/pointer/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/pointer/example.js b/Examples/javascript/pointer/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/pointer/example.js +++ b/Examples/javascript/pointer/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/pointer/runme.js b/Examples/javascript/pointer/runme.js index fb8cf0c74..e9fa9a0bc 100644 --- a/Examples/javascript/pointer/runme.js +++ b/Examples/javascript/pointer/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); // First create some objects using the pointer library. console.log("Testing the pointer library"); diff --git a/Examples/javascript/reference/Makefile b/Examples/javascript/reference/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/reference/Makefile +++ b/Examples/javascript/reference/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/reference/binding.gyp b/Examples/javascript/reference/binding.gyp deleted file mode 100644 index 54eebfaa0..000000000 --- a/Examples/javascript/reference/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/reference/binding.gyp.in b/Examples/javascript/reference/binding.gyp.in new file mode 100644 index 000000000..c56a650e9 --- /dev/null +++ b/Examples/javascript/reference/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/reference/example.js b/Examples/javascript/reference/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/reference/example.js +++ b/Examples/javascript/reference/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/reference/runme.js b/Examples/javascript/reference/runme.js index 88c108314..04f732520 100644 --- a/Examples/javascript/reference/runme.js +++ b/Examples/javascript/reference/runme.js @@ -1,5 +1,5 @@ // This file illustrates the manipulation of C++ references in Javascript. -var example = require("./example"); +var example = require("example"); // ----- Object creation ----- diff --git a/Examples/javascript/simple/Makefile b/Examples/javascript/simple/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/simple/Makefile +++ b/Examples/javascript/simple/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/simple/binding.gyp b/Examples/javascript/simple/binding.gyp deleted file mode 100644 index 54eebfaa0..000000000 --- a/Examples/javascript/simple/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/simple/binding.gyp.in b/Examples/javascript/simple/binding.gyp.in new file mode 100644 index 000000000..c56a650e9 --- /dev/null +++ b/Examples/javascript/simple/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/simple/example.js b/Examples/javascript/simple/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/simple/example.js +++ b/Examples/javascript/simple/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/simple/runme.js b/Examples/javascript/simple/runme.js index be2c18669..4abff0e2a 100644 --- a/Examples/javascript/simple/runme.js +++ b/Examples/javascript/simple/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); /* Call our gcd() function */ diff --git a/Examples/javascript/template/Makefile b/Examples/javascript/template/Makefile index ea04c7df8..0402f8d09 100644 --- a/Examples/javascript/template/Makefile +++ b/Examples/javascript/template/Makefile @@ -1,3 +1,3 @@ SRCS = -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/template/binding.gyp b/Examples/javascript/template/binding.gyp deleted file mode 100644 index 69af46b22..000000000 --- a/Examples/javascript/template/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/template/binding.gyp.in b/Examples/javascript/template/binding.gyp.in new file mode 100644 index 000000000..59779aef4 --- /dev/null +++ b/Examples/javascript/template/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/template/example.js b/Examples/javascript/template/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/template/example.js +++ b/Examples/javascript/template/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/template/runme.js b/Examples/javascript/template/runme.js index 55894dfd5..af96ac7f9 100644 --- a/Examples/javascript/template/runme.js +++ b/Examples/javascript/template/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); //Call some templated functions console.log(example.maxint(3,7)); diff --git a/Examples/javascript/variables/Makefile b/Examples/javascript/variables/Makefile index 31846faae..54a8f7b03 100644 --- a/Examples/javascript/variables/Makefile +++ b/Examples/javascript/variables/Makefile @@ -1,3 +1,3 @@ SRCS = example.cxx -include ../example.mk +include $(SRCDIR)../example.mk diff --git a/Examples/javascript/variables/binding.gyp b/Examples/javascript/variables/binding.gyp deleted file mode 100644 index 54eebfaa0..000000000 --- a/Examples/javascript/variables/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - "targets": [ - { - "target_name": "example", - "sources": [ "example.cxx", "example_wrap.cxx" ] - } - ] -} diff --git a/Examples/javascript/variables/binding.gyp.in b/Examples/javascript/variables/binding.gyp.in new file mode 100644 index 000000000..c56a650e9 --- /dev/null +++ b/Examples/javascript/variables/binding.gyp.in @@ -0,0 +1,9 @@ +{ + "targets": [ + { + "target_name": "example", + "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "include_dirs": ["$srcdir"] + } + ] +} diff --git a/Examples/javascript/variables/example.js b/Examples/javascript/variables/example.js index 79cd3913f..2e7f83a06 100644 --- a/Examples/javascript/variables/example.js +++ b/Examples/javascript/variables/example.js @@ -1 +1 @@ -module.exports = require("./build/Release/example"); +module.exports = require("build/Release/example"); diff --git a/Examples/javascript/variables/runme.js b/Examples/javascript/variables/runme.js index 537e17296..a2b5f791c 100644 --- a/Examples/javascript/variables/runme.js +++ b/Examples/javascript/variables/runme.js @@ -1,4 +1,4 @@ -var example = require("./example"); +var example = require("example"); // Try to set the values of some global variables example.ivar = 42; diff --git a/Examples/lua/arrays/Makefile b/Examples/lua/arrays/Makefile index d398dffea..4191f7ec3 100644 --- a/Examples/lua/arrays/Makefile +++ b/Examples/lua/arrays/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/class/Makefile b/Examples/lua/class/Makefile index c39e8acdf..96308f0df 100644 --- a/Examples/lua/class/Makefile +++ b/Examples/lua/class/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/constants/Makefile b/Examples/lua/constants/Makefile index 7e36e15a1..ae33cb182 100644 --- a/Examples/lua/constants/Makefile +++ b/Examples/lua/constants/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/dual/Makefile b/Examples/lua/dual/Makefile index 12ee00a68..c86152a97 100644 --- a/Examples/lua/dual/Makefile +++ b/Examples/lua/dual/Makefile @@ -1,21 +1,21 @@ TOP = ../.. SWIG = $(TOP)/../preinst-swig TARGET = dual -CXXSRCS = example2_wrap.cxx +GENCXXSRCS = example2_wrap.cxx INTERFACE = dual.i LUA_INTERP = dual.cpp # This is a little different to normal as we need to static link two modules and a custom interpreter # We need the external runtime, then swig examples2, and build the module as normal check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' lua_embed_run build: $(SWIG) -lua -external-runtime - $(SWIG) -c++ -lua $(SWIGOPT) example2.i - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(SWIG) -c++ -lua $(SWIGOPT) -o $(GENCXXSRCS) $(SRCDIR)example2.i + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) GENCXXSRCS='$(GENCXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static_cpp clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean rm -f swigluarun.h $(TARGET) diff --git a/Examples/lua/embed/Makefile b/Examples/lua/embed/Makefile index 57979c061..5e3a91893 100644 --- a/Examples/lua/embed/Makefile +++ b/Examples/lua/embed/Makefile @@ -9,12 +9,12 @@ LIBS = -lm # this is a little different to normal as we have our own special interpreter # which we want to static link check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' lua_embed_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' LIBS='$(LIBS)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean rm -f $(TARGET) diff --git a/Examples/lua/embed/embed.c b/Examples/lua/embed/embed.c index 507567489..1f10cc8e8 100644 --- a/Examples/lua/embed/embed.c +++ b/Examples/lua/embed/embed.c @@ -13,6 +13,7 @@ We will be using the luaL_dostring()/lua_dostring() function to call into lua #include #include +#include #include #include @@ -62,9 +63,13 @@ int main(int argc,char* argv[]) { luaopen_example(L); printf("[C] all looks ok\n"); printf("\n"); - printf("[C] let's load the file 'runme.lua'\n"); + if (argc != 2 || argv[1] == NULL || strlen(argv[1]) == 0) { + printf("[C] ERROR: no lua file given on command line\n"); + exit(3); + } + printf("[C] let's load the file '%s'\n", argv[1]); printf("[C] any lua code in this file will be executed\n"); - if (luaL_loadfile(L, "runme.lua") || lua_pcall(L, 0, 0, 0)) { + if (luaL_loadfile(L, argv[1]) || lua_pcall(L, 0, 0, 0)) { printf("[C] ERROR: cannot run lua file: %s",lua_tostring(L, -1)); exit(3); } diff --git a/Examples/lua/embed2/Makefile b/Examples/lua/embed2/Makefile index ec22bdcae..d30ba0942 100644 --- a/Examples/lua/embed2/Makefile +++ b/Examples/lua/embed2/Makefile @@ -9,12 +9,12 @@ LIBS = -lm # this is a little different to normal as we have our own special interpreter # which we want to static link check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' lua_embed_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' LIBS='$(LIBS)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean rm -f $(TARGET) diff --git a/Examples/lua/embed2/embed2.c b/Examples/lua/embed2/embed2.c index 100a1fb33..7b2ca9b67 100644 --- a/Examples/lua/embed2/embed2.c +++ b/Examples/lua/embed2/embed2.c @@ -24,6 +24,7 @@ We will be using the luaL_dostring()/lua_dostring() function to call into lua #include #include +#include #include #include @@ -189,9 +190,13 @@ int main(int argc,char* argv[]) { luaopen_example(L); printf("[C] all looks ok\n"); printf("\n"); - printf("[C] let's load the file 'runme.lua'\n"); + if (argc != 2 || argv[1] == NULL || strlen(argv[1]) == 0) { + printf("[C] ERROR: no lua file given on command line\n"); + exit(3); + } + printf("[C] let's load the file '%s'\n", argv[1]); printf("[C] any lua code in this file will be executed\n"); - if (luaL_loadfile(L, "runme.lua") || lua_pcall(L, 0, 0, 0)) { + if (luaL_loadfile(L, argv[1]) || lua_pcall(L, 0, 0, 0)) { printf("[C] ERROR: cannot run lua file: %s",lua_tostring(L, -1)); exit(3); } diff --git a/Examples/lua/embed3/Makefile b/Examples/lua/embed3/Makefile index 8cfa97454..fc0026122 100644 --- a/Examples/lua/embed3/Makefile +++ b/Examples/lua/embed3/Makefile @@ -9,13 +9,13 @@ LUA_INTERP = embed3.cpp # which we want to static link # we also need the external runtime, so we can get access to certain internals of SWIG check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' lua_embed_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' lua_embed_run build: $(SWIG) -c++ -lua $(SWIGOPT) -external-runtime swigluarun.h - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static_cpp clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean rm -f swigluarun.h $(TARGET) diff --git a/Examples/lua/embed3/embed3.cpp b/Examples/lua/embed3/embed3.cpp index d559167d1..9be49add3 100644 --- a/Examples/lua/embed3/embed3.cpp +++ b/Examples/lua/embed3/embed3.cpp @@ -113,10 +113,14 @@ int main(int argc, char* argv[]) { push_pointer(L,&engine,"Engine *",0); lua_setglobal(L, "pEngine"); // set as global variable - printf("[C++] now let's load the file 'runme.lua'\n"); + if (argc != 2 || argv[1] == NULL || strlen(argv[1]) == 0) { + printf("[C++] ERROR: no lua file given on command line\n"); + exit(3); + } + printf("[C++] now let's load the file '%s'\n", argv[1]); printf("[C++] any lua code in this file will be executed\n"); - if (luaL_loadfile(L, "runme.lua") || lua_pcall(L, 0, 0, 0)) { - printf("[C++] ERROR: cannot run lua file: %s", lua_tostring(L, -1)); + if (luaL_loadfile(L, argv[1]) || lua_pcall(L, 0, 0, 0)) { + printf("[C++] ERROR: cannot run lua file: %s",lua_tostring(L, -1)); exit(3); } printf("[C++] We are now back in C++, all looks ok\n"); diff --git a/Examples/lua/exception/Makefile b/Examples/lua/exception/Makefile index 3dbebb4e5..ac9c28b69 100644 --- a/Examples/lua/exception/Makefile +++ b/Examples/lua/exception/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/funcptr3/Makefile b/Examples/lua/funcptr3/Makefile index 8b51e73e8..aeeaad469 100644 --- a/Examples/lua/funcptr3/Makefile +++ b/Examples/lua/funcptr3/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/functest/Makefile b/Examples/lua/functest/Makefile index 8b51e73e8..aeeaad469 100644 --- a/Examples/lua/functest/Makefile +++ b/Examples/lua/functest/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/functor/Makefile b/Examples/lua/functor/Makefile index 4e4edbfa5..e647fb2a8 100644 --- a/Examples/lua/functor/Makefile +++ b/Examples/lua/functor/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/import/Makefile b/Examples/lua/import/Makefile index 0a9aebd57..8d64a21c6 100644 --- a/Examples/lua/import/Makefile +++ b/Examples/lua/import/Makefile @@ -4,17 +4,17 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' lua_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' lua_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' lua_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' lua_cpp clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/nspace/Makefile b/Examples/lua/nspace/Makefile index 57875ec49..17757c2ec 100644 --- a/Examples/lua/nspace/Makefile +++ b/Examples/lua/nspace/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/owner/Makefile b/Examples/lua/owner/Makefile index c39e8acdf..96308f0df 100644 --- a/Examples/lua/owner/Makefile +++ b/Examples/lua/owner/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/pointer/Makefile b/Examples/lua/pointer/Makefile index 8b51e73e8..aeeaad469 100644 --- a/Examples/lua/pointer/Makefile +++ b/Examples/lua/pointer/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/simple/Makefile b/Examples/lua/simple/Makefile index d398dffea..4191f7ec3 100644 --- a/Examples/lua/simple/Makefile +++ b/Examples/lua/simple/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/lua/variables/Makefile b/Examples/lua/variables/Makefile index d398dffea..4191f7ec3 100644 --- a/Examples/lua/variables/Makefile +++ b/Examples/lua/variables/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile lua_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mylua' INTERFACE='$(INTERFACE)' lua_static clean: - $(MAKE) -f $(TOP)/Makefile lua_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean diff --git a/Examples/modula3/class/Makefile b/Examples/modula3/class/Makefile index af8e099cc..2e2f37526 100644 --- a/Examples/modula3/class/Makefile +++ b/Examples/modula3/class/Makefile @@ -8,10 +8,10 @@ SWIGOPT = -c++ MODULA3SRCS = *.[im]3 check: build - $(MAKE) -f $(TOP)/Makefile modula3_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3 m3ppinplace $(MODULA3SRCS) # compilation of example_wrap.cxx is started by cm3 @@ -21,4 +21,4 @@ build: cm3 clean: - $(MAKE) -f $(TOP)/Makefile modula3_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean diff --git a/Examples/modula3/enum/Makefile b/Examples/modula3/enum/Makefile index a351cb1b9..3915e5405 100644 --- a/Examples/modula3/enum/Makefile +++ b/Examples/modula3/enum/Makefile @@ -8,18 +8,18 @@ SWIGOPT = -c++ MODULA3SRCS = *.[im]3 check: build - $(MAKE) -f $(TOP)/Makefile modula3_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run build: $(SWIG) -modula3 $(SWIGOPT) -module Example -generateconst $(CONSTNUMERIC) $(TARGET).h $(CXX) -Wall $(CONSTNUMERIC).c -o $(CONSTNUMERIC) $(CONSTNUMERIC) >$(CONSTNUMERIC).i - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3 m3ppinplace $(MODULA3SRCS) mv m3makefile $(MODULA3SRCS) src/ cm3 clean: - $(MAKE) -f $(TOP)/Makefile modula3_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean diff --git a/Examples/modula3/exception/Makefile b/Examples/modula3/exception/Makefile index 8d4525512..1dbf1a156 100644 --- a/Examples/modula3/exception/Makefile +++ b/Examples/modula3/exception/Makefile @@ -8,15 +8,15 @@ MODULA3SRCS = *.[im]3 MODULA3FLAGS= -o runme check: build - $(MAKE) -f $(TOP)/Makefile modula3_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3_cpp -# $(MAKE) -f $(TOP)/Makefile MODULA3SRCS='$(MODULA3SRCS)' MODULA3FLAGS='$(MODULA3FLAGS)' modula3_compile +# $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MODULA3SRCS='$(MODULA3SRCS)' MODULA3FLAGS='$(MODULA3FLAGS)' modula3_compile m3ppinplace $(MODULA3SRCS) mv m3makefile $(MODULA3SRCS) src/ cm3 clean: - $(MAKE) -f $(TOP)/Makefile modula3_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean diff --git a/Examples/modula3/reference/Makefile b/Examples/modula3/reference/Makefile index 1a5fdeb30..3b68fe822 100644 --- a/Examples/modula3/reference/Makefile +++ b/Examples/modula3/reference/Makefile @@ -7,14 +7,14 @@ SWIGOPT = -c++ MODULA3SRCS = *.[im]3 check: build - $(MAKE) -f $(TOP)/Makefile modula3_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3 m3ppinplace $(MODULA3SRCS) mv m3makefile $(MODULA3SRCS) src/ cm3 clean: - $(MAKE) -f $(TOP)/Makefile modula3_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean diff --git a/Examples/modula3/simple/Makefile b/Examples/modula3/simple/Makefile index 6287dac20..2796b25f8 100644 --- a/Examples/modula3/simple/Makefile +++ b/Examples/modula3/simple/Makefile @@ -7,14 +7,14 @@ SWIGOPT = MODULA3SRCS = *.[im]3 check: build - $(MAKE) -f $(TOP)/Makefile modula3_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3 m3ppinplace $(MODULA3SRCS) mv m3makefile $(MODULA3SRCS) src/ cm3 clean: - $(MAKE) -f $(TOP)/Makefile modula3_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean diff --git a/Examples/modula3/typemap/Makefile b/Examples/modula3/typemap/Makefile index 6287dac20..2796b25f8 100644 --- a/Examples/modula3/typemap/Makefile +++ b/Examples/modula3/typemap/Makefile @@ -7,14 +7,14 @@ SWIGOPT = MODULA3SRCS = *.[im]3 check: build - $(MAKE) -f $(TOP)/Makefile modula3_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3 m3ppinplace $(MODULA3SRCS) mv m3makefile $(MODULA3SRCS) src/ cm3 clean: - $(MAKE) -f $(TOP)/Makefile modula3_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean diff --git a/Examples/mzscheme/multimap/Makefile b/Examples/mzscheme/multimap/Makefile index f8eeb72c3..ecf83fbeb 100644 --- a/Examples/mzscheme/multimap/Makefile +++ b/Examples/mzscheme/multimap/Makefile @@ -6,10 +6,10 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile mzscheme_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme clean: - $(MAKE) -f $(TOP)/Makefile mzscheme_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean diff --git a/Examples/mzscheme/simple/Makefile b/Examples/mzscheme/simple/Makefile index f8eeb72c3..ecf83fbeb 100644 --- a/Examples/mzscheme/simple/Makefile +++ b/Examples/mzscheme/simple/Makefile @@ -6,10 +6,10 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile mzscheme_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' mzscheme clean: - $(MAKE) -f $(TOP)/Makefile mzscheme_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean diff --git a/Examples/mzscheme/std_vector/Makefile b/Examples/mzscheme/std_vector/Makefile index d2bf0a013..75918a61e 100644 --- a/Examples/mzscheme/std_vector/Makefile +++ b/Examples/mzscheme/std_vector/Makefile @@ -9,7 +9,7 @@ GPP = `which g++` MZC = test -n "/usr/bin/mzc" && /usr/bin/mzc check: build - $(MAKE) -f $(TOP)/Makefile mzscheme_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_run build: $(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACE) @@ -17,4 +17,4 @@ build: $(MZC) --linker $(GPP) --ld $(TARGET).so example_wrap.o clean: - $(MAKE) -f $(TOP)/Makefile mzscheme_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' mzscheme_clean diff --git a/Examples/ocaml/argout_ref/Makefile b/Examples/ocaml/argout_ref/Makefile index 4e12e3769..09893af65 100644 --- a/Examples/ocaml/argout_ref/Makefile +++ b/Examples/ocaml/argout_ref/Makefile @@ -8,21 +8,21 @@ PROGFILE = example_prog.ml OBJS = example.o check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_cpp dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_dynamic_cpp clean: - $(MAKE) -f $(TOP)/Makefile MLFILE='$(MLFILE)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MLFILE='$(MLFILE)' ocaml_clean diff --git a/Examples/ocaml/contract/Makefile b/Examples/ocaml/contract/Makefile index 1db93e38a..df5d6a6f5 100644 --- a/Examples/ocaml/contract/Makefile +++ b/Examples/ocaml/contract/Makefile @@ -8,27 +8,27 @@ PROGFILE = example_prog.ml OBJS = check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_dynamic static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static toplevel: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_toplevel clean: - $(MAKE) -f $(TOP)/Makefile MLFILE='$(MLFILE)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MLFILE='$(MLFILE)' ocaml_clean diff --git a/Examples/ocaml/scoped_enum/Makefile b/Examples/ocaml/scoped_enum/Makefile index e5de57ac2..794733971 100644 --- a/Examples/ocaml/scoped_enum/Makefile +++ b/Examples/ocaml/scoped_enum/Makefile @@ -8,27 +8,27 @@ PROGFILE = example_prog.ml OBJS = check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_dynamic_cpp static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_cpp toplevel: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_cpp_toplevel clean: - $(MAKE) -f $(TOP)/Makefile MLFILE='$(MLFILE)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MLFILE='$(MLFILE)' ocaml_clean diff --git a/Examples/ocaml/shapes/Makefile b/Examples/ocaml/shapes/Makefile index c1ab6507c..69102f3b1 100644 --- a/Examples/ocaml/shapes/Makefile +++ b/Examples/ocaml/shapes/Makefile @@ -9,27 +9,27 @@ PROGFILE = example_prog.ml OBJS = example.o check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static static_top static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ MLFILE='$(MLFILE)' PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_cpp static_top: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ MLFILE='$(MLFILE)' PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_cpp_toplevel dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_dynamic_cpp clean: - $(MAKE) -f $(TOP)/Makefile MLFILE='$(MLFILE)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MLFILE='$(MLFILE)' ocaml_clean diff --git a/Examples/ocaml/simple/Makefile b/Examples/ocaml/simple/Makefile index 64c7256c1..49bf81c1e 100644 --- a/Examples/ocaml/simple/Makefile +++ b/Examples/ocaml/simple/Makefile @@ -8,27 +8,27 @@ PROGFILE = example_prog.ml OBJS = example.o check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_dynamic static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static toplevel: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' \ PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_toplevel clean: - $(MAKE) -f $(TOP)/Makefile MLFILE='$(MLFILE)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MLFILE='$(MLFILE)' ocaml_clean diff --git a/Examples/ocaml/std_string/Makefile b/Examples/ocaml/std_string/Makefile index 89f997090..8f8b2f684 100644 --- a/Examples/ocaml/std_string/Makefile +++ b/Examples/ocaml/std_string/Makefile @@ -6,19 +6,19 @@ INTERFACE = example.i PROGFILE = runme.ml check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_dynamic_cpp clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_clean diff --git a/Examples/ocaml/std_vector/Makefile b/Examples/ocaml/std_vector/Makefile index 89f997090..8f8b2f684 100644 --- a/Examples/ocaml/std_vector/Makefile +++ b/Examples/ocaml/std_vector/Makefile @@ -6,19 +6,19 @@ INTERFACE = example.i PROGFILE = runme.ml check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_dynamic_cpp clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_clean diff --git a/Examples/ocaml/stl/Makefile b/Examples/ocaml/stl/Makefile index a913611fb..e4cce4883 100644 --- a/Examples/ocaml/stl/Makefile +++ b/Examples/ocaml/stl/Makefile @@ -6,29 +6,29 @@ INTERFACE = example.i PROGFILE = runme.ml check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp director: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp_director dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp toplevel: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp_toplevel clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_clean diff --git a/Examples/ocaml/string_from_ptr/Makefile b/Examples/ocaml/string_from_ptr/Makefile index 6d344854a..294bdec83 100644 --- a/Examples/ocaml/string_from_ptr/Makefile +++ b/Examples/ocaml/string_from_ptr/Makefile @@ -9,27 +9,27 @@ PROGFILE = example_prog.ml OBJS = check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static static_top static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ MLFILE='$(MLFILE)' PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_cpp static_top: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ MLFILE='$(MLFILE)' PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_static_cpp_toplevel dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' MLFILE='$(MLFILE)' PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \ ocaml_dynamic_cpp clean: - $(MAKE) -f $(TOP)/Makefile MLFILE='$(MLFILE)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MLFILE='$(MLFILE)' ocaml_clean diff --git a/Examples/ocaml/strings_test/Makefile b/Examples/ocaml/strings_test/Makefile index 49cc544ed..b6b866669 100644 --- a/Examples/ocaml/strings_test/Makefile +++ b/Examples/ocaml/strings_test/Makefile @@ -6,24 +6,24 @@ INTERFACE = example.i PROGFILE = runme.ml check: build - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run build: static top static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp dynamic: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp top: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ ocaml_static_cpp_toplevel clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_clean diff --git a/Examples/octave/callback/Makefile b/Examples/octave/callback/Makefile index d38d7f896..7855d0617 100644 --- a/Examples/octave/callback/Makefile +++ b/Examples/octave/callback/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/class/Makefile b/Examples/octave/class/Makefile index d38d7f896..7855d0617 100644 --- a/Examples/octave/class/Makefile +++ b/Examples/octave/class/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/constants/Makefile b/Examples/octave/constants/Makefile index 03501bd81..eb05d1e7e 100644 --- a/Examples/octave/constants/Makefile +++ b/Examples/octave/constants/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/contract/Makefile b/Examples/octave/contract/Makefile index 73e3962ed..2e0e82124 100644 --- a/Examples/octave/contract/Makefile +++ b/Examples/octave/contract/Makefile @@ -5,11 +5,11 @@ TARGET = swigexample INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/enum/Makefile b/Examples/octave/enum/Makefile index d38d7f896..7855d0617 100644 --- a/Examples/octave/enum/Makefile +++ b/Examples/octave/enum/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/extend/Makefile b/Examples/octave/extend/Makefile index d38d7f896..7855d0617 100644 --- a/Examples/octave/extend/Makefile +++ b/Examples/octave/extend/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/funcptr/Makefile b/Examples/octave/funcptr/Makefile index 73e3962ed..2e0e82124 100644 --- a/Examples/octave/funcptr/Makefile +++ b/Examples/octave/funcptr/Makefile @@ -5,11 +5,11 @@ TARGET = swigexample INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/funcptr2/Makefile b/Examples/octave/funcptr2/Makefile index 73e3962ed..2e0e82124 100644 --- a/Examples/octave/funcptr2/Makefile +++ b/Examples/octave/funcptr2/Makefile @@ -5,11 +5,11 @@ TARGET = swigexample INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/functor/Makefile b/Examples/octave/functor/Makefile index 94fb96337..0fbc7586b 100644 --- a/Examples/octave/functor/Makefile +++ b/Examples/octave/functor/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/module_load/Makefile b/Examples/octave/module_load/Makefile index e388763bd..7b24a8530 100644 --- a/Examples/octave/module_load/Makefile +++ b/Examples/octave/module_load/Makefile @@ -5,14 +5,14 @@ TARGET = swigexample INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' SWIGOPT='-module $$(TARGET)' INTERFACE='$(INTERFACE)' octave - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)2' SWIGOPT='-module $$(TARGET) -globals .' INTERFACE='$(INTERFACE)' octave clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean rm -f $(TARGET).m diff --git a/Examples/octave/operator/Makefile b/Examples/octave/operator/Makefile index 94fb96337..0fbc7586b 100644 --- a/Examples/octave/operator/Makefile +++ b/Examples/octave/operator/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/pointer/Makefile b/Examples/octave/pointer/Makefile index 73e3962ed..2e0e82124 100644 --- a/Examples/octave/pointer/Makefile +++ b/Examples/octave/pointer/Makefile @@ -5,11 +5,11 @@ TARGET = swigexample INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/reference/Makefile b/Examples/octave/reference/Makefile index d38d7f896..7855d0617 100644 --- a/Examples/octave/reference/Makefile +++ b/Examples/octave/reference/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/simple/Makefile b/Examples/octave/simple/Makefile index 73e3962ed..2e0e82124 100644 --- a/Examples/octave/simple/Makefile +++ b/Examples/octave/simple/Makefile @@ -5,11 +5,11 @@ TARGET = swigexample INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/template/Makefile b/Examples/octave/template/Makefile index 94fb96337..0fbc7586b 100644 --- a/Examples/octave/template/Makefile +++ b/Examples/octave/template/Makefile @@ -7,11 +7,11 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/variables/Makefile b/Examples/octave/variables/Makefile index 73e3962ed..2e0e82124 100644 --- a/Examples/octave/variables/Makefile +++ b/Examples/octave/variables/Makefile @@ -5,11 +5,11 @@ TARGET = swigexample INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile octave_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave clean: - $(MAKE) -f $(TOP)/Makefile octave_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/perl5/callback/Makefile b/Examples/perl5/callback/Makefile index 544d13642..0d1cc574f 100644 --- a/Examples/perl5/callback/Makefile +++ b/Examples/perl5/callback/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/class/Makefile b/Examples/perl5/class/Makefile index 544d13642..0d1cc574f 100644 --- a/Examples/perl5/class/Makefile +++ b/Examples/perl5/class/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/constants/Makefile b/Examples/perl5/constants/Makefile index 899282913..b7b411534 100644 --- a/Examples/perl5/constants/Makefile +++ b/Examples/perl5/constants/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/constants2/Makefile b/Examples/perl5/constants2/Makefile index 2ed10d733..85dd13741 100644 --- a/Examples/perl5/constants2/Makefile +++ b/Examples/perl5/constants2/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = -const check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/extend/Makefile b/Examples/perl5/extend/Makefile index 544d13642..0d1cc574f 100644 --- a/Examples/perl5/extend/Makefile +++ b/Examples/perl5/extend/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/funcptr/Makefile b/Examples/perl5/funcptr/Makefile index 366b5897c..3e1de1fc1 100644 --- a/Examples/perl5/funcptr/Makefile +++ b/Examples/perl5/funcptr/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/import/Makefile b/Examples/perl5/import/Makefile index baa8277fd..b31ab7952 100644 --- a/Examples/perl5/import/Makefile +++ b/Examples/perl5/import/Makefile @@ -4,17 +4,17 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='baseclass' INTERFACE='base.i' perl5_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' perl5_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' perl5_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' perl5_cpp clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/inline/Makefile b/Examples/perl5/inline/Makefile index d544a6532..5c98748c1 100644 --- a/Examples/perl5/inline/Makefile +++ b/Examples/perl5/inline/Makefile @@ -1,6 +1,6 @@ run: - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean rm -rf _Inline diff --git a/Examples/perl5/java/Makefile b/Examples/perl5/java/Makefile index 3a0bb215d..5eaea3212 100644 --- a/Examples/perl5/java/Makefile +++ b/Examples/perl5/java/Makefile @@ -6,17 +6,17 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: Example.class Example.h - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ CXXSHARED="gcj -fpic -shared Example.class" PERL5_CCFLAGS='' PERL5_EXP='' LIBS="-lstdc++" perl5_cpp clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean rm -f *.class Example.h -Example.class Example.h: Example.java - gcj -fPIC -C -c -g Example.java +Example.class Example.h: $(SRCDIR)Example.java + gcj -d . -fPIC -C -c -g $(SRCDIR)Example.java gcjh Example.class diff --git a/Examples/perl5/multimap/Makefile b/Examples/perl5/multimap/Makefile index 366b5897c..3e1de1fc1 100644 --- a/Examples/perl5/multimap/Makefile +++ b/Examples/perl5/multimap/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/multiple_inheritance/Makefile b/Examples/perl5/multiple_inheritance/Makefile index 62355a82c..1fe5a51bb 100644 --- a/Examples/perl5/multiple_inheritance/Makefile +++ b/Examples/perl5/multiple_inheritance/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/pointer/Makefile b/Examples/perl5/pointer/Makefile index 366b5897c..3e1de1fc1 100644 --- a/Examples/perl5/pointer/Makefile +++ b/Examples/perl5/pointer/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/reference/Makefile b/Examples/perl5/reference/Makefile index 986fab86a..a22f5a68d 100644 --- a/Examples/perl5/reference/Makefile +++ b/Examples/perl5/reference/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = -noproxy check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' SWIGOPT='$(SWIGOPT)' perl5_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myperl' INTERFACE='$(INTERFACE)' SWIGOPT='$(SWIGOPT)' perl5_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/simple/Makefile b/Examples/perl5/simple/Makefile index 366b5897c..3e1de1fc1 100644 --- a/Examples/perl5/simple/Makefile +++ b/Examples/perl5/simple/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/value/Makefile b/Examples/perl5/value/Makefile index 366b5897c..3e1de1fc1 100644 --- a/Examples/perl5/value/Makefile +++ b/Examples/perl5/value/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/variables/Makefile b/Examples/perl5/variables/Makefile index 366b5897c..3e1de1fc1 100644 --- a/Examples/perl5/variables/Makefile +++ b/Examples/perl5/variables/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5 static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/perl5/xmlstring/Makefile b/Examples/perl5/xmlstring/Makefile index df9dabd11..4f02d3ee4 100644 --- a/Examples/perl5/xmlstring/Makefile +++ b/Examples/perl5/xmlstring/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lxerces-c -lxerces-depdom -lm check: build - $(MAKE) -f $(TOP)/Makefile perl5_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' LIBS=$(LIBS) CXX="g++ -g3" perl5_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile perl5_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' perl5_clean diff --git a/Examples/php/callback/Makefile b/Examples/php/callback/Makefile index 6f7e4ad27..3ad3999a5 100644 --- a/Examples/php/callback/Makefile +++ b/Examples/php/callback/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' php_cpp static: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/class/Makefile b/Examples/php/class/Makefile index cefd81f78..8b2b340e9 100644 --- a/Examples/php/class/Makefile +++ b/Examples/php/class/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/constants/Makefile b/Examples/php/constants/Makefile index 3f24a3921..e5b49571e 100644 --- a/Examples/php/constants/Makefile +++ b/Examples/php/constants/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/cpointer/Makefile b/Examples/php/cpointer/Makefile index 57785acc7..f2c15c5c1 100644 --- a/Examples/php/cpointer/Makefile +++ b/Examples/php/cpointer/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/disown/Makefile b/Examples/php/disown/Makefile index cefd81f78..8b2b340e9 100644 --- a/Examples/php/disown/Makefile +++ b/Examples/php/disown/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/enum/Makefile b/Examples/php/enum/Makefile index 22f979d2f..2028d03c7 100644 --- a/Examples/php/enum/Makefile +++ b/Examples/php/enum/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = -noproxy check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/extend/Makefile b/Examples/php/extend/Makefile index 6f7e4ad27..3ad3999a5 100644 --- a/Examples/php/extend/Makefile +++ b/Examples/php/extend/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' php_cpp static: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/funcptr/Makefile b/Examples/php/funcptr/Makefile index 57785acc7..f2c15c5c1 100644 --- a/Examples/php/funcptr/Makefile +++ b/Examples/php/funcptr/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/overloading/Makefile b/Examples/php/overloading/Makefile index cefd81f78..8b2b340e9 100644 --- a/Examples/php/overloading/Makefile +++ b/Examples/php/overloading/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/pointer/Makefile b/Examples/php/pointer/Makefile index 57785acc7..f2c15c5c1 100644 --- a/Examples/php/pointer/Makefile +++ b/Examples/php/pointer/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/pragmas/Makefile b/Examples/php/pragmas/Makefile index 3f24a3921..e5b49571e 100644 --- a/Examples/php/pragmas/Makefile +++ b/Examples/php/pragmas/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/proxy/Makefile b/Examples/php/proxy/Makefile index cefd81f78..8b2b340e9 100644 --- a/Examples/php/proxy/Makefile +++ b/Examples/php/proxy/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/reference/Makefile b/Examples/php/reference/Makefile index cefd81f78..8b2b340e9 100644 --- a/Examples/php/reference/Makefile +++ b/Examples/php/reference/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/simple/Makefile b/Examples/php/simple/Makefile index 57785acc7..f2c15c5c1 100644 --- a/Examples/php/simple/Makefile +++ b/Examples/php/simple/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/sync/Makefile b/Examples/php/sync/Makefile index cefd81f78..8b2b340e9 100644 --- a/Examples/php/sync/Makefile +++ b/Examples/php/sync/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/value/Makefile b/Examples/php/value/Makefile index 449686784..3db7afec5 100644 --- a/Examples/php/value/Makefile +++ b/Examples/php/value/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = -noproxy check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/php/variables/Makefile b/Examples/php/variables/Makefile index 57785acc7..f2c15c5c1 100644 --- a/Examples/php/variables/Makefile +++ b/Examples/php/variables/Makefile @@ -7,17 +7,17 @@ LIBS = SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile php_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ php static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \ php_static clean: - $(MAKE) -f $(TOP)/Makefile php_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' php_clean diff --git a/Examples/pike/class/Makefile b/Examples/pike/class/Makefile index aadc47151..d8cf4ea7e 100644 --- a/Examples/pike/class/Makefile +++ b/Examples/pike/class/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile pike_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' pike_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypike' INTERFACE='$(INTERFACE)' pike_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile pike_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_clean diff --git a/Examples/pike/constants/Makefile b/Examples/pike/constants/Makefile index c9385ce3b..736d30f03 100644 --- a/Examples/pike/constants/Makefile +++ b/Examples/pike/constants/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile pike_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' pike static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypike' INTERFACE='$(INTERFACE)' pike_static clean: - $(MAKE) -f $(TOP)/Makefile pike_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_clean diff --git a/Examples/pike/enum/Makefile b/Examples/pike/enum/Makefile index aadc47151..d8cf4ea7e 100644 --- a/Examples/pike/enum/Makefile +++ b/Examples/pike/enum/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile pike_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' pike_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypike' INTERFACE='$(INTERFACE)' pike_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile pike_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_clean diff --git a/Examples/pike/overload/Makefile b/Examples/pike/overload/Makefile index 8d799efe1..f111b1137 100644 --- a/Examples/pike/overload/Makefile +++ b/Examples/pike/overload/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lstdc++ -lm check: build - $(MAKE) -f $(TOP)/Makefile pike_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' pike_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypike' INTERFACE='$(INTERFACE)' pike_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile pike_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_clean diff --git a/Examples/pike/simple/Makefile b/Examples/pike/simple/Makefile index f58ed4e65..d7f6b209e 100644 --- a/Examples/pike/simple/Makefile +++ b/Examples/pike/simple/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile pike_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' pike static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypike' INTERFACE='$(INTERFACE)' pike_static clean: - $(MAKE) -f $(TOP)/Makefile pike_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_clean diff --git a/Examples/pike/template/Makefile b/Examples/pike/template/Makefile index e4fc945f7..da115c1d5 100644 --- a/Examples/pike/template/Makefile +++ b/Examples/pike/template/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile pike_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' pike_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypike' INTERFACE='$(INTERFACE)' pike_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile pike_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' pike_clean diff --git a/Examples/python/callback/Makefile b/Examples/python/callback/Makefile index 684995801..a4c4d2a69 100644 --- a/Examples/python/callback/Makefile +++ b/Examples/python/callback/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/class/Makefile b/Examples/python/class/Makefile index e940c1f43..41cded284 100644 --- a/Examples/python/class/Makefile +++ b/Examples/python/class/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/constants/Makefile b/Examples/python/constants/Makefile index 15ffa24c9..8ec6e9cc9 100644 --- a/Examples/python/constants/Makefile +++ b/Examples/python/constants/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/contract/Makefile b/Examples/python/contract/Makefile index 999521ccc..fe1d9325e 100644 --- a/Examples/python/contract/Makefile +++ b/Examples/python/contract/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/docstrings/Makefile b/Examples/python/docstrings/Makefile index 51552f3cf..f471930dd 100644 --- a/Examples/python/docstrings/Makefile +++ b/Examples/python/docstrings/Makefile @@ -7,17 +7,17 @@ LIBS = -lm SWIGOPT = -O check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/enum/Makefile b/Examples/python/enum/Makefile index e940c1f43..41cded284 100644 --- a/Examples/python/enum/Makefile +++ b/Examples/python/enum/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/exception/Makefile b/Examples/python/exception/Makefile index fb200fbaf..ad3d49fe1 100644 --- a/Examples/python/exception/Makefile +++ b/Examples/python/exception/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/exceptproxy/Makefile b/Examples/python/exceptproxy/Makefile index 86a643415..f406dfaf4 100644 --- a/Examples/python/exceptproxy/Makefile +++ b/Examples/python/exceptproxy/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/extend/Makefile b/Examples/python/extend/Makefile index 684995801..a4c4d2a69 100644 --- a/Examples/python/extend/Makefile +++ b/Examples/python/extend/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/funcptr/Makefile b/Examples/python/funcptr/Makefile index df3bc86ff..222916fa1 100644 --- a/Examples/python/funcptr/Makefile +++ b/Examples/python/funcptr/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/funcptr2/Makefile b/Examples/python/funcptr2/Makefile index df3bc86ff..222916fa1 100644 --- a/Examples/python/funcptr2/Makefile +++ b/Examples/python/funcptr2/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/functor/Makefile b/Examples/python/functor/Makefile index dde0d0910..1234c310e 100644 --- a/Examples/python/functor/Makefile +++ b/Examples/python/functor/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/import/Makefile b/Examples/python/import/Makefile index f63e12271..d83dfeaa8 100644 --- a/Examples/python/import/Makefile +++ b/Examples/python/import/Makefile @@ -4,19 +4,19 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' python_cpp clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f foo.py bar.py spam.py base.py diff --git a/Examples/python/import_packages/Makefile b/Examples/python/import_packages/Makefile index fda2380b3..2df2be101 100644 --- a/Examples/python/import_packages/Makefile +++ b/Examples/python/import_packages/Makefile @@ -5,7 +5,7 @@ LIBS = PY3 = import_packages_subdirs = \ - same_modnames1 \ + same_modnames1 \ same_modnames2 \ from_init1 \ from_init2 \ @@ -14,8 +14,13 @@ import_packages_subdirs = \ relativeimport1 check: build + if test "x$(SRCDIR)" != x; then \ + for file in `cd $(SRCDIR) && find . -type f -name __init__.py`; do \ + cp "${SRCDIR}$$file" "$$file" || exit 1; \ + done; \ + fi; \ for s in $(import_packages_subdirs); do \ - (cd $$s && $(MAKE) check); \ + (cd $$s && $(MAKE) check); \ done build: @@ -29,7 +34,7 @@ static: done clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean for s in $(import_packages_subdirs); do \ (cd $$s && $(MAKE) clean); \ done diff --git a/Examples/python/import_packages/from_init1/Makefile b/Examples/python/import_packages/from_init1/Makefile index 8e35c6c61..b9d803a0e 100644 --- a/Examples/python/import_packages/from_init1/Makefile +++ b/Examples/python/import_packages/from_init1/Makefile @@ -11,7 +11,7 @@ else endif check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' build @@ -20,6 +20,6 @@ static: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd py2 && $(MAKE) clean cd py3 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init1/py2/Makefile b/Examples/python/import_packages/from_init1/py2/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/from_init1/py2/Makefile +++ b/Examples/python/import_packages/from_init1/py2/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init1/py2/pkg2/Makefile b/Examples/python/import_packages/from_init1/py2/pkg2/Makefile index 0dd174659..1eb810e05 100644 --- a/Examples/python/import_packages/from_init1/py2/pkg2/Makefile +++ b/Examples/python/import_packages/from_init1/py2/pkg2/Makefile @@ -4,17 +4,17 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp_static clean:: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean diff --git a/Examples/python/import_packages/from_init1/py3/Makefile b/Examples/python/import_packages/from_init1/py3/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/from_init1/py3/Makefile +++ b/Examples/python/import_packages/from_init1/py3/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init1/py3/pkg2/Makefile b/Examples/python/import_packages/from_init1/py3/pkg2/Makefile index 0dd174659..1eb810e05 100644 --- a/Examples/python/import_packages/from_init1/py3/pkg2/Makefile +++ b/Examples/python/import_packages/from_init1/py3/pkg2/Makefile @@ -4,17 +4,17 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp_static clean:: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean diff --git a/Examples/python/import_packages/from_init2/Makefile b/Examples/python/import_packages/from_init2/Makefile index 8e35c6c61..b9d803a0e 100644 --- a/Examples/python/import_packages/from_init2/Makefile +++ b/Examples/python/import_packages/from_init2/Makefile @@ -11,7 +11,7 @@ else endif check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' build @@ -20,6 +20,6 @@ static: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd py2 && $(MAKE) clean cd py3 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init2/py2/Makefile b/Examples/python/import_packages/from_init2/py2/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/from_init2/py2/Makefile +++ b/Examples/python/import_packages/from_init2/py2/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init2/py2/pkg2/Makefile b/Examples/python/import_packages/from_init2/py2/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/from_init2/py2/pkg2/Makefile +++ b/Examples/python/import_packages/from_init2/py2/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init2/py2/pkg2/pkg3/Makefile b/Examples/python/import_packages/from_init2/py2/pkg2/pkg3/Makefile index a417e2745..cb20bd25f 100644 --- a/Examples/python/import_packages/from_init2/py2/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/from_init2/py2/pkg2/pkg3/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/from_init2/py3/Makefile b/Examples/python/import_packages/from_init2/py3/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/from_init2/py3/Makefile +++ b/Examples/python/import_packages/from_init2/py3/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init2/py3/pkg2/Makefile b/Examples/python/import_packages/from_init2/py3/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/from_init2/py3/pkg2/Makefile +++ b/Examples/python/import_packages/from_init2/py3/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init2/py3/pkg2/pkg3/Makefile b/Examples/python/import_packages/from_init2/py3/pkg2/pkg3/Makefile index a417e2745..cb20bd25f 100644 --- a/Examples/python/import_packages/from_init2/py3/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/from_init2/py3/pkg2/pkg3/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/from_init3/Makefile b/Examples/python/import_packages/from_init3/Makefile index 8e35c6c61..b9d803a0e 100644 --- a/Examples/python/import_packages/from_init3/Makefile +++ b/Examples/python/import_packages/from_init3/Makefile @@ -11,7 +11,7 @@ else endif check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' build @@ -20,6 +20,6 @@ static: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd py2 && $(MAKE) clean cd py3 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init3/py2/Makefile b/Examples/python/import_packages/from_init3/py2/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/from_init3/py2/Makefile +++ b/Examples/python/import_packages/from_init3/py2/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init3/py2/pkg2/Makefile b/Examples/python/import_packages/from_init3/py2/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/from_init3/py2/pkg2/Makefile +++ b/Examples/python/import_packages/from_init3/py2/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/Makefile b/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/Makefile index 470f9d561..d6ae1b2bc 100644 --- a/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/Makefile @@ -10,5 +10,5 @@ static: cd pkg4 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg4 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/pkg4/Makefile b/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/pkg4/Makefile index a98d31122..286d90070 100644 --- a/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/pkg4/Makefile +++ b/Examples/python/import_packages/from_init3/py2/pkg2/pkg3/pkg4/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/from_init3/py3/Makefile b/Examples/python/import_packages/from_init3/py3/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/from_init3/py3/Makefile +++ b/Examples/python/import_packages/from_init3/py3/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init3/py3/pkg2/Makefile b/Examples/python/import_packages/from_init3/py3/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/from_init3/py3/pkg2/Makefile +++ b/Examples/python/import_packages/from_init3/py3/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/Makefile b/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/Makefile index 470f9d561..d6ae1b2bc 100644 --- a/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/Makefile @@ -10,5 +10,5 @@ static: cd pkg4 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg4 && $(MAKE) clean diff --git a/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/pkg4/Makefile b/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/pkg4/Makefile index a98d31122..286d90070 100644 --- a/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/pkg4/Makefile +++ b/Examples/python/import_packages/from_init3/py3/pkg2/pkg3/pkg4/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/relativeimport1/Makefile b/Examples/python/import_packages/relativeimport1/Makefile index 8e35c6c61..b9d803a0e 100644 --- a/Examples/python/import_packages/relativeimport1/Makefile +++ b/Examples/python/import_packages/relativeimport1/Makefile @@ -11,7 +11,7 @@ else endif check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' build @@ -20,6 +20,6 @@ static: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd py2 && $(MAKE) clean cd py3 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport1/py2/Makefile b/Examples/python/import_packages/relativeimport1/py2/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/relativeimport1/py2/Makefile +++ b/Examples/python/import_packages/relativeimport1/py2/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport1/py2/pkg2/Makefile b/Examples/python/import_packages/relativeimport1/py2/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/relativeimport1/py2/pkg2/Makefile +++ b/Examples/python/import_packages/relativeimport1/py2/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport1/py2/pkg2/pkg3/Makefile b/Examples/python/import_packages/relativeimport1/py2/pkg2/pkg3/Makefile index a417e2745..cb20bd25f 100644 --- a/Examples/python/import_packages/relativeimport1/py2/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/relativeimport1/py2/pkg2/pkg3/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/relativeimport1/py3/Makefile b/Examples/python/import_packages/relativeimport1/py3/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/relativeimport1/py3/Makefile +++ b/Examples/python/import_packages/relativeimport1/py3/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport1/py3/pkg2/Makefile b/Examples/python/import_packages/relativeimport1/py3/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/relativeimport1/py3/pkg2/Makefile +++ b/Examples/python/import_packages/relativeimport1/py3/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport1/py3/pkg2/pkg3/Makefile b/Examples/python/import_packages/relativeimport1/py3/pkg2/pkg3/Makefile index a417e2745..cb20bd25f 100644 --- a/Examples/python/import_packages/relativeimport1/py3/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/relativeimport1/py3/pkg2/pkg3/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/relativeimport2/Makefile b/Examples/python/import_packages/relativeimport2/Makefile index 8e35c6c61..b9d803a0e 100644 --- a/Examples/python/import_packages/relativeimport2/Makefile +++ b/Examples/python/import_packages/relativeimport2/Makefile @@ -11,7 +11,7 @@ else endif check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' build @@ -20,6 +20,6 @@ static: cd $(PKG1DIR) && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -relativeimport' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd py2 && $(MAKE) clean cd py3 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport2/py2/Makefile b/Examples/python/import_packages/relativeimport2/py2/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/relativeimport2/py2/Makefile +++ b/Examples/python/import_packages/relativeimport2/py2/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport2/py2/pkg2/Makefile b/Examples/python/import_packages/relativeimport2/py2/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/relativeimport2/py2/pkg2/Makefile +++ b/Examples/python/import_packages/relativeimport2/py2/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/Makefile b/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/Makefile index 470f9d561..d6ae1b2bc 100644 --- a/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/Makefile @@ -10,5 +10,5 @@ static: cd pkg4 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg4 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/pkg4/Makefile b/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/pkg4/Makefile index a98d31122..286d90070 100644 --- a/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/pkg4/Makefile +++ b/Examples/python/import_packages/relativeimport2/py2/pkg2/pkg3/pkg4/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/relativeimport2/py3/Makefile b/Examples/python/import_packages/relativeimport2/py3/Makefile index 4c0dfab07..9595397d8 100644 --- a/Examples/python/import_packages/relativeimport2/py3/Makefile +++ b/Examples/python/import_packages/relativeimport2/py3/Makefile @@ -10,5 +10,5 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport2/py3/pkg2/Makefile b/Examples/python/import_packages/relativeimport2/py3/pkg2/Makefile index 3fe56139d..36e099b78 100644 --- a/Examples/python/import_packages/relativeimport2/py3/pkg2/Makefile +++ b/Examples/python/import_packages/relativeimport2/py3/pkg2/Makefile @@ -4,15 +4,15 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp cd pkg3 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='bar' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='bar' python_clean cd pkg3 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/Makefile b/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/Makefile index 470f9d561..d6ae1b2bc 100644 --- a/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/Makefile +++ b/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/Makefile @@ -10,5 +10,5 @@ static: cd pkg4 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg4 && $(MAKE) clean diff --git a/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/pkg4/Makefile b/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/pkg4/Makefile index a98d31122..286d90070 100644 --- a/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/pkg4/Makefile +++ b/Examples/python/import_packages/relativeimport2/py3/pkg2/pkg3/pkg4/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/same_modnames1/Makefile b/Examples/python/import_packages/same_modnames1/Makefile index 9dd5971dc..e05c13017 100644 --- a/Examples/python/import_packages/same_modnames1/Makefile +++ b/Examples/python/import_packages/same_modnames1/Makefile @@ -4,7 +4,7 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: cd pkg1 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build @@ -15,6 +15,6 @@ static: cd pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg1 && $(MAKE) clean cd pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/same_modnames1/pkg1/Makefile b/Examples/python/import_packages/same_modnames1/pkg1/Makefile index 9b51a76ed..df1b30321 100644 --- a/Examples/python/import_packages/same_modnames1/pkg1/Makefile +++ b/Examples/python/import_packages/same_modnames1/pkg1/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/same_modnames1/pkg2/Makefile b/Examples/python/import_packages/same_modnames1/pkg2/Makefile index 9b51a76ed..df1b30321 100644 --- a/Examples/python/import_packages/same_modnames1/pkg2/Makefile +++ b/Examples/python/import_packages/same_modnames1/pkg2/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/same_modnames2/Makefile b/Examples/python/import_packages/same_modnames2/Makefile index cfc327883..770343a80 100644 --- a/Examples/python/import_packages/same_modnames2/Makefile +++ b/Examples/python/import_packages/same_modnames2/Makefile @@ -4,7 +4,7 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: cd pkg1 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' build @@ -15,6 +15,6 @@ static: cd pkg1/pkg2 && $(MAKE) SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' LIBS='$(LIBS)' static clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean cd pkg1 && $(MAKE) clean cd pkg1/pkg2 && $(MAKE) clean diff --git a/Examples/python/import_packages/same_modnames2/pkg1/Makefile b/Examples/python/import_packages/same_modnames2/pkg1/Makefile index 9b51a76ed..df1b30321 100644 --- a/Examples/python/import_packages/same_modnames2/pkg1/Makefile +++ b/Examples/python/import_packages/same_modnames2/pkg1/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_packages/same_modnames2/pkg1/pkg2/Makefile b/Examples/python/import_packages/same_modnames2/pkg1/pkg2/Makefile index 053b911f5..11e8573ad 100644 --- a/Examples/python/import_packages/same_modnames2/pkg1/pkg2/Makefile +++ b/Examples/python/import_packages/same_modnames2/pkg1/pkg2/Makefile @@ -4,12 +4,12 @@ SWIGOPT = LIBS = build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp static: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='foo' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='foo' python_clean diff --git a/Examples/python/import_template/Makefile b/Examples/python/import_template/Makefile index f63e12271..d83dfeaa8 100644 --- a/Examples/python/import_template/Makefile +++ b/Examples/python/import_template/Makefile @@ -4,19 +4,19 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' python_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' python_cpp clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f foo.py bar.py spam.py base.py diff --git a/Examples/python/java/Makefile b/Examples/python/java/Makefile index 2ce219969..4befa38ba 100644 --- a/Examples/python/java/Makefile +++ b/Examples/python/java/Makefile @@ -6,18 +6,18 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: Example.class Example.h - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ CXXSHARED="gcj -fpic -shared Example.class" DEFS='' LIBS="-lstdc++" python_cpp clean: - $(MAKE) -f $(TOP)/Makefile python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean rm -f $(TARGET).py rm -f *.class Example.h -Example.class Example.h: Example.java - gcj -fPIC -C -c -g Example.java +Example.class Example.h: $(SRCDIR)Example.java + gcj -d . -fPIC -C -c -g $(SRCDIR)Example.java gcjh Example.class diff --git a/Examples/python/libffi/Makefile b/Examples/python/libffi/Makefile index ae51b0a60..db5dfe138 100644 --- a/Examples/python/libffi/Makefile +++ b/Examples/python/libffi/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' LIBS='-L/usr/local/lib -lffi' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/multimap/Makefile b/Examples/python/multimap/Makefile index df3bc86ff..222916fa1 100644 --- a/Examples/python/multimap/Makefile +++ b/Examples/python/multimap/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/operator/Makefile b/Examples/python/operator/Makefile index dde0d0910..1234c310e 100644 --- a/Examples/python/operator/Makefile +++ b/Examples/python/operator/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/performance/constructor/Makefile b/Examples/python/performance/constructor/Makefile index 98a50ec29..8e65123cf 100644 --- a/Examples/python/performance/constructor/Makefile +++ b/Examples/python/performance/constructor/Makefile @@ -5,17 +5,17 @@ TARGET = Simple INTERFACE = Simple.i build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ TARGET='$(TARGET)_baseline' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ TARGET='$(TARGET)_optimized' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ TARGET='$(TARGET)_builtin' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f $(TARGET)_*.py diff --git a/Examples/python/performance/func/Makefile b/Examples/python/performance/func/Makefile index 98a50ec29..8e65123cf 100644 --- a/Examples/python/performance/func/Makefile +++ b/Examples/python/performance/func/Makefile @@ -5,17 +5,17 @@ TARGET = Simple INTERFACE = Simple.i build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ TARGET='$(TARGET)_baseline' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ TARGET='$(TARGET)_optimized' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ TARGET='$(TARGET)_builtin' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f $(TARGET)_*.py diff --git a/Examples/python/performance/hierarchy/Makefile b/Examples/python/performance/hierarchy/Makefile index 98a50ec29..8e65123cf 100644 --- a/Examples/python/performance/hierarchy/Makefile +++ b/Examples/python/performance/hierarchy/Makefile @@ -5,17 +5,17 @@ TARGET = Simple INTERFACE = Simple.i build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ TARGET='$(TARGET)_baseline' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ TARGET='$(TARGET)_optimized' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ TARGET='$(TARGET)_builtin' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f $(TARGET)_*.py diff --git a/Examples/python/performance/hierarchy_operator/Makefile b/Examples/python/performance/hierarchy_operator/Makefile index 98a50ec29..8e65123cf 100644 --- a/Examples/python/performance/hierarchy_operator/Makefile +++ b/Examples/python/performance/hierarchy_operator/Makefile @@ -5,17 +5,17 @@ TARGET = Simple INTERFACE = Simple.i build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ TARGET='$(TARGET)_baseline' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ TARGET='$(TARGET)_optimized' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ TARGET='$(TARGET)_builtin' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f $(TARGET)_*.py diff --git a/Examples/python/performance/operator/Makefile b/Examples/python/performance/operator/Makefile index 98a50ec29..8e65123cf 100644 --- a/Examples/python/performance/operator/Makefile +++ b/Examples/python/performance/operator/Makefile @@ -5,17 +5,17 @@ TARGET = Simple INTERFACE = Simple.i build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -module Simple_baseline' \ TARGET='$(TARGET)_baseline' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -O -module Simple_optimized' \ TARGET='$(TARGET)_optimized' INTERFACE='$(INTERFACE)' python_cpp - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG) -builtin -O -module Simple_builtin' \ TARGET='$(TARGET)_builtin' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f $(TARGET)_*.py diff --git a/Examples/python/pointer/Makefile b/Examples/python/pointer/Makefile index df3bc86ff..222916fa1 100644 --- a/Examples/python/pointer/Makefile +++ b/Examples/python/pointer/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/reference/Makefile b/Examples/python/reference/Makefile index e940c1f43..41cded284 100644 --- a/Examples/python/reference/Makefile +++ b/Examples/python/reference/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/simple/Makefile b/Examples/python/simple/Makefile index df3bc86ff..222916fa1 100644 --- a/Examples/python/simple/Makefile +++ b/Examples/python/simple/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/smartptr/Makefile b/Examples/python/smartptr/Makefile index aaba9cbbc..19609353d 100644 --- a/Examples/python/smartptr/Makefile +++ b/Examples/python/smartptr/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/std_map/Makefile b/Examples/python/std_map/Makefile index 86a643415..f406dfaf4 100644 --- a/Examples/python/std_map/Makefile +++ b/Examples/python/std_map/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/std_vector/Makefile b/Examples/python/std_vector/Makefile index 86a643415..f406dfaf4 100644 --- a/Examples/python/std_vector/Makefile +++ b/Examples/python/std_vector/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/swigrun/Makefile b/Examples/python/swigrun/Makefile index c58f39caf..94f7d04e0 100644 --- a/Examples/python/swigrun/Makefile +++ b/Examples/python/swigrun/Makefile @@ -7,17 +7,17 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: $(SWIG) -python -external-runtime - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean rm -f swigpyrun.h diff --git a/Examples/python/template/Makefile b/Examples/python/template/Makefile index 86a643415..f406dfaf4 100644 --- a/Examples/python/template/Makefile +++ b/Examples/python/template/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/varargs/Makefile b/Examples/python/varargs/Makefile index 15ffa24c9..8ec6e9cc9 100644 --- a/Examples/python/varargs/Makefile +++ b/Examples/python/varargs/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/python/variables/Makefile b/Examples/python/variables/Makefile index df3bc86ff..222916fa1 100644 --- a/Examples/python/variables/Makefile +++ b/Examples/python/variables/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='mypython' INTERFACE='$(INTERFACE)' python_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean diff --git a/Examples/r/class/Makefile b/Examples/r/class/Makefile index 8a64f49a9..3e5d6a6ca 100644 --- a/Examples/r/class/Makefile +++ b/Examples/r/class/Makefile @@ -5,11 +5,11 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile r_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' r_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' r_cpp clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' r_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' r_clean diff --git a/Examples/r/simple/Makefile b/Examples/r/simple/Makefile index 8a8e0e1c1..5cc41530c 100644 --- a/Examples/r/simple/Makefile +++ b/Examples/r/simple/Makefile @@ -5,11 +5,11 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile r_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' r_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' r clean: - $(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' r_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' INTERFACE='$(INTERFACE)' r_clean diff --git a/Examples/ruby/class/Makefile b/Examples/ruby/class/Makefile index ef267bc44..516f842d7 100644 --- a/Examples/ruby/class/Makefile +++ b/Examples/ruby/class/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/constants/Makefile b/Examples/ruby/constants/Makefile index 7af9ec89e..561d5fd84 100644 --- a/Examples/ruby/constants/Makefile +++ b/Examples/ruby/constants/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/enum/Makefile b/Examples/ruby/enum/Makefile index ef267bc44..516f842d7 100644 --- a/Examples/ruby/enum/Makefile +++ b/Examples/ruby/enum/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/exception_class/Makefile b/Examples/ruby/exception_class/Makefile index f0ae7e573..6723a2a7c 100644 --- a/Examples/ruby/exception_class/Makefile +++ b/Examples/ruby/exception_class/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/free_function/Makefile b/Examples/ruby/free_function/Makefile index ef267bc44..516f842d7 100644 --- a/Examples/ruby/free_function/Makefile +++ b/Examples/ruby/free_function/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/funcptr/Makefile b/Examples/ruby/funcptr/Makefile index ddbc1ae30..15b39cf0d 100644 --- a/Examples/ruby/funcptr/Makefile +++ b/Examples/ruby/funcptr/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/funcptr2/Makefile b/Examples/ruby/funcptr2/Makefile index ddbc1ae30..15b39cf0d 100644 --- a/Examples/ruby/funcptr2/Makefile +++ b/Examples/ruby/funcptr2/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/functor/Makefile b/Examples/ruby/functor/Makefile index 662baa110..348bd66e3 100644 --- a/Examples/ruby/functor/Makefile +++ b/Examples/ruby/functor/Makefile @@ -5,15 +5,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/hashargs/Makefile b/Examples/ruby/hashargs/Makefile index 3933cf279..59a36c0dd 100644 --- a/Examples/ruby/hashargs/Makefile +++ b/Examples/ruby/hashargs/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/import/Makefile b/Examples/ruby/import/Makefile index cd7719b5c..b5d06bdd7 100644 --- a/Examples/ruby/import/Makefile +++ b/Examples/ruby/import/Makefile @@ -4,17 +4,17 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' ruby_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' ruby_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' ruby_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' ruby_cpp clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/import_template/Makefile b/Examples/ruby/import_template/Makefile index cd7719b5c..b5d06bdd7 100644 --- a/Examples/ruby/import_template/Makefile +++ b/Examples/ruby/import_template/Makefile @@ -4,17 +4,17 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' ruby_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' ruby_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' ruby_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' ruby_cpp clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/java/Makefile b/Examples/ruby/java/Makefile index a71635baa..7d611abd2 100644 --- a/Examples/ruby/java/Makefile +++ b/Examples/ruby/java/Makefile @@ -6,17 +6,17 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: Example.class Example.h - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ CXXSHARED="gcj -fpic -shared Example.class" LIBS="-lstdc++" DEFS='' ruby_cpp clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean rm -f *.class Example.h -Example.class Example.h: Example.java - gcj -fPIC -C -c -g Example.java +Example.class Example.h: $(SRCDIR)Example.java + gcj -d . -fPIC -C -c -g $(SRCDIR)Example.java gcjh Example.class diff --git a/Examples/ruby/mark_function/Makefile b/Examples/ruby/mark_function/Makefile index ef267bc44..516f842d7 100644 --- a/Examples/ruby/mark_function/Makefile +++ b/Examples/ruby/mark_function/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/multimap/Makefile b/Examples/ruby/multimap/Makefile index ddbc1ae30..15b39cf0d 100644 --- a/Examples/ruby/multimap/Makefile +++ b/Examples/ruby/multimap/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/operator/Makefile b/Examples/ruby/operator/Makefile index 5fd4b077b..bdcf52646 100644 --- a/Examples/ruby/operator/Makefile +++ b/Examples/ruby/operator/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/overloading/Makefile b/Examples/ruby/overloading/Makefile index ef267bc44..516f842d7 100644 --- a/Examples/ruby/overloading/Makefile +++ b/Examples/ruby/overloading/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/pointer/Makefile b/Examples/ruby/pointer/Makefile index ddbc1ae30..15b39cf0d 100644 --- a/Examples/ruby/pointer/Makefile +++ b/Examples/ruby/pointer/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/reference/Makefile b/Examples/ruby/reference/Makefile index ef267bc44..516f842d7 100644 --- a/Examples/ruby/reference/Makefile +++ b/Examples/ruby/reference/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/simple/Makefile b/Examples/ruby/simple/Makefile index ddbc1ae30..15b39cf0d 100644 --- a/Examples/ruby/simple/Makefile +++ b/Examples/ruby/simple/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/std_vector/Makefile b/Examples/ruby/std_vector/Makefile index 208a64495..370bd8fb6 100644 --- a/Examples/ruby/std_vector/Makefile +++ b/Examples/ruby/std_vector/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/template/Makefile b/Examples/ruby/template/Makefile index 208a64495..370bd8fb6 100644 --- a/Examples/ruby/template/Makefile +++ b/Examples/ruby/template/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/value/Makefile b/Examples/ruby/value/Makefile index ddbc1ae30..15b39cf0d 100644 --- a/Examples/ruby/value/Makefile +++ b/Examples/ruby/value/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/ruby/variables/Makefile b/Examples/ruby/variables/Makefile index ddbc1ae30..15b39cf0d 100644 --- a/Examples/ruby/variables/Makefile +++ b/Examples/ruby/variables/Makefile @@ -5,15 +5,15 @@ TARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile ruby_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' ruby static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='myruby' INTERFACE='$(INTERFACE)' ruby_static clean: - $(MAKE) -f $(TOP)/Makefile ruby_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' ruby_clean diff --git a/Examples/tcl/class/Makefile b/Examples/tcl/class/Makefile index db6149cb3..aacf30e04 100644 --- a/Examples/tcl/class/Makefile +++ b/Examples/tcl/class/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tcl_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mytclsh' INTERFACE='$(INTERFACE)' tclsh_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/constants/Makefile b/Examples/tcl/constants/Makefile index ed4d89f52..17c8afa3f 100644 --- a/Examples/tcl/constants/Makefile +++ b/Examples/tcl/constants/Makefile @@ -6,15 +6,15 @@ DLTARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/contract/Makefile b/Examples/tcl/contract/Makefile index ca6134e75..01fdc37b3 100644 --- a/Examples/tcl/contract/Makefile +++ b/Examples/tcl/contract/Makefile @@ -7,15 +7,15 @@ INTERFACE = example.i SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/enum/Makefile b/Examples/tcl/enum/Makefile index db6149cb3..aacf30e04 100644 --- a/Examples/tcl/enum/Makefile +++ b/Examples/tcl/enum/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tcl_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mytclsh' INTERFACE='$(INTERFACE)' tclsh_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/funcptr/Makefile b/Examples/tcl/funcptr/Makefile index 919077918..7155bf3c3 100644 --- a/Examples/tcl/funcptr/Makefile +++ b/Examples/tcl/funcptr/Makefile @@ -6,15 +6,15 @@ DLTARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/import/Makefile b/Examples/tcl/import/Makefile index 81cd7c471..6aa48e7a8 100644 --- a/Examples/tcl/import/Makefile +++ b/Examples/tcl/import/Makefile @@ -4,18 +4,18 @@ SWIGOPT = LIBS = check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='base' INTERFACE='base.i' tcl_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='foo' INTERFACE='foo.i' tcl_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='bar' INTERFACE='bar.i' tcl_cpp - $(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \ LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' tcl_cpp clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/java/Makefile b/Examples/tcl/java/Makefile index a3819ab7c..4be3764e2 100644 --- a/Examples/tcl/java/Makefile +++ b/Examples/tcl/java/Makefile @@ -6,17 +6,17 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: Example.class Example.h - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \ TCLCXXSHARED="gcj -fpic -shared Example.class " LIBS="-lstdc++" DEFS='' tcl_cpp clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean rm -f *.class Example.h -Example.class Example.h: Example.java - gcj -fPIC -C -c -g Example.java +Example.class Example.h: $(SRCDIR)Example.java + gcj -d . -fPIC -C -c -g $(SRCDIR)Example.java gcjh Example.class diff --git a/Examples/tcl/multimap/Makefile b/Examples/tcl/multimap/Makefile index 919077918..7155bf3c3 100644 --- a/Examples/tcl/multimap/Makefile +++ b/Examples/tcl/multimap/Makefile @@ -6,15 +6,15 @@ DLTARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/operator/Makefile b/Examples/tcl/operator/Makefile index 6c91c3d21..1c6e1be98 100644 --- a/Examples/tcl/operator/Makefile +++ b/Examples/tcl/operator/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tcl_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mytclsh' INTERFACE='$(INTERFACE)' tclsh_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/pointer/Makefile b/Examples/tcl/pointer/Makefile index 919077918..7155bf3c3 100644 --- a/Examples/tcl/pointer/Makefile +++ b/Examples/tcl/pointer/Makefile @@ -6,15 +6,15 @@ DLTARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/reference/Makefile b/Examples/tcl/reference/Makefile index db6149cb3..aacf30e04 100644 --- a/Examples/tcl/reference/Makefile +++ b/Examples/tcl/reference/Makefile @@ -6,15 +6,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tcl_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='mytclsh' INTERFACE='$(INTERFACE)' tclsh_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/simple/Makefile b/Examples/tcl/simple/Makefile index 919077918..7155bf3c3 100644 --- a/Examples/tcl/simple/Makefile +++ b/Examples/tcl/simple/Makefile @@ -6,15 +6,15 @@ DLTARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/std_vector/Makefile b/Examples/tcl/std_vector/Makefile index a150fc956..f29f933ba 100644 --- a/Examples/tcl/std_vector/Makefile +++ b/Examples/tcl/std_vector/Makefile @@ -7,15 +7,15 @@ INTERFACE = example.i LIBS = -lm check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/value/Makefile b/Examples/tcl/value/Makefile index 919077918..7155bf3c3 100644 --- a/Examples/tcl/value/Makefile +++ b/Examples/tcl/value/Makefile @@ -6,15 +6,15 @@ DLTARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/tcl/variables/Makefile b/Examples/tcl/variables/Makefile index 919077918..7155bf3c3 100644 --- a/Examples/tcl/variables/Makefile +++ b/Examples/tcl/variables/Makefile @@ -6,15 +6,15 @@ DLTARGET = example INTERFACE = example.i check: build - $(MAKE) -f $(TOP)/Makefile tcl_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_run build: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(DLTARGET)' INTERFACE='$(INTERFACE)' tcl static: - $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' tclsh clean: - $(MAKE) -f $(TOP)/Makefile tcl_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' tcl_clean diff --git a/Examples/test-suite/allegrocl/Makefile.in b/Examples/test-suite/allegrocl/Makefile.in index 697c15a45..2803b7012 100644 --- a/Examples/test-suite/allegrocl/Makefile.in +++ b/Examples/test-suite/allegrocl/Makefile.in @@ -5,9 +5,15 @@ LANGUAGE = allegrocl ALLEGROCL = @ALLEGROCLBIN@ SCRIPTSUFFIX = _runme.lisp + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif # these cpp tests generate warnings/errors when compiling diff --git a/Examples/test-suite/cffi/Makefile.in b/Examples/test-suite/cffi/Makefile.in index 473d395fd..a530e2243 100644 --- a/Examples/test-suite/cffi/Makefile.in +++ b/Examples/test-suite/cffi/Makefile.in @@ -5,9 +5,15 @@ LANGUAGE = cffi CFFI = @CFFIBIN@ SCRIPTSUFFIX = _runme.lisp + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/chicken/Makefile.in b/Examples/test-suite/chicken/Makefile.in index 4ee8cb0fa..ac02dad83 100644 --- a/Examples/test-suite/chicken/Makefile.in +++ b/Examples/test-suite/chicken/Makefile.in @@ -6,9 +6,16 @@ LANGUAGE = chicken VARIANT = SCRIPTSUFFIX = _runme.ss PROXYSUFFIX = _runme_proxy.ss + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif + CHICKEN_CSI = @CHICKEN_CSI@ -quiet -batch -no-init SO = @SO@ diff --git a/Examples/test-suite/clisp/Makefile.in b/Examples/test-suite/clisp/Makefile.in index 1fe3c23ac..9db84c561 100644 --- a/Examples/test-suite/clisp/Makefile.in +++ b/Examples/test-suite/clisp/Makefile.in @@ -5,9 +5,15 @@ LANGUAGE = clisp CLISP = @CLISPBIN@ SCRIPTSUFFIX = _runme.lisp + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index bdd1cd471..37d660989 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -69,7 +69,7 @@ INCLUDES = -I$(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE) LIBS = -L. LIBPREFIX = lib ACTION = check -INTERFACEDIR = $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/ +INTERFACEDIR = ../ # Regenerate Makefile if Makefile.in or config.status have changed. ifeq (,$(TEST_SUITE_SUBDIR)) @@ -688,14 +688,14 @@ partialcheck: $(MAKE) check CC=true CXX=true LDSHARED=true CXXSHARED=true RUNTOOL=true COMPILETOOL=true swig_and_compile_cpp = \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS)" \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \ SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \ INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \ TARGET="$(TARGETPREFIX)$*$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$*.i" \ $(LANGUAGE)$(VARIANT)_cpp swig_and_compile_c = \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CSRCS="$(CSRCS)" \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CSRCS="$(CSRCS)" \ SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \ INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \ TARGET="$(TARGETPREFIX)$*$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$*.i" \ @@ -703,7 +703,7 @@ swig_and_compile_c = \ swig_and_compile_multi_cpp = \ for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS)" \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \ SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" LIBS='$(LIBS)' \ INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \ TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$$f.i" \ @@ -711,11 +711,11 @@ swig_and_compile_multi_cpp = \ done swig_and_compile_external = \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" \ SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \ TARGET="$*_wrap_hdr.h" \ $(LANGUAGE)$(VARIANT)_externalhdr; \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS) $*_external.cxx" \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS) $*_external.cxx" \ SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \ INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \ TARGET="$(TARGETPREFIX)$*$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$*.i" \ @@ -724,7 +724,7 @@ swig_and_compile_external = \ swig_and_compile_runtime = \ setup = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \ else \ echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \ diff --git a/Examples/test-suite/csharp/Makefile.in b/Examples/test-suite/csharp/Makefile.in index e54edcc35..a2a0828fd 100644 --- a/Examples/test-suite/csharp/Makefile.in +++ b/Examples/test-suite/csharp/Makefile.in @@ -3,14 +3,21 @@ ####################################################################### LANGUAGE = csharp +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.cs CSHARPCILINTERPRETER = @CSHARPCILINTERPRETER@ CSHARPCILINTERPRETER_FLAGS = @CSHARPCILINTERPRETER_FLAGS@ CSHARPPATHSEPARATOR = "@CSHARPPATHSEPARATOR@" CSHARPCYGPATH_W = @CSHARPCYGPATH_W@ + srcdir = @srcdir@ top_srcdir = ../@top_srcdir@ top_builddir = ../@top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = ../ +else +SRCDIR = ../$(srcdir)/ +endif CPP_TEST_CASES = \ csharp_attributes \ @@ -57,7 +64,7 @@ csharp_swig2_compatibility.cpptest: SWIGOPT += -DSWIG2_CSHARP # Makes a directory for the testcase if it does not exist setup = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \ else \ echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \ @@ -71,10 +78,10 @@ setup = \ # Note C# uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows and SHLIB_PATH on HPUX. # DYLD_FALLBACK_LIBRARY_PATH is cleared for MacOSX. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ $(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile \ CSHARPFLAGS='-nologo -debug+ $(CSHARPFLAGSSPECIAL) -out:$*_runme.exe' \ - CSHARPSRCS='`$(CSHARPCYGPATH_W) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \ + CSHARPSRCS='`$(CSHARPCYGPATH_W) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \ env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" DYLD_FALLBACK_LIBRARY_PATH= $(RUNTOOL) $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) ./$*_runme.exe; \ else \ cd $* && \ diff --git a/Examples/test-suite/d/Makefile.in b/Examples/test-suite/d/Makefile.in index 61c2749dc..0542bbad0 100644 --- a/Examples/test-suite/d/Makefile.in +++ b/Examples/test-suite/d/Makefile.in @@ -3,9 +3,15 @@ ####################################################################### LANGUAGE = d + srcdir = @srcdir@ -top_srcdir = ../@top_srcdir@ -top_builddir = ../@top_builddir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif ifeq (2,$(D_VERSION)) VERSIONSUFFIX = .2 diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in index 843283e7c..c74e9c65b 100644 --- a/Examples/test-suite/errors/Makefile.in +++ b/Examples/test-suite/errors/Makefile.in @@ -22,9 +22,18 @@ TODOS = tr -d '\r' srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif + +# strip source directory from output, so that diffs compare +srcdir_regexp = $(shell echo $(srcdir)/ | sed 's/\./[.]/g') +STRIP_SRCDIR = sed 's|^$(srcdir_regexp)||' # All .i files with prefix 'cpp_' will be treated as C++ input and remaining .i files as C input -ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(wildcard *.i)) +ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i))) CPP_ERROR_TEST_CASES := $(filter cpp_%, $(ALL_ERROR_TEST_CASES)) C_ERROR_TEST_CASES := $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CASES)) @@ -40,13 +49,13 @@ include $(srcdir)/../common.mk # Rules for the different types of tests %.cpptest: echo "$(ACTION)ing errors testcase $*" - -$(SWIG) -c++ -python -Wall -Fstandard $(SWIGOPT) $*.i 2>&1 | $(TODOS) > $*.$(ERROR_EXT) - $(COMPILETOOL) diff -c $*.stderr $*.$(ERROR_EXT) + -$(SWIG) -c++ -python -Wall -Fstandard $(SWIGOPT) $(srcdir)/$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) + $(COMPILETOOL) diff -c $(srcdir)/$*.stderr $*.$(ERROR_EXT) %.ctest: echo "$(ACTION)ing errors testcase $*" - -$(SWIG) -python -Wall -Fstandard $(SWIGOPT) $*.i 2>&1 | $(TODOS) > $*.$(ERROR_EXT) - $(COMPILETOOL) diff -c $*.stderr $*.$(ERROR_EXT) + -$(SWIG) -python -Wall -Fstandard $(SWIGOPT) $(srcdir)/$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) + $(COMPILETOOL) diff -c $(srcdir)/$*.stderr $*.$(ERROR_EXT) %.clean: @exit 0 diff --git a/Examples/test-suite/go/Makefile.in b/Examples/test-suite/go/Makefile.in index 64a84f820..03f6f151e 100644 --- a/Examples/test-suite/go/Makefile.in +++ b/Examples/test-suite/go/Makefile.in @@ -9,6 +9,7 @@ GO1 = @GO1@ GO12 = @GO12@ GO13 = @GO13@ GOC = @GOC@ +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.go GOCOMPILEARG = `if $(GOGCC) ; then echo -c -g; elif $(GO1) ; then echo tool $(GOC:c=g) ; fi` @@ -23,6 +24,11 @@ SO = @SO@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif include $(srcdir)/../common.mk @@ -47,7 +53,7 @@ include $(srcdir)/../common.mk multi_import.multicpptest: $(setup) for f in multi_import_b multi_import_a; do \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS)" \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \ SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" LIBS='$(LIBS)' \ INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \ TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$$f.i" \ @@ -57,8 +63,8 @@ multi_import.multicpptest: # Runs the testcase. run_testcase = \ - if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ + $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ if $(GOGCC) ; then \ $(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.@OBJEXT@ $*_wrap.@OBJEXT@; \ elif $(GO12) || $(GO13); then \ @@ -70,8 +76,8 @@ run_testcase = \ fi run_testcase_cpp = \ - if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ + $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ if $(GOGCC) ; then \ $(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.@OBJEXT@ $*_wrap.@OBJEXT@ -lstdc++; \ elif $(GO12) || $(GO13); then \ @@ -83,8 +89,8 @@ run_testcase_cpp = \ fi run_multi_testcase = \ - if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ - $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \ + $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ if $(GOGCC) ; then \ files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \ $(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ `for f in $$files; do echo $$f.@OBJEXT@ $${f}_wrap.@OBJEXT@; done` -lstdc++; \ diff --git a/Examples/test-suite/guile/Makefile.in b/Examples/test-suite/guile/Makefile.in index 493dde4f5..5ac3de685 100644 --- a/Examples/test-suite/guile/Makefile.in +++ b/Examples/test-suite/guile/Makefile.in @@ -6,10 +6,18 @@ EXTRA_TEST_CASES += guile_ext_test.externaltest LANGUAGE = guile VARIANT = +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.scm + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif + GUILE = @GUILE@ GUILE_RUNTIME= @@ -51,8 +59,8 @@ INCLUDES += -I$(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/guile # Runs the testcase. A testcase is only run if # a file is found which has _runme.scm appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env GUILE_AUTO_COMPILE=0 LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(GUILE) -l $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env GUILE_AUTO_COMPILE=0 LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(GUILE) -l $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean diff --git a/Examples/test-suite/java/Makefile.in b/Examples/test-suite/java/Makefile.in index e4e803d2a..a61452ed2 100644 --- a/Examples/test-suite/java/Makefile.in +++ b/Examples/test-suite/java/Makefile.in @@ -6,10 +6,17 @@ LANGUAGE = java JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAFLAGS = -Xcheck:jni +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.java + srcdir = @srcdir@ top_srcdir = ../@top_srcdir@ top_builddir = ../@top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = ../ +else +SRCDIR = ../$(srcdir)/ +endif C_TEST_CASES = \ java_lib_arrays \ @@ -72,7 +79,7 @@ director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package # Makes a directory for the testcase if it does not exist setup = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \ else \ echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \ @@ -86,8 +93,8 @@ setup = \ # Note Java uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows, SHLIB_PATH on HPUX and DYLD_LIBRARY_PATH on Mac OS X. run_testcase = \ cd $(JAVA_PACKAGE) && $(COMPILETOOL) $(JAVAC) -classpath . `find . -name "*.java"` && cd .. && \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - $(COMPILETOOL) $(JAVAC) -classpath . -d . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + $(COMPILETOOL) $(JAVAC) -classpath . -d . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \ env LD_LIBRARY_PATH="$(JAVA_PACKAGE):$$LD_LIBRARY_PATH" PATH="$(JAVA_PACKAGE):$$PATH" SHLIB_PATH="$(JAVA_PACKAGE):$$SHLIB_PATH" DYLD_LIBRARY_PATH="$(JAVA_PACKAGE):$$DYLD_LIBRARY_PATH" $(RUNTOOL) $(JAVA) $(JAVAFLAGS) -classpath . $*_runme; \ fi diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index 7368ea9a3..6126bde74 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -4,10 +4,18 @@ LANGUAGE = javascript NODEGYP = @NODEGYP@ +NODEJS = @NODEJS@ SCRIPTSUFFIX = _runme.js + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif + SWIG = $(top_builddir)/preinst_swig ifneq (, $(ENGINE)) @@ -47,20 +55,27 @@ ifeq (node,$(JSENGINE)) constant_pointers.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\" enum_thorough.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\" + setup_node = \ + test -d $* || mkdir $*; \ + sed -e 's|$$testcase|$*|g; s|$$cflags|$(GYP_CFLAGS)|g; s|$$srcdir|$(srcdir)|g' \ + $(srcdir)/node_template/binding.gyp.in > $*/binding.gyp; \ + sed -e 's|$$testcase|$*|g;' \ + $(srcdir)/node_template/index.js.in > $*/index.js + # Note: we need to use swig in C parse mode, but make node-gyp believe it is c++ (via file extension) swig_and_compile_c = \ - sh ./setup_test.sh $* $(GYP_CFLAGS); \ - $(SWIG) -javascript $(SWIGOPT) -o $*_wrap.cxx ../$*.i; \ + $(setup_node); \ + $(SWIG) -javascript $(SWIGOPT) -o $*_wrap.cxx $(srcdir)/../$*.i; \ $(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null swig_and_compile_cpp = \ - sh ./setup_test.sh $* $(GYP_CFLAGS); \ - $(SWIG) -c++ -javascript $(SWIGOPT) ../$*.i; \ + $(setup_node); \ + $(SWIG) -c++ -javascript $(SWIGOPT) $(srcdir)/../$*.i; \ $(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null run_testcase = \ if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \ - node $(srcdir)/$*$(SCRIPTSUFFIX); \ + env NODE_PATH=$$PWD:$(srcdir) $(NODEJS) $(srcdir)/$*$(SCRIPTSUFFIX); \ fi @@ -83,7 +98,7 @@ else run_testcase = \ if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \ - $(top_srcdir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \ + $(top_builddir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \ fi %.ctest: diff --git a/Examples/test-suite/javascript/abstract_access_runme.js b/Examples/test-suite/javascript/abstract_access_runme.js index 8f87d2105..f61bb4358 100644 --- a/Examples/test-suite/javascript/abstract_access_runme.js +++ b/Examples/test-suite/javascript/abstract_access_runme.js @@ -1,4 +1,4 @@ -var abstract_access = require("./abstract_access"); +var abstract_access = require("abstract_access"); var d = new abstract_access.D() if (d.do_x() != 1) { diff --git a/Examples/test-suite/javascript/abstract_inherit_runme.js b/Examples/test-suite/javascript/abstract_inherit_runme.js index 3af2eae74..f732e8767 100644 --- a/Examples/test-suite/javascript/abstract_inherit_runme.js +++ b/Examples/test-suite/javascript/abstract_inherit_runme.js @@ -1,4 +1,4 @@ -var abstract_inherit = require("./abstract_inherit"); +var abstract_inherit = require("abstract_inherit"); // Shouldn't be able to instantiate any of these classes // since none of them implements the pure virtual function diff --git a/Examples/test-suite/javascript/abstract_typedef2_runme.js b/Examples/test-suite/javascript/abstract_typedef2_runme.js index c177e49c3..d8a533ab1 100644 --- a/Examples/test-suite/javascript/abstract_typedef2_runme.js +++ b/Examples/test-suite/javascript/abstract_typedef2_runme.js @@ -1,4 +1,4 @@ -var abstract_typedef2 = require("./abstract_typedef2"); +var abstract_typedef2 = require("abstract_typedef2"); var a = new abstract_typedef2.A_UF(); diff --git a/Examples/test-suite/javascript/abstract_typedef_runme.js b/Examples/test-suite/javascript/abstract_typedef_runme.js index abcfc581d..286328fa8 100644 --- a/Examples/test-suite/javascript/abstract_typedef_runme.js +++ b/Examples/test-suite/javascript/abstract_typedef_runme.js @@ -1,4 +1,4 @@ -var abstract_typedef = require("./abstract_typedef"); +var abstract_typedef = require("abstract_typedef"); var e = new abstract_typedef.Engine(); var a = new abstract_typedef.A() diff --git a/Examples/test-suite/javascript/abstract_virtual_runme.js b/Examples/test-suite/javascript/abstract_virtual_runme.js index 9e2814e41..9a9ce9988 100644 --- a/Examples/test-suite/javascript/abstract_virtual_runme.js +++ b/Examples/test-suite/javascript/abstract_virtual_runme.js @@ -1,4 +1,4 @@ -var abstract_virtual = require("./abstract_virtual"); +var abstract_virtual = require("abstract_virtual"); d = new abstract_virtual.D() diff --git a/Examples/test-suite/javascript/array_member_runme.js b/Examples/test-suite/javascript/array_member_runme.js index 8c4ef1da5..3d9bb0e5b 100644 --- a/Examples/test-suite/javascript/array_member_runme.js +++ b/Examples/test-suite/javascript/array_member_runme.js @@ -1,4 +1,4 @@ -var array_member = require("./array_member"); +var array_member = require("array_member"); var f = new array_member.Foo(); f.data = array_member.global_data; diff --git a/Examples/test-suite/javascript/arrays_global_runme.js b/Examples/test-suite/javascript/arrays_global_runme.js index fdb365f83..0cbb28efb 100644 --- a/Examples/test-suite/javascript/arrays_global_runme.js +++ b/Examples/test-suite/javascript/arrays_global_runme.js @@ -1,4 +1,4 @@ -var arrays_global = require("./arrays_global"); +var arrays_global = require("arrays_global"); arrays_global.array_i = arrays_global.array_const_i; diff --git a/Examples/test-suite/javascript/callback_runme.js b/Examples/test-suite/javascript/callback_runme.js index 9b1ef01a3..021888641 100644 --- a/Examples/test-suite/javascript/callback_runme.js +++ b/Examples/test-suite/javascript/callback_runme.js @@ -1,4 +1,4 @@ -var callback = require("./callback"); +var callback = require("callback"); if (callback.foo(2) !== 2) { throw new Error("Failed."); diff --git a/Examples/test-suite/javascript/char_binary_runme.js b/Examples/test-suite/javascript/char_binary_runme.js index 42abe6060..b2aac920c 100644 --- a/Examples/test-suite/javascript/char_binary_runme.js +++ b/Examples/test-suite/javascript/char_binary_runme.js @@ -1,4 +1,4 @@ -var char_binary = require("./char_binary"); +var char_binary = require("char_binary"); var t = new char_binary.Test(); if (t.strlen('hile') != 4) { diff --git a/Examples/test-suite/javascript/char_strings_runme.js b/Examples/test-suite/javascript/char_strings_runme.js index cca50d851..fe17cb982 100644 --- a/Examples/test-suite/javascript/char_strings_runme.js +++ b/Examples/test-suite/javascript/char_strings_runme.js @@ -1,4 +1,4 @@ -var char_strings = require("./char_strings"); +var char_strings = require("char_strings"); var assertIsEqual = function(expected, actual) { if (expected !== actual) { diff --git a/Examples/test-suite/javascript/class_ignore_runme.js b/Examples/test-suite/javascript/class_ignore_runme.js index f0a32a1c4..ffbe021c7 100644 --- a/Examples/test-suite/javascript/class_ignore_runme.js +++ b/Examples/test-suite/javascript/class_ignore_runme.js @@ -1,4 +1,4 @@ -var class_ignore = require("./class_ignore"); +var class_ignore = require("class_ignore"); a = new class_ignore.Bar(); diff --git a/Examples/test-suite/javascript/class_scope_weird_runme.js b/Examples/test-suite/javascript/class_scope_weird_runme.js index ac745d023..73c118d61 100644 --- a/Examples/test-suite/javascript/class_scope_weird_runme.js +++ b/Examples/test-suite/javascript/class_scope_weird_runme.js @@ -1,4 +1,4 @@ -var class_scope_weird = require("./class_scope_weird"); +var class_scope_weird = require("class_scope_weird"); f = new class_scope_weird.Foo(); g = new class_scope_weird.Foo(3); diff --git a/Examples/test-suite/javascript/complextest_runme.js b/Examples/test-suite/javascript/complextest_runme.js index 1fcc97648..b87d6bffa 100644 --- a/Examples/test-suite/javascript/complextest_runme.js +++ b/Examples/test-suite/javascript/complextest_runme.js @@ -1,4 +1,4 @@ -var complextest = require("./complextest"); +var complextest = require("complextest"); a = [-1,2]; diff --git a/Examples/test-suite/javascript/constover_runme.js b/Examples/test-suite/javascript/constover_runme.js index 764d8b328..9b192b5ff 100644 --- a/Examples/test-suite/javascript/constover_runme.js +++ b/Examples/test-suite/javascript/constover_runme.js @@ -1,4 +1,4 @@ -var constover = require("./constover"); +var constover = require("constover"); p = constover.test("test"); if (p != "test") { diff --git a/Examples/test-suite/javascript/constructor_copy_runme.js b/Examples/test-suite/javascript/constructor_copy_runme.js index 39dce52ce..179b9fb40 100644 --- a/Examples/test-suite/javascript/constructor_copy_runme.js +++ b/Examples/test-suite/javascript/constructor_copy_runme.js @@ -1,4 +1,4 @@ -var constructor_copy = require("./constructor_copy"); +var constructor_copy = require("constructor_copy"); f1 = new constructor_copy.Foo1(3); f11 = new constructor_copy.Foo1(f1); diff --git a/Examples/test-suite/javascript/cpp_enum_runme.js b/Examples/test-suite/javascript/cpp_enum_runme.js index 35f7c60ac..8a248c372 100644 --- a/Examples/test-suite/javascript/cpp_enum_runme.js +++ b/Examples/test-suite/javascript/cpp_enum_runme.js @@ -1,4 +1,4 @@ -var cpp_enum = require("./cpp_enum"); +var cpp_enum = require("cpp_enum"); var f = new cpp_enum.Foo() diff --git a/Examples/test-suite/javascript/cpp_namespace_runme.js b/Examples/test-suite/javascript/cpp_namespace_runme.js index 3bdfef3e9..a6ab79964 100644 --- a/Examples/test-suite/javascript/cpp_namespace_runme.js +++ b/Examples/test-suite/javascript/cpp_namespace_runme.js @@ -1,4 +1,4 @@ -var cpp_namespace = require("./cpp_namespace"); +var cpp_namespace = require("cpp_namespace"); var n = cpp_namespace.fact(4); if (n != 24){ diff --git a/Examples/test-suite/javascript/cpp_static_runme.js b/Examples/test-suite/javascript/cpp_static_runme.js index 2579aeafe..c7917e12e 100644 --- a/Examples/test-suite/javascript/cpp_static_runme.js +++ b/Examples/test-suite/javascript/cpp_static_runme.js @@ -1,4 +1,4 @@ -var cpp_static = require("./cpp_static"); +var cpp_static = require("cpp_static"); cpp_static.StaticFunctionTest.static_func(); cpp_static.StaticFunctionTest.static_func_2(1); diff --git a/Examples/test-suite/javascript/director_alternating_runme.js b/Examples/test-suite/javascript/director_alternating_runme.js index a0411eace..cff288d35 100644 --- a/Examples/test-suite/javascript/director_alternating_runme.js +++ b/Examples/test-suite/javascript/director_alternating_runme.js @@ -1,4 +1,4 @@ -var director_alternating = require("./director_alternating"); +var director_alternating = require("director_alternating"); id = director_alternating.getBar().id(); if (id != director_alternating.idFromGetBar()) diff --git a/Examples/test-suite/javascript/disown_runme.js b/Examples/test-suite/javascript/disown_runme.js index a4a6fd880..ea742b51e 100644 --- a/Examples/test-suite/javascript/disown_runme.js +++ b/Examples/test-suite/javascript/disown_runme.js @@ -1,4 +1,4 @@ -var disown = require("./disown"); +var disown = require("disown"); var a = new disown.A(); var tmp = a.thisown; diff --git a/Examples/test-suite/javascript/dynamic_cast_runme.js b/Examples/test-suite/javascript/dynamic_cast_runme.js index 0029cb0f8..32eabcf8b 100644 --- a/Examples/test-suite/javascript/dynamic_cast_runme.js +++ b/Examples/test-suite/javascript/dynamic_cast_runme.js @@ -1,4 +1,4 @@ -var dynamic_cast = require("./dynamic_cast"); +var dynamic_cast = require("dynamic_cast"); var f = new dynamic_cast.Foo(); var b = new dynamic_cast.Bar(); diff --git a/Examples/test-suite/javascript/empty_runme.js b/Examples/test-suite/javascript/empty_runme.js index db06b3902..7894379be 100644 --- a/Examples/test-suite/javascript/empty_runme.js +++ b/Examples/test-suite/javascript/empty_runme.js @@ -1 +1 @@ -var empty = require("./empty"); \ No newline at end of file +var empty = require("empty"); \ No newline at end of file diff --git a/Examples/test-suite/javascript/enum_template_runme.js b/Examples/test-suite/javascript/enum_template_runme.js index 20f8c3482..1e71e5f64 100644 --- a/Examples/test-suite/javascript/enum_template_runme.js +++ b/Examples/test-suite/javascript/enum_template_runme.js @@ -1,4 +1,4 @@ -var enum_template = require("./enum_template"); +var enum_template = require("enum_template"); if (enum_template.MakeETest() != 1) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/infinity_runme.js b/Examples/test-suite/javascript/infinity_runme.js index 7b5182ff6..050c391a7 100644 --- a/Examples/test-suite/javascript/infinity_runme.js +++ b/Examples/test-suite/javascript/infinity_runme.js @@ -1,4 +1,4 @@ -var infinity = require("./infinity"); +var infinity = require("infinity"); var my_infinity = infinity.INFINITY; var ret_val = infinity.use_infinity(my_infinity); diff --git a/Examples/test-suite/javascript/namespace_virtual_method_runme.js b/Examples/test-suite/javascript/namespace_virtual_method_runme.js index 24d3bd487..4f1e05c84 100644 --- a/Examples/test-suite/javascript/namespace_virtual_method_runme.js +++ b/Examples/test-suite/javascript/namespace_virtual_method_runme.js @@ -1,3 +1,3 @@ -var namespace_virtual_method = require("./namespace_virtual_method"); +var namespace_virtual_method = require("namespace_virtual_method"); x = new namespace_virtual_method.Spam(); diff --git a/Examples/test-suite/javascript/node_template/binding.gyp.in b/Examples/test-suite/javascript/node_template/binding.gyp.in index 209774ae0..a82ac2f3e 100644 --- a/Examples/test-suite/javascript/node_template/binding.gyp.in +++ b/Examples/test-suite/javascript/node_template/binding.gyp.in @@ -3,7 +3,7 @@ { "target_name": "$testcase", "sources":[ "../$testcase_wrap.cxx" ], - "include_dirs": ["../.."], + "include_dirs": ["../$srcdir/.."], 'defines': [ 'BUILDING_NODE_EXTENSION=1', ], diff --git a/Examples/test-suite/javascript/nspace_extend_runme.js b/Examples/test-suite/javascript/nspace_extend_runme.js index ab81c19d3..8cabfe945 100644 --- a/Examples/test-suite/javascript/nspace_extend_runme.js +++ b/Examples/test-suite/javascript/nspace_extend_runme.js @@ -1,4 +1,4 @@ -var nspace_extend = require("./nspace_extend"); +var nspace_extend = require("nspace_extend"); // constructors and destructors var color1 = new nspace_extend.Outer.Inner1.Color(); diff --git a/Examples/test-suite/javascript/nspace_runme.js b/Examples/test-suite/javascript/nspace_runme.js index f1afff428..993610dd6 100644 --- a/Examples/test-suite/javascript/nspace_runme.js +++ b/Examples/test-suite/javascript/nspace_runme.js @@ -1,4 +1,4 @@ -var nspace = require("./nspace"); +var nspace = require("nspace"); var color1 = new nspace.Outer.Inner1.Color(); var color = new nspace.Outer.Inner1.Color(color1); diff --git a/Examples/test-suite/javascript/overload_copy_runme.js b/Examples/test-suite/javascript/overload_copy_runme.js index 1039ffda1..e2f610788 100644 --- a/Examples/test-suite/javascript/overload_copy_runme.js +++ b/Examples/test-suite/javascript/overload_copy_runme.js @@ -1,4 +1,4 @@ -var overload_copy = require("./overload_copy"); +var overload_copy = require("overload_copy"); f = new overload_copy.Foo(); g = new overload_copy.Foo(f); diff --git a/Examples/test-suite/javascript/preproc_include_runme.js b/Examples/test-suite/javascript/preproc_include_runme.js index 4b827fbcc..5ec72b842 100644 --- a/Examples/test-suite/javascript/preproc_include_runme.js +++ b/Examples/test-suite/javascript/preproc_include_runme.js @@ -1,4 +1,4 @@ -var preproc_include = require("./preproc_include"); +var preproc_include = require("preproc_include"); if (preproc_include.multiply10(10) != 100) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/preproc_runme.js b/Examples/test-suite/javascript/preproc_runme.js index 669f9d1f0..167ca5ac1 100644 --- a/Examples/test-suite/javascript/preproc_runme.js +++ b/Examples/test-suite/javascript/preproc_runme.js @@ -1,4 +1,4 @@ -var preproc = require("./preproc"); +var preproc = require("preproc"); if (preproc.endif != 1) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/rename1_runme.js b/Examples/test-suite/javascript/rename1_runme.js index 8374e6a89..68ecc11b6 100644 --- a/Examples/test-suite/javascript/rename1_runme.js +++ b/Examples/test-suite/javascript/rename1_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename1"); +var rename = require("rename1"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename2_runme.js b/Examples/test-suite/javascript/rename2_runme.js index bc6a95a59..99f478596 100644 --- a/Examples/test-suite/javascript/rename2_runme.js +++ b/Examples/test-suite/javascript/rename2_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename2"); +var rename = require("rename2"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename3_runme.js b/Examples/test-suite/javascript/rename3_runme.js index 9e57e80ea..237029fbb 100644 --- a/Examples/test-suite/javascript/rename3_runme.js +++ b/Examples/test-suite/javascript/rename3_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename3"); +var rename = require("rename3"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename4_runme.js b/Examples/test-suite/javascript/rename4_runme.js index d651fc7a1..fed50dceb 100644 --- a/Examples/test-suite/javascript/rename4_runme.js +++ b/Examples/test-suite/javascript/rename4_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename4"); +var rename = require("rename4"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename_scope_runme.js b/Examples/test-suite/javascript/rename_scope_runme.js index c0226df69..fea4d2ca9 100644 --- a/Examples/test-suite/javascript/rename_scope_runme.js +++ b/Examples/test-suite/javascript/rename_scope_runme.js @@ -1,4 +1,4 @@ -var rename_scope = require("./rename_scope"); +var rename_scope = require("rename_scope"); var a = new rename_scope.Natural_UP(); var b = new rename_scope.Natural_BP(); diff --git a/Examples/test-suite/javascript/rename_simple_runme.js b/Examples/test-suite/javascript/rename_simple_runme.js index 918dd68a5..21350cd3e 100644 --- a/Examples/test-suite/javascript/rename_simple_runme.js +++ b/Examples/test-suite/javascript/rename_simple_runme.js @@ -1,4 +1,4 @@ -var rename_simple = require("./rename_simple"); +var rename_simple = require("rename_simple"); var NewStruct = rename_simple.NewStruct; var s = new NewStruct(); diff --git a/Examples/test-suite/javascript/ret_by_value_runme.js b/Examples/test-suite/javascript/ret_by_value_runme.js index d9a77a20b..9d0840602 100644 --- a/Examples/test-suite/javascript/ret_by_value_runme.js +++ b/Examples/test-suite/javascript/ret_by_value_runme.js @@ -1,4 +1,4 @@ -var ret_by_value = require("./ret_by_value"); +var ret_by_value = require("ret_by_value"); a = ret_by_value.get_test(); if (a.myInt != 100) diff --git a/Examples/test-suite/javascript/setup_test.sh b/Examples/test-suite/javascript/setup_test.sh deleted file mode 100644 index 913a74c4b..000000000 --- a/Examples/test-suite/javascript/setup_test.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -if [ ! -d $1 ]; then - mkdir $1; -fi -sed -e "s/\$testcase/$1/" -e "s/\$cflags/$2/" < node_template/binding.gyp.in > $1/binding.gyp -sed s/\$testcase/$1/ node_template/index.js.in > $1/index.js diff --git a/Examples/test-suite/javascript/string_simple_runme.js b/Examples/test-suite/javascript/string_simple_runme.js index dbdd4136d..39ae84e9e 100644 --- a/Examples/test-suite/javascript/string_simple_runme.js +++ b/Examples/test-suite/javascript/string_simple_runme.js @@ -1,4 +1,4 @@ -var string_simple = require("./string_simple"); +var string_simple = require("string_simple"); // Test unicode string var str = "olé"; diff --git a/Examples/test-suite/javascript/struct_value_runme.js b/Examples/test-suite/javascript/struct_value_runme.js index d6b26f726..5b171b8fe 100644 --- a/Examples/test-suite/javascript/struct_value_runme.js +++ b/Examples/test-suite/javascript/struct_value_runme.js @@ -1,4 +1,4 @@ -var struct_value = require("./struct_value"); +var struct_value = require("struct_value"); b = new struct_value.Bar(); diff --git a/Examples/test-suite/javascript/template_static_runme.js b/Examples/test-suite/javascript/template_static_runme.js index 477d97249..d6106138a 100644 --- a/Examples/test-suite/javascript/template_static_runme.js +++ b/Examples/test-suite/javascript/template_static_runme.js @@ -1,3 +1,3 @@ -var template_static = require("./template_static"); +var template_static = require("template_static"); template_static.Foo.bar_double(1); diff --git a/Examples/test-suite/javascript/typedef_class_runme.js b/Examples/test-suite/javascript/typedef_class_runme.js index 3e4dc9093..64e0051c3 100644 --- a/Examples/test-suite/javascript/typedef_class_runme.js +++ b/Examples/test-suite/javascript/typedef_class_runme.js @@ -1,4 +1,4 @@ -var typedef_class = require("./typedef_class"); +var typedef_class = require("typedef_class"); a = new typedef_class.RealA(); a.a = 3; diff --git a/Examples/test-suite/javascript/typedef_inherit_runme.js b/Examples/test-suite/javascript/typedef_inherit_runme.js index 4abcc2536..7590e1e6e 100644 --- a/Examples/test-suite/javascript/typedef_inherit_runme.js +++ b/Examples/test-suite/javascript/typedef_inherit_runme.js @@ -1,4 +1,4 @@ -var typedef_inherit = require("./typedef_inherit"); +var typedef_inherit = require("typedef_inherit"); a = new typedef_inherit.Foo(); b = new typedef_inherit.Bar(); diff --git a/Examples/test-suite/javascript/typedef_scope_runme.js b/Examples/test-suite/javascript/typedef_scope_runme.js index 0ac56884c..5c1368ab7 100644 --- a/Examples/test-suite/javascript/typedef_scope_runme.js +++ b/Examples/test-suite/javascript/typedef_scope_runme.js @@ -1,4 +1,4 @@ -var typedef_scope = require("./typedef_scope"); +var typedef_scope = require("typedef_scope"); b = new typedef_scope.Bar(); x = b.test1(42,"hello"); diff --git a/Examples/test-suite/javascript/typemap_arrays_runme.js b/Examples/test-suite/javascript/typemap_arrays_runme.js index cd6827ac9..610ecdd9c 100644 --- a/Examples/test-suite/javascript/typemap_arrays_runme.js +++ b/Examples/test-suite/javascript/typemap_arrays_runme.js @@ -1,4 +1,4 @@ -var typemap_arrays = require("./typemap_arrays"); +var typemap_arrays = require("typemap_arrays"); if (typemap_arrays.sumA(null) != 60) throw "RuntimeError, Sum is wrong"; diff --git a/Examples/test-suite/javascript/typemap_delete_runme.js b/Examples/test-suite/javascript/typemap_delete_runme.js index 4b3174956..1d42ce4da 100644 --- a/Examples/test-suite/javascript/typemap_delete_runme.js +++ b/Examples/test-suite/javascript/typemap_delete_runme.js @@ -1,4 +1,4 @@ -var typemap_delete = require("./typemap_delete"); +var typemap_delete = require("typemap_delete"); r = new typemap_delete.Rect(123); if (r.val != 123) diff --git a/Examples/test-suite/javascript/typemap_namespace_runme.js b/Examples/test-suite/javascript/typemap_namespace_runme.js index 614e0ffeb..2aa358024 100644 --- a/Examples/test-suite/javascript/typemap_namespace_runme.js +++ b/Examples/test-suite/javascript/typemap_namespace_runme.js @@ -1,4 +1,4 @@ -var typemap_namespace = require("./typemap_namespace"); +var typemap_namespace = require("typemap_namespace"); if (typemap_namespace.test1("hello") != "hello") throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/typemap_ns_using_runme.js b/Examples/test-suite/javascript/typemap_ns_using_runme.js index 9115c16ae..7e4019ab2 100644 --- a/Examples/test-suite/javascript/typemap_ns_using_runme.js +++ b/Examples/test-suite/javascript/typemap_ns_using_runme.js @@ -1,4 +1,4 @@ -var typemap_ns_using = require("./typemap_ns_using"); +var typemap_ns_using = require("typemap_ns_using"); if (typemap_ns_using.spam(37) != 37) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/using1_runme.js b/Examples/test-suite/javascript/using1_runme.js index a2e37fcb6..2415156f0 100644 --- a/Examples/test-suite/javascript/using1_runme.js +++ b/Examples/test-suite/javascript/using1_runme.js @@ -1,4 +1,4 @@ -var using1 = require("./using1"); +var using1 = require("using1"); if (using1.spam(37) != 37) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/using2_runme.js b/Examples/test-suite/javascript/using2_runme.js index aa5e9b15f..2ef08faca 100644 --- a/Examples/test-suite/javascript/using2_runme.js +++ b/Examples/test-suite/javascript/using2_runme.js @@ -1,4 +1,4 @@ -var using2 = require("./using2"); +var using2 = require("using2"); if (using2.spam(37) != 37) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/varargs_runme.js b/Examples/test-suite/javascript/varargs_runme.js index 69d761e63..fc6d945c1 100644 --- a/Examples/test-suite/javascript/varargs_runme.js +++ b/Examples/test-suite/javascript/varargs_runme.js @@ -1,4 +1,4 @@ -var varargs = require("./varargs"); +var varargs = require("varargs"); if (varargs.test("Hello") != "Hello") { throw new Error("Failed"); diff --git a/Examples/test-suite/lua/Makefile.in b/Examples/test-suite/lua/Makefile.in index 0950c9d91..b35cc15ad 100644 --- a/Examples/test-suite/lua/Makefile.in +++ b/Examples/test-suite/lua/Makefile.in @@ -4,10 +4,17 @@ LANGUAGE = lua LUA = @LUABIN@ +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.lua + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif # sorry, currently very few test cases work/have been written @@ -46,8 +53,8 @@ lua_no_module_global.%: SWIGOPT += -nomoduleglobal # Runs the testcase. A testcase is only run if # a file is found which has _runme.lua appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LUA_PATH="$(srcdir)/?.lua;" $(RUNTOOL) $(LUA) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LUA_PATH="$(srcdir)/?.lua;" $(RUNTOOL) $(LUA) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean: (does nothing, we dont generate extra lua code) diff --git a/Examples/test-suite/mzscheme/Makefile.in b/Examples/test-suite/mzscheme/Makefile.in index 67b8bddf2..39fb1acbc 100644 --- a/Examples/test-suite/mzscheme/Makefile.in +++ b/Examples/test-suite/mzscheme/Makefile.in @@ -5,9 +5,15 @@ LANGUAGE = mzscheme MZSCHEME = mzscheme SCRIPTSUFFIX = _runme.scm + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/ocaml/Makefile.in b/Examples/test-suite/ocaml/Makefile.in index 63edec26a..5081e203e 100644 --- a/Examples/test-suite/ocaml/Makefile.in +++ b/Examples/test-suite/ocaml/Makefile.in @@ -6,9 +6,15 @@ LANGUAGE = ocaml OCAMLC = ocamlc VARIANT = _static SCRIPTSUFFIX = _runme.ml + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif C_TEST_CASES = diff --git a/Examples/test-suite/octave/Makefile.in b/Examples/test-suite/octave/Makefile.in index e48d36a64..11cb7c076 100644 --- a/Examples/test-suite/octave/Makefile.in +++ b/Examples/test-suite/octave/Makefile.in @@ -4,10 +4,17 @@ LANGUAGE = octave OCTAVE = @OCTAVE@ +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.m + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif CPP_TEST_CASES += \ li_std_pair_extra \ @@ -33,7 +40,7 @@ include $(srcdir)/../common.mk # Overridden variables here LIBS = -L. -CSRCS = $(srcdir)/octave_empty.c +CSRCS = octave_empty.c # Custom tests - tests with additional commandline options # none! @@ -57,8 +64,8 @@ CSRCS = $(srcdir)/octave_empty.c # Runs the testcase. A testcase is only run if # a file is found which has _runme.m appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH OCTAVE_PATH=$(srcdir):$$OCTAVE_PATH $(RUNTOOL) $(OCTAVE) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH OCTAVE_PATH=$(srcdir):$$OCTAVE_PATH $(RUNTOOL) $(OCTAVE) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean: remove the generated .m file diff --git a/Examples/test-suite/perl5/Makefile.in b/Examples/test-suite/perl5/Makefile.in index 68f32a54a..6778f714e 100644 --- a/Examples/test-suite/perl5/Makefile.in +++ b/Examples/test-suite/perl5/Makefile.in @@ -4,11 +4,18 @@ LANGUAGE = perl5 PERL = @PERL@ +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.pl -TEST_RUNNER = run-perl-test.pl +TEST_RUNNER = $(srcdir)/run-perl-test.pl + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif CPP_TEST_CASES += \ primitive_types \ @@ -49,8 +56,8 @@ include $(srcdir)/../common.mk # Runs the testcase. A testcase is only run if # a file is found which has _runme.pl appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PERL) $(TEST_RUNNER) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PERL) $(TEST_RUNNER) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean: remove the generated .pm file diff --git a/Examples/test-suite/php/Makefile.in b/Examples/test-suite/php/Makefile.in index 735a3137e..b6e4fff1a 100644 --- a/Examples/test-suite/php/Makefile.in +++ b/Examples/test-suite/php/Makefile.in @@ -3,10 +3,17 @@ ####################################################################### LANGUAGE = php +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.php + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif CPP_TEST_CASES += \ php_namewarn_rename \ @@ -56,10 +63,10 @@ missingtests: missingcpptests missingctests # Runs the testcase. Tries to run testcase_runme.php, and if that's not # found, runs testcase.php, except for multicpptests. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL="$(RUNTOOL)" php_run; \ - elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*.php -a ! -f $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list ]; then \ - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*.php RUNTOOL="$(RUNTOOL)" php_run; \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL="$(RUNTOOL)" php_run; \ + elif [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*.php -a ! -f $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list ]; then \ + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(SCRIPTDIR)/$(SCRIPTPREFIX)$*.php RUNTOOL="$(RUNTOOL)" php_run; \ fi # Clean: remove the generated .php file diff --git a/Examples/test-suite/pike/Makefile.in b/Examples/test-suite/pike/Makefile.in index c1ebb747b..36a34352a 100644 --- a/Examples/test-suite/pike/Makefile.in +++ b/Examples/test-suite/pike/Makefile.in @@ -5,9 +5,15 @@ LANGUAGE = pike PIKE = pike SCRIPTSUFFIX = _runme.pike + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 389aed9ea..719e7d1a4 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -21,9 +21,16 @@ else SCRIPTSUFFIX = $(PY3SCRIPTSUFFIX) endif +SCRIPTDIR = . + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif PY2TO3 = 2to3 -x import @@ -128,39 +135,43 @@ VALGRIND_OPT += --suppressions=pythonswig.supp $(run_testcase) -# Call 2to3 to generate Python 3.x test from the Python 2.x's *_runme.py file -%$(PY3SCRIPTSUFFIX): %$(PY2SCRIPTSUFFIX) - cp $< $@ - $(PY2TO3) -w $@ >/dev/null 2>&1 - - # Runs the testcase. A testcase is only run if # a file is found which has _runme.py (or _runme3.py for Python 3) appended after the testcase name. -run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) +py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) +py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX) +py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX) -py2_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX) -py3_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX) +run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(py_runme) run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(py_runme) ]; then \ $(run_python);\ fi -ifeq (,$(PY3)) +# No copying/conversion needed for in-source-tree Python 2 scripts +ifeq ($(SCRIPTDIR)|$(SCRIPTSUFFIX),$(srcdir)|$(PY2SCRIPTSUFFIX)) convert_testcase = else + convert_testcase = \ - if [ -f $(py2_runme) ]; then \ - $(MAKE) -f $(srcdir)/Makefile $(py3_runme); \ + if [ -f $(srcdir)/$(py2_runme) ]; then \ + $(MAKE) $(SCRIPTDIR)/$(py_runme); \ fi + +$(SCRIPTDIR)/$(SCRIPTPREFIX)%$(SCRIPTSUFFIX): $(srcdir)/$(SCRIPTPREFIX)%$(PY2SCRIPTSUFFIX) + test x$< = x$@ || cp $< $@ || exit 1 + test x$(PY3) = x || $(PY2TO3) -w $@ >/dev/null 2>&1 || exit 1 + endif # Clean: remove the generated .py file +# We only remove the _runme3.py if it is generated by 2to3 from a _runme.py. %.clean: - @rm -f $*.py; - @#We only remove the _runme3.py if it is generated by 2to3 from a _runme.py. - @if [ -f $(py2_runme) ]; then rm -f $(py3_runme) $(py3_runme).bak; fi + @rm -f $*.py + @if [ -f $(srcdir)/$(py2_runme) ]; then \ + rm -f $(SCRIPTDIR)/$(py3_runme) $(SCRIPTDIR)/$(py3_runme).bak; \ + fi clean: $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile python_clean diff --git a/Examples/test-suite/r/Makefile.in b/Examples/test-suite/r/Makefile.in index 32d9b85da..9f0de1c5f 100644 --- a/Examples/test-suite/r/Makefile.in +++ b/Examples/test-suite/r/Makefile.in @@ -6,9 +6,15 @@ LANGUAGE = r SCRIPTSUFFIX = _runme.R WRAPSUFFIX = .R RUNR = R CMD BATCH --no-save --no-restore + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif C_TEST_CASES += \ r_copy_struct \ diff --git a/Examples/test-suite/ruby/Makefile.in b/Examples/test-suite/ruby/Makefile.in index 40985e532..d0c65929a 100644 --- a/Examples/test-suite/ruby/Makefile.in +++ b/Examples/test-suite/ruby/Makefile.in @@ -4,10 +4,17 @@ LANGUAGE = ruby RUBY = @RUBY@ +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.rb + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif CPP_TEST_CASES = \ kwargs_feature \ @@ -60,8 +67,8 @@ ruby_naming.cpptest: SWIGOPT += -autorename # Runs the testcase. A testcase is only run if # a file is found which has _runme.rb appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(RUBY) -I$(srcdir):. $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(RUBY) -I$(srcdir):. $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean diff --git a/Examples/test-suite/tcl/Makefile.in b/Examples/test-suite/tcl/Makefile.in index 6ab293fb9..f8a196e26 100644 --- a/Examples/test-suite/tcl/Makefile.in +++ b/Examples/test-suite/tcl/Makefile.in @@ -4,10 +4,17 @@ LANGUAGE = tcl TCLSH = tclsh +SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.tcl + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif CPP_TEST_CASES += \ primitive_types \ @@ -45,8 +52,8 @@ include $(srcdir)/../common.mk # Runs the testcase. A testcase is only run if # a file is found which has _runme.tcl appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(TCLSH) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(TCLSH) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean diff --git a/Examples/test-suite/uffi/Makefile.in b/Examples/test-suite/uffi/Makefile.in index 5fd000a96..9f3546da6 100644 --- a/Examples/test-suite/uffi/Makefile.in +++ b/Examples/test-suite/uffi/Makefile.in @@ -5,9 +5,15 @@ LANGUAGE = uffi UFFI = @UFFIBIN@ SCRIPTSUFFIX = _runme.lisp + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ +ifeq (.,$(srcdir)) +SRCDIR = +else +SRCDIR = $(srcdir)/ +endif include $(srcdir)/../common.mk diff --git a/Makefile.in b/Makefile.in index 53ac47de5..8c6072b41 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,7 +100,7 @@ skip-errors = test -n "" ACTION = check NOSKIP = -chk-set-swiglib = SWIG_LIB=@ROOT_DIR@/Lib +chk-set-swiglib = SWIG_LIB=@ROOT_DIR@/$(srcdir)/Lib chk-set-swig = SWIG=@ROOT_DIR@/$(TARGET) chk-set-env = $(chk-set-swiglib) $(chk-set-swig) @@ -443,7 +443,7 @@ maintainer-clean: @echo maintainer-cleaning CCache @test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) $(FLAGS) maintainer-clean) @echo maintainer-cleaning docs - @cd $(DOCS) && $(MAKE) $(FLAGS) maintainer-clean + @test -d $(DOCS) || exit 0; cd $(DOCS) && $(MAKE) $(FLAGS) maintainer-clean @echo maintainer-cleaning Lib files @rm -f $(srcdir)/Lib/swigwarn.swg @echo distcleaning diff --git a/Tools/javascript/Makefile.in b/Tools/javascript/Makefile.in index 6fbca2384..d5c4711a0 100644 --- a/Tools/javascript/Makefile.in +++ b/Tools/javascript/Makefile.in @@ -53,7 +53,7 @@ JS_INTERPRETER_SRC = javascript.cxx js_shell.cxx $(JS_INTERPRETER_SRC_JSC) $(JS_ JS_INTERPRETER_OBJS = $(JS_INTERPRETER_SRC:.cxx=.o) -%.o: %.cxx +%.o: $(srcdir)/%.cxx $(JSCXX) $(JS_INTERPRETER_DEFINES) $(CXXFLAGS) $(JSINCLUDES) -o $@ -c $< javascript: $(JS_INTERPRETER_OBJS) diff --git a/configure.ac b/configure.ac index eeabd11b4..949986341 100644 --- a/configure.ac +++ b/configure.ac @@ -2677,6 +2677,41 @@ AC_CONFIG_FILES([ AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig]) AC_CONFIG_FILES([CCache/ccache_swig_config.h]) +#-------------------------------------------------------------------- +# Building Examples/ out of source directory +#-------------------------------------------------------------------- + +# If building out of source tree, replicate Examples/ source tree in +# build directory, and copy over Makefiles from source directory. +# Prefix each Makefile with a header which sets SRCDIR to the relative +# source directory, and provides a rule for updating the Makefile from +# its original source. +AC_CONFIG_COMMANDS([Examples],[ + if test "x${srcdir}" != "x." ; then + AC_MSG_NOTICE([generating Examples build tree]) + for mkfile in `cd ${srcdir} && find Examples/ -type f -name Makefile`; do + dir=`dirname ${mkfile}` + d=${dir} + reldir=""; + while test "x$d" != "x." ; do + d=`dirname $d` + reldir="${reldir}../" + done + relsrcdir=${reldir}${srcdir}/ + AS_MKDIR_P([${dir}]) + cat <${mkfile} +# DO NOT EDIT: instead edit ${relsrcdir}${mkfile} +# and run (cd ${reldir} && ./config.status) to regenerate +SRCDIR = ${relsrcdir}${dir}/ + +EOF + cat ${srcdir}/${mkfile} >>${mkfile} + done + fi +]) + +#-------------------------------------------------------------------- + AC_OUTPUT langs="" From 9b0e484b8a786b043a6d8f39bd0b18ff2dd91823 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 12 May 2014 07:51:55 +0100 Subject: [PATCH 014/152] Tests for C nested classes symbol table not being in global space Tests for 55bda53145d2898bd4642926b25209c12738e558 --- Examples/test-suite/common.mk | 1 + .../java/nested_extend_c_runme.java | 38 ++++++++++ Examples/test-suite/nested_extend_c.i | 74 +++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 Examples/test-suite/java/nested_extend_c_runme.java create mode 100644 Examples/test-suite/nested_extend_c.i diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 2a4591524..4b10527db 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -602,6 +602,7 @@ C_TEST_CASES += \ memberin_extend_c \ name \ nested \ + nested_extend_c \ nested_structs \ newobject2 \ overload_extend \ diff --git a/Examples/test-suite/java/nested_extend_c_runme.java b/Examples/test-suite/java/nested_extend_c_runme.java new file mode 100644 index 000000000..9da093a09 --- /dev/null +++ b/Examples/test-suite/java/nested_extend_c_runme.java @@ -0,0 +1,38 @@ +import nested_extend_c.*; + +public class nested_extend_c_runme { + + static { + try { + System.loadLibrary("nested_extend_c"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); + System.exit(1); + } + } + + public static void main(String argv[]) throws Throwable + { + { + hiA hi = new hiA(); + if (hi.hi_extend() != 'h') + throw new RuntimeException("test failed"); + } + { + lowA low = new lowA(); + if (low.low_extend() != 99) + throw new RuntimeException("test failed"); + } + + { + hiB hi = new hiB(); + if (hi.hi_extend() != 'h') + throw new RuntimeException("test failed"); + } + { + lowB low = new lowB(); + if (low.low_extend() != 99) + throw new RuntimeException("test failed"); + } + } +} diff --git a/Examples/test-suite/nested_extend_c.i b/Examples/test-suite/nested_extend_c.i new file mode 100644 index 000000000..3641cf78f --- /dev/null +++ b/Examples/test-suite/nested_extend_c.i @@ -0,0 +1,74 @@ +%module nested_extend_c + +%extend hiA { + hiA() { + union hiA *self = (union hiA *)malloc(sizeof(union hiA)); + self->c = 'h'; + return self; + } + char hi_extend() { + return $self->c; + } +} +%extend lowA { + lowA() { + struct lowA *self = (struct lowA *)malloc(sizeof(struct lowA)); + self->name = 0; + self->num = 99; + return self; + } + int low_extend() { + return $self->num; + } +} + +%extend hiB { + hiB() { + union hiB *self = (union hiB *)malloc(sizeof(union hiB)); + self->c = 'h'; + return self; + } + char hi_extend() { + return $self->c; + } +} +%extend lowB { + lowB() { + struct lowB *self = (struct lowB *)malloc(sizeof(struct lowB)); + self->name = 0; + self->num = 99; + return self; + } + int low_extend() { + return $self->num; + } +} + +%inline %{ +typedef struct NestedA { + int a; + union hiA { + char c; + int d; + } hiA_instance; + + struct lowA { + char *name; + int num; + } lowA_instance; +} NestedA; + +typedef struct { + int a; + union hiB { + char c; + int d; + } hiB_instance; + + struct lowB { + char *name; + int num; + } lowB_instance; +} NestedB; +%} + From caaf224b5960202034884a1a00a9c3d2c3881c08 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 12 May 2014 19:07:55 +0100 Subject: [PATCH 015/152] Turn off %extend nested test for cplusplusout languages --- Examples/test-suite/nested_extend_c.i | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Examples/test-suite/nested_extend_c.i b/Examples/test-suite/nested_extend_c.i index 3641cf78f..83d8c0601 100644 --- a/Examples/test-suite/nested_extend_c.i +++ b/Examples/test-suite/nested_extend_c.i @@ -1,5 +1,6 @@ %module nested_extend_c +#if !defined(SWIGOCTAVE) && !defined(SWIG_JAVASCRIPT_V8) %extend hiA { hiA() { union hiA *self = (union hiA *)malloc(sizeof(union hiA)); @@ -43,6 +44,7 @@ return $self->num; } } +#endif %inline %{ typedef struct NestedA { From 2aa540b9c0dee27e42e7eb6db2cb3e9ea24ca2ba Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Wed, 14 May 2014 00:51:36 +0400 Subject: [PATCH 016/152] %extend for nested unnamed C structs --- Source/CParse/parser.y | 9 ++++----- Source/Modules/main.cxx | 2 ++ Source/Modules/nested.cxx | 10 ++++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 26af7be2d..a1a62cb62 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -41,7 +41,7 @@ int yyparse(); static Node *top = 0; /* Top of the generated parse tree */ static int unnamed = 0; /* Unnamed datatype counter */ -static Hash *extendhash = 0; /* Hash table of added methods */ +Hash *extendhash = 0; /* Hash table of added methods */ static Hash *classes = 0; /* Hash table of classes */ static Hash *classes_typedefs = 0; /* Hash table of typedef classes: typedef struct X {...} Y; */ static Symtab *prev_symtab = 0; @@ -655,7 +655,7 @@ static void add_symbols_copy(Node *n) { actually needs to take precedence. Therefore, we will selectively nuke symbols from the current symbol table, replacing them with the added methods */ -static void merge_extensions(Node *cls, Node *am) { +void merge_extensions(Node *cls, Node *am) { Node *n; Node *csym; @@ -708,7 +708,7 @@ static void merge_extensions(Node *cls, Node *am) { } } -static void append_previous_extension(Node *cls, Node *am) { +void append_previous_extension(Node *cls, Node *am) { Node *n, *ne; Node *pe = 0; Node *ae = 0; @@ -737,7 +737,7 @@ static void append_previous_extension(Node *cls, Node *am) { /* Check for unused %extend. Special case, don't report unused extensions for templates */ -static void check_extensions() { +void check_extensions() { Iterator ki; if (!extendhash) return; @@ -1579,7 +1579,6 @@ program : interface { Setattr(module_node,"name",ModuleName); } Setattr($1,"module",module_node); - check_extensions(); top = $1; } | PARSETYPE parm SEMI { diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 833394b9c..d8f20c207 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -198,6 +198,7 @@ static String *external_runtime_name = 0; enum { STAGE1=1, STAGE2=2, STAGE3=4, STAGE4=8, STAGEOVERFLOW=16 }; static List *libfiles = 0; static List *all_output_files = 0; +extern "C" void check_extensions(); /* ----------------------------------------------------------------------------- * check_extension() @@ -1172,6 +1173,7 @@ int SWIG_main(int argc, char *argv[], Language *l) { Printf(stdout, "Processing unnamed structs...\n"); Swig_nested_name_unnamed_c_structs(top); } + check_extensions(); if (Verbose) { Printf(stdout, "Processing types...\n"); diff --git a/Source/Modules/nested.cxx b/Source/Modules/nested.cxx index 3b45e9f90..169263c3f 100644 --- a/Source/Modules/nested.cxx +++ b/Source/Modules/nested.cxx @@ -338,7 +338,9 @@ static void insertNodeAfter(Node *n, Node *c) { set_nextSibling(n, c); set_previousSibling(c, n); } - +extern "C" Hash *extendhash; +extern "C" void merge_extensions(Node *cls, Node *am); +extern "C" void append_previous_extension(Node *cls, Node *am); void Swig_nested_name_unnamed_c_structs(Node *n) { if (!classhash) classhash = Getattr(n, "classes"); @@ -377,15 +379,15 @@ void Swig_nested_name_unnamed_c_structs(Node *n) { } Delete(ty); // Check for extensions -/* // TODO: we can save extensions hash like class hash and move check_extensions() after nesting processing + // TODO: we can save extensions hash like class hash and move check_extensions() after nesting processing if (extendhash) { if (Node *am = Getattr(extendhash, name)) { // Merge the extension into the symbol table merge_extensions(c, am); append_previous_extension(c, am); - Delattr(extendhash, clsname); + Delattr(extendhash, name); } - }*/ + } Swig_symbol_setscope(Swig_symbol_global_scope()); add_symbols_c(c); From 5d78f14b1c2a580ad08326de4900f51245560dd7 Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Wed, 14 May 2014 00:56:39 +0400 Subject: [PATCH 017/152] test added for nested unnamed C struct %extend --- Examples/test-suite/nested_extend_c.i | 15 +++++++++++++++ Source/Modules/nested.cxx | 2 -- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/nested_extend_c.i b/Examples/test-suite/nested_extend_c.i index 83d8c0601..702c839b2 100644 --- a/Examples/test-suite/nested_extend_c.i +++ b/Examples/test-suite/nested_extend_c.i @@ -44,6 +44,13 @@ return $self->num; } } + +%extend FOO_bar { + void bar_extend() { + $self->d = 1; + } +}; + #endif %inline %{ @@ -72,5 +79,13 @@ typedef struct { int num; } lowB_instance; } NestedB; + +typedef struct { + int a; + union { + char c; + int d; + } bar; +} FOO; %} diff --git a/Source/Modules/nested.cxx b/Source/Modules/nested.cxx index 169263c3f..510270681 100644 --- a/Source/Modules/nested.cxx +++ b/Source/Modules/nested.cxx @@ -378,8 +378,6 @@ void Swig_nested_name_unnamed_c_structs(Node *n) { decl = nextSibling(decl); } Delete(ty); - // Check for extensions - // TODO: we can save extensions hash like class hash and move check_extensions() after nesting processing if (extendhash) { if (Node *am = Getattr(extendhash, name)) { // Merge the extension into the symbol table From 3692e175bc980d1e1a06729465ff932e3bcc8e08 Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Thu, 15 May 2014 03:13:25 +0400 Subject: [PATCH 018/152] global unnamed structures ignored --- Examples/test-suite/nested_extend_c.i | 4 ++++ Source/Modules/nested.cxx | 7 ++++++- Source/Modules/typepass.cxx | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Examples/test-suite/nested_extend_c.i b/Examples/test-suite/nested_extend_c.i index 702c839b2..0e1495f86 100644 --- a/Examples/test-suite/nested_extend_c.i +++ b/Examples/test-suite/nested_extend_c.i @@ -87,5 +87,9 @@ typedef struct { int d; } bar; } FOO; + +struct { + int i; +} THING; %} diff --git a/Source/Modules/nested.cxx b/Source/Modules/nested.cxx index 510270681..ca1c79a31 100644 --- a/Source/Modules/nested.cxx +++ b/Source/Modules/nested.cxx @@ -396,7 +396,12 @@ void Swig_nested_name_unnamed_c_structs(Node *n) { Delete(ins); Delattr(c, "nested:outer"); } else { - // global unnamed struct - ignore it + // global unnamed struct - ignore it and it's instances + SetFlag(c, "feature:ignore"); + while (next && Getattr(next, "nested:unnamedtype") == c) { + SetFlag(next, "feature:ignore"); + next = nextSibling(next); + } c = next; continue; } diff --git a/Source/Modules/typepass.cxx b/Source/Modules/typepass.cxx index 329a601a8..ec6f64587 100644 --- a/Source/Modules/typepass.cxx +++ b/Source/Modules/typepass.cxx @@ -661,6 +661,9 @@ class TypePass:private Dispatcher { * ------------------------------------------------------------ */ virtual int cDeclaration(Node *n) { + if (GetFlag(n, "feature:ignore")) { + return SWIG_OK; + } if (NoExcept) { Delattr(n, "throws"); } From 2b5499a2628edda34f2deccd668001093d4a562d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 13 May 2014 23:30:00 +0100 Subject: [PATCH 019/152] Slight simplification of test-suite build for new out-of-source changes Provide default SRCDIR and SCRIPTDIR variables in common.mk and override only where needed. --- Examples/Makefile.in | 4 ++-- Examples/test-suite/allegrocl/Makefile.in | 5 ----- Examples/test-suite/cffi/Makefile.in | 5 ----- Examples/test-suite/chicken/Makefile.in | 5 ----- Examples/test-suite/clisp/Makefile.in | 5 ----- Examples/test-suite/common.mk | 2 ++ Examples/test-suite/csharp/Makefile.in | 7 +------ Examples/test-suite/d/Makefile.in | 5 ----- Examples/test-suite/errors/Makefile.in | 5 ----- Examples/test-suite/go/Makefile.in | 6 ------ Examples/test-suite/guile/Makefile.in | 6 ------ Examples/test-suite/java/Makefile.in | 7 +------ Examples/test-suite/javascript/Makefile.in | 5 ----- Examples/test-suite/lua/Makefile.in | 6 ------ Examples/test-suite/mzscheme/Makefile.in | 5 ----- Examples/test-suite/ocaml/Makefile.in | 5 ----- Examples/test-suite/octave/Makefile.in | 6 ------ Examples/test-suite/perl5/Makefile.in | 6 ------ Examples/test-suite/php/Makefile.in | 6 ------ Examples/test-suite/pike/Makefile.in | 5 ----- Examples/test-suite/python/Makefile.in | 15 +++------------ Examples/test-suite/r/Makefile.in | 5 ----- Examples/test-suite/ruby/Makefile.in | 6 ------ Examples/test-suite/tcl/Makefile.in | 6 ------ Examples/test-suite/uffi/Makefile.in | 5 ----- 25 files changed, 9 insertions(+), 134 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index dcfbd83b9..d22a85abc 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -26,8 +26,8 @@ Makefile: @srcdir@/Makefile.in ../config.status cd .. && $(SHELL) ./config.status Examples/Makefile # SRCDIR is the relative path to the current source directory -# - For in-source-tree builds, SRCDIR with be either '', -# or '../' for some of the test suites (e.g. C#, Java) +# - For in-source-tree builds, SRCDIR with be either '' or './', but +# '../' for the test suites that build in a subdir (e.g. C#, Java) # - For out-of-source-tree builds, SRCDIR will be a relative # path ending with a '/' diff --git a/Examples/test-suite/allegrocl/Makefile.in b/Examples/test-suite/allegrocl/Makefile.in index 2803b7012..7c21e18cd 100644 --- a/Examples/test-suite/allegrocl/Makefile.in +++ b/Examples/test-suite/allegrocl/Makefile.in @@ -9,11 +9,6 @@ SCRIPTSUFFIX = _runme.lisp srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif # these cpp tests generate warnings/errors when compiling diff --git a/Examples/test-suite/cffi/Makefile.in b/Examples/test-suite/cffi/Makefile.in index a530e2243..164538e2b 100644 --- a/Examples/test-suite/cffi/Makefile.in +++ b/Examples/test-suite/cffi/Makefile.in @@ -9,11 +9,6 @@ SCRIPTSUFFIX = _runme.lisp srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/chicken/Makefile.in b/Examples/test-suite/chicken/Makefile.in index ac02dad83..bdda02b7e 100644 --- a/Examples/test-suite/chicken/Makefile.in +++ b/Examples/test-suite/chicken/Makefile.in @@ -10,11 +10,6 @@ PROXYSUFFIX = _runme_proxy.ss srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif CHICKEN_CSI = @CHICKEN_CSI@ -quiet -batch -no-init SO = @SO@ diff --git a/Examples/test-suite/clisp/Makefile.in b/Examples/test-suite/clisp/Makefile.in index 9db84c561..525605254 100644 --- a/Examples/test-suite/clisp/Makefile.in +++ b/Examples/test-suite/clisp/Makefile.in @@ -9,11 +9,6 @@ SCRIPTSUFFIX = _runme.lisp srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 37d660989..d93d788c9 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -70,6 +70,8 @@ LIBS = -L. LIBPREFIX = lib ACTION = check INTERFACEDIR = ../ +SRCDIR = $(srcdir)/ +SCRIPTDIR = $(srcdir) # Regenerate Makefile if Makefile.in or config.status have changed. ifeq (,$(TEST_SUITE_SUBDIR)) diff --git a/Examples/test-suite/csharp/Makefile.in b/Examples/test-suite/csharp/Makefile.in index a2a0828fd..7bec108eb 100644 --- a/Examples/test-suite/csharp/Makefile.in +++ b/Examples/test-suite/csharp/Makefile.in @@ -3,7 +3,6 @@ ####################################################################### LANGUAGE = csharp -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.cs CSHARPCILINTERPRETER = @CSHARPCILINTERPRETER@ CSHARPCILINTERPRETER_FLAGS = @CSHARPCILINTERPRETER_FLAGS@ @@ -13,11 +12,6 @@ CSHARPCYGPATH_W = @CSHARPCYGPATH_W@ srcdir = @srcdir@ top_srcdir = ../@top_srcdir@ top_builddir = ../@top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = ../ -else -SRCDIR = ../$(srcdir)/ -endif CPP_TEST_CASES = \ csharp_attributes \ @@ -37,6 +31,7 @@ CPP_TEST_CASES = \ include $(srcdir)/../common.mk # Overridden variables here +SRCDIR = ../$(srcdir)/ SWIGOPT += -namespace $*Namespace CSHARPFLAGSSPECIAL = diff --git a/Examples/test-suite/d/Makefile.in b/Examples/test-suite/d/Makefile.in index 0542bbad0..42fac00bc 100644 --- a/Examples/test-suite/d/Makefile.in +++ b/Examples/test-suite/d/Makefile.in @@ -7,11 +7,6 @@ LANGUAGE = d srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif ifeq (2,$(D_VERSION)) VERSIONSUFFIX = .2 diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in index c74e9c65b..9ca6f6ecd 100644 --- a/Examples/test-suite/errors/Makefile.in +++ b/Examples/test-suite/errors/Makefile.in @@ -22,11 +22,6 @@ TODOS = tr -d '\r' srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif # strip source directory from output, so that diffs compare srcdir_regexp = $(shell echo $(srcdir)/ | sed 's/\./[.]/g') diff --git a/Examples/test-suite/go/Makefile.in b/Examples/test-suite/go/Makefile.in index 03f6f151e..204cf8a12 100644 --- a/Examples/test-suite/go/Makefile.in +++ b/Examples/test-suite/go/Makefile.in @@ -9,7 +9,6 @@ GO1 = @GO1@ GO12 = @GO12@ GO13 = @GO13@ GOC = @GOC@ -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.go GOCOMPILEARG = `if $(GOGCC) ; then echo -c -g; elif $(GO1) ; then echo tool $(GOC:c=g) ; fi` @@ -24,11 +23,6 @@ SO = @SO@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/guile/Makefile.in b/Examples/test-suite/guile/Makefile.in index 5ac3de685..6cbf3b9b1 100644 --- a/Examples/test-suite/guile/Makefile.in +++ b/Examples/test-suite/guile/Makefile.in @@ -6,17 +6,11 @@ EXTRA_TEST_CASES += guile_ext_test.externaltest LANGUAGE = guile VARIANT = -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.scm srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif GUILE = @GUILE@ GUILE_RUNTIME= diff --git a/Examples/test-suite/java/Makefile.in b/Examples/test-suite/java/Makefile.in index a61452ed2..dd6c74a51 100644 --- a/Examples/test-suite/java/Makefile.in +++ b/Examples/test-suite/java/Makefile.in @@ -6,17 +6,11 @@ LANGUAGE = java JAVA = @JAVA@ JAVAC = @JAVAC@ JAVAFLAGS = -Xcheck:jni -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.java srcdir = @srcdir@ top_srcdir = ../@top_srcdir@ top_builddir = ../@top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = ../ -else -SRCDIR = ../$(srcdir)/ -endif C_TEST_CASES = \ java_lib_arrays \ @@ -49,6 +43,7 @@ CPP_TEST_CASES = \ include $(srcdir)/../common.mk # Overridden variables here +SRCDIR = ../$(srcdir)/ JAVA_PACKAGE = $* JAVA_PACKAGEOPT = -package $(JAVA_PACKAGE) SWIGOPT += $(JAVA_PACKAGEOPT) diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index 6126bde74..211310e86 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -10,11 +10,6 @@ SCRIPTSUFFIX = _runme.js srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif SWIG = $(top_builddir)/preinst_swig diff --git a/Examples/test-suite/lua/Makefile.in b/Examples/test-suite/lua/Makefile.in index b35cc15ad..00f940825 100644 --- a/Examples/test-suite/lua/Makefile.in +++ b/Examples/test-suite/lua/Makefile.in @@ -4,17 +4,11 @@ LANGUAGE = lua LUA = @LUABIN@ -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.lua srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif # sorry, currently very few test cases work/have been written diff --git a/Examples/test-suite/mzscheme/Makefile.in b/Examples/test-suite/mzscheme/Makefile.in index 39fb1acbc..1c2466efc 100644 --- a/Examples/test-suite/mzscheme/Makefile.in +++ b/Examples/test-suite/mzscheme/Makefile.in @@ -9,11 +9,6 @@ SCRIPTSUFFIX = _runme.scm srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/ocaml/Makefile.in b/Examples/test-suite/ocaml/Makefile.in index 5081e203e..c9c4bb603 100644 --- a/Examples/test-suite/ocaml/Makefile.in +++ b/Examples/test-suite/ocaml/Makefile.in @@ -10,11 +10,6 @@ SCRIPTSUFFIX = _runme.ml srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif C_TEST_CASES = diff --git a/Examples/test-suite/octave/Makefile.in b/Examples/test-suite/octave/Makefile.in index 11cb7c076..4f78371f4 100644 --- a/Examples/test-suite/octave/Makefile.in +++ b/Examples/test-suite/octave/Makefile.in @@ -4,17 +4,11 @@ LANGUAGE = octave OCTAVE = @OCTAVE@ -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.m srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif CPP_TEST_CASES += \ li_std_pair_extra \ diff --git a/Examples/test-suite/perl5/Makefile.in b/Examples/test-suite/perl5/Makefile.in index 6778f714e..9d9d460d8 100644 --- a/Examples/test-suite/perl5/Makefile.in +++ b/Examples/test-suite/perl5/Makefile.in @@ -4,18 +4,12 @@ LANGUAGE = perl5 PERL = @PERL@ -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.pl TEST_RUNNER = $(srcdir)/run-perl-test.pl srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif CPP_TEST_CASES += \ primitive_types \ diff --git a/Examples/test-suite/php/Makefile.in b/Examples/test-suite/php/Makefile.in index b6e4fff1a..5f56760ea 100644 --- a/Examples/test-suite/php/Makefile.in +++ b/Examples/test-suite/php/Makefile.in @@ -3,17 +3,11 @@ ####################################################################### LANGUAGE = php -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.php srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif CPP_TEST_CASES += \ php_namewarn_rename \ diff --git a/Examples/test-suite/pike/Makefile.in b/Examples/test-suite/pike/Makefile.in index 36a34352a..414fa1159 100644 --- a/Examples/test-suite/pike/Makefile.in +++ b/Examples/test-suite/pike/Makefile.in @@ -9,11 +9,6 @@ SCRIPTSUFFIX = _runme.pike srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif include $(srcdir)/../common.mk diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 719e7d1a4..492396d15 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -14,6 +14,7 @@ PYTHON = $(PYBIN) #*_runme.py for Python 2.x, *_runme3.py for Python 3.x PY2SCRIPTSUFFIX = _runme.py PY3SCRIPTSUFFIX = _runme3.py +PY2TO3 = 2to3 -x import ifeq (,$(PY3)) SCRIPTSUFFIX = $(PY2SCRIPTSUFFIX) @@ -21,20 +22,9 @@ else SCRIPTSUFFIX = $(PY3SCRIPTSUFFIX) endif -SCRIPTDIR = . - srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif - - -PY2TO3 = 2to3 -x import - CPP_TEST_CASES += \ argcargvtest \ @@ -109,7 +99,8 @@ BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES)) builtin-check : $(BUILTIN_NOT_BROKEN) # Overridden variables here -LIBS = -L. +SCRIPTDIR = . +LIBS = -L. VALGRIND_OPT += --suppressions=pythonswig.supp # Custom tests - tests with additional commandline options diff --git a/Examples/test-suite/r/Makefile.in b/Examples/test-suite/r/Makefile.in index 9f0de1c5f..8bf537d8c 100644 --- a/Examples/test-suite/r/Makefile.in +++ b/Examples/test-suite/r/Makefile.in @@ -10,11 +10,6 @@ RUNR = R CMD BATCH --no-save --no-restore srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif C_TEST_CASES += \ r_copy_struct \ diff --git a/Examples/test-suite/ruby/Makefile.in b/Examples/test-suite/ruby/Makefile.in index d0c65929a..206617ecd 100644 --- a/Examples/test-suite/ruby/Makefile.in +++ b/Examples/test-suite/ruby/Makefile.in @@ -4,17 +4,11 @@ LANGUAGE = ruby RUBY = @RUBY@ -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.rb srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif CPP_TEST_CASES = \ kwargs_feature \ diff --git a/Examples/test-suite/tcl/Makefile.in b/Examples/test-suite/tcl/Makefile.in index f8a196e26..32454b09c 100644 --- a/Examples/test-suite/tcl/Makefile.in +++ b/Examples/test-suite/tcl/Makefile.in @@ -4,17 +4,11 @@ LANGUAGE = tcl TCLSH = tclsh -SCRIPTDIR = $(srcdir) SCRIPTSUFFIX = _runme.tcl srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif CPP_TEST_CASES += \ primitive_types \ diff --git a/Examples/test-suite/uffi/Makefile.in b/Examples/test-suite/uffi/Makefile.in index 9f3546da6..7184af40f 100644 --- a/Examples/test-suite/uffi/Makefile.in +++ b/Examples/test-suite/uffi/Makefile.in @@ -9,11 +9,6 @@ SCRIPTSUFFIX = _runme.lisp srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -ifeq (.,$(srcdir)) -SRCDIR = -else -SRCDIR = $(srcdir)/ -endif include $(srcdir)/../common.mk From beccd3258fc1fd9e0c3caef3a21fdaeffcef81d3 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 13 May 2014 23:52:55 +0100 Subject: [PATCH 020/152] Update all languages to use SCRIPTDIR R also to use SCRIPTPREFIX and SCRIPTSUFFIX --- Examples/test-suite/allegrocl/Makefile.in | 4 ++-- Examples/test-suite/cffi/Makefile.in | 4 ++-- Examples/test-suite/chicken/Makefile.in | 10 +++++----- Examples/test-suite/clisp/Makefile.in | 4 ++-- Examples/test-suite/d/Makefile.in | 8 ++++---- Examples/test-suite/javascript/Makefile.in | 2 +- Examples/test-suite/mzscheme/Makefile.in | 4 ++-- Examples/test-suite/ocaml/Makefile.in | 8 ++++---- Examples/test-suite/pike/Makefile.in | 4 ++-- Examples/test-suite/r/Makefile.in | 12 ++++++------ Examples/test-suite/uffi/Makefile.in | 4 ++-- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Examples/test-suite/allegrocl/Makefile.in b/Examples/test-suite/allegrocl/Makefile.in index 7c21e18cd..8c253a7f2 100644 --- a/Examples/test-suite/allegrocl/Makefile.in +++ b/Examples/test-suite/allegrocl/Makefile.in @@ -115,8 +115,8 @@ include $(srcdir)/../common.mk # Runs the testcase. A testcase is only run if # a file is found which has _runme.lisp appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(ALLEGROCLBIN) -batch -s $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(ALLEGROCLBIN) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi %.clean: diff --git a/Examples/test-suite/cffi/Makefile.in b/Examples/test-suite/cffi/Makefile.in index 164538e2b..6e657ba46 100644 --- a/Examples/test-suite/cffi/Makefile.in +++ b/Examples/test-suite/cffi/Makefile.in @@ -39,8 +39,8 @@ CPP_TEST_CASES = # Runs the testcase. A testcase is only run if # a file is found which has _runme.lisp appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CFFI) -batch -s $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CFFI) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean: (does nothing, we dont generate extra cffi code) diff --git a/Examples/test-suite/chicken/Makefile.in b/Examples/test-suite/chicken/Makefile.in index bdda02b7e..5a2ef3d8a 100644 --- a/Examples/test-suite/chicken/Makefile.in +++ b/Examples/test-suite/chicken/Makefile.in @@ -45,7 +45,7 @@ SWIGOPT += -nounit $(setup) +$(swig_and_compile_cpp) $(run_testcase) - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \ $(MAKE) $*.cppproxy; \ fi @@ -53,7 +53,7 @@ SWIGOPT += -nounit $(setup) +$(swig_and_compile_c) $(run_testcase) - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \ $(MAKE) $*.cproxy; \ fi @@ -61,7 +61,7 @@ SWIGOPT += -nounit $(setup) +$(swig_and_compile_multi_cpp) $(run_testcase) - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \ $(MAKE) $*.multiproxy; \ fi @@ -88,8 +88,8 @@ SWIGOPT += -nounit # Runs the testcase. A testcase is only run if # a file is found which has _runme.scm appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CHICKEN_CSI) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CHICKEN_CSI) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean diff --git a/Examples/test-suite/clisp/Makefile.in b/Examples/test-suite/clisp/Makefile.in index 525605254..43f7159ff 100644 --- a/Examples/test-suite/clisp/Makefile.in +++ b/Examples/test-suite/clisp/Makefile.in @@ -39,8 +39,8 @@ CPP_TEST_CASES = # Runs the testcase. A testcase is only run if # a file is found which has _runme.lisp appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CLISP) -batch -s $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CLISP) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean: (does nothing, we dont generate extra clisp code) diff --git a/Examples/test-suite/d/Makefile.in b/Examples/test-suite/d/Makefile.in index 42fac00bc..37a944b09 100644 --- a/Examples/test-suite/d/Makefile.in +++ b/Examples/test-suite/d/Makefile.in @@ -14,7 +14,7 @@ else VERSIONSUFFIX = .1 endif -TESTSUFFIX = _runme$(VERSIONSUFFIX).d +SCRIPTSUFFIX = _runme$(VERSIONSUFFIX).d CPP_TEST_CASES = \ d_nativepointers \ @@ -46,7 +46,7 @@ SWIGOPT+=-splitproxy -package $* # Makes a directory for the testcase if it does not exist setup = \ - if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \ else \ echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \ @@ -61,11 +61,11 @@ setup = \ # Compiles D files then runs the testcase. A testcase is only run if # a file is found which has _runme.d appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ cd $*$(VERSIONSUFFIX) && \ $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \ DFLAGS='-of$*_runme' \ - DSRCS='../$(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) `find $* -name *.d`' d_compile && \ + DSRCS='../$(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) `find $* -name *.d`' d_compile && \ env LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" $(RUNTOOL) ./$*_runme; \ else \ cd $*$(VERSIONSUFFIX) && \ diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index 211310e86..87e4c6ecb 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -22,7 +22,7 @@ endif include $(srcdir)/../common.mk _setup = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $* (with run test)" ; \ else \ echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $*" ; \ diff --git a/Examples/test-suite/mzscheme/Makefile.in b/Examples/test-suite/mzscheme/Makefile.in index 1c2466efc..034e52131 100644 --- a/Examples/test-suite/mzscheme/Makefile.in +++ b/Examples/test-suite/mzscheme/Makefile.in @@ -37,8 +37,8 @@ include $(srcdir)/../common.mk # Runs the testcase. A testcase is only run if # a file is found which has _runme.scm appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(MZSCHEME) -r $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(MZSCHEME) -r $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean diff --git a/Examples/test-suite/ocaml/Makefile.in b/Examples/test-suite/ocaml/Makefile.in index c9c4bb603..ee93d534c 100644 --- a/Examples/test-suite/ocaml/Makefile.in +++ b/Examples/test-suite/ocaml/Makefile.in @@ -14,12 +14,12 @@ top_builddir = @top_builddir@ C_TEST_CASES = run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) -a \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) -a \ -f $(top_srcdir)/Examples/test-suite/$*.list ] ; then \ - $(COMPILETOOL) $(OCAMLC) -c $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + $(COMPILETOOL) $(OCAMLC) -c $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ $(COMPILETOOL) $(OCAMLC) swig.cmo -custom -g -cc '$(CXX)' -o runme `cat $(top_srcdir)/Examples/test-suite/$(*).list | sed -e 's/\(.*\)/\1_wrap.o \1.cmo/g'`&& $(RUNTOOL) ./runme; \ - elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - $(COMPILETOOL) $(OCAMLC) -c $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + elif [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + $(COMPILETOOL) $(OCAMLC) -c $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ $(COMPILETOOL) $(OCAMLC) swig.cmo -custom -g -cc '$(CXX)' -o runme $(srcdir)/$(*).cmo $(srcdir)/$(*)_runme.cmo $(srcdir)/$(*)_wrap.o && \ $(RUNTOOL) ./runme; \ fi ; diff --git a/Examples/test-suite/pike/Makefile.in b/Examples/test-suite/pike/Makefile.in index 414fa1159..579c7e28f 100644 --- a/Examples/test-suite/pike/Makefile.in +++ b/Examples/test-suite/pike/Makefile.in @@ -37,8 +37,8 @@ include $(srcdir)/../common.mk # Runs the testcase. A testcase is only run if # a file is found which has _runme.pike appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PIKE) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PIKE) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean: remove the generated .pike file diff --git a/Examples/test-suite/r/Makefile.in b/Examples/test-suite/r/Makefile.in index 8bf537d8c..cab339bf7 100644 --- a/Examples/test-suite/r/Makefile.in +++ b/Examples/test-suite/r/Makefile.in @@ -49,19 +49,19 @@ include $(srcdir)/../common.mk # Run the runme if it exists. If not just load the R wrapper to # check for syntactic correctness run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ else \ - $(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(WRAPSUFFIX); \ + $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(WRAPSUFFIX); \ fi run_multitestcase = \ for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) ]; then \ env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" \ - $(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX); \ + $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX); \ else \ - $(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX); \ + $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX); \ fi; \ done # Clean diff --git a/Examples/test-suite/uffi/Makefile.in b/Examples/test-suite/uffi/Makefile.in index 7184af40f..59aa33c6a 100644 --- a/Examples/test-suite/uffi/Makefile.in +++ b/Examples/test-suite/uffi/Makefile.in @@ -39,8 +39,8 @@ CPP_TEST_CASES = # Runs the testcase. A testcase is only run if # a file is found which has _runme.lisp appended after the testcase name. run_testcase = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ - env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(UFFI) -batch -s $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(UFFI) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ fi # Clean: (does nothing, we dont generate extra uffi code) From 28c3549e433620e6aa94571471e51433aad4d447 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 14 May 2014 00:48:51 +0100 Subject: [PATCH 021/152] Partially fix R out of source test-suite Fix when there is NOT a runme.R file --- Examples/test-suite/r/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/r/Makefile.in b/Examples/test-suite/r/Makefile.in index cab339bf7..8ee73b279 100644 --- a/Examples/test-suite/r/Makefile.in +++ b/Examples/test-suite/r/Makefile.in @@ -52,7 +52,7 @@ run_testcase = \ if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \ else \ - $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(WRAPSUFFIX); \ + $(RUNTOOL) $(RUNR) ./$(SCRIPTPREFIX)$*$(WRAPSUFFIX); \ fi run_multitestcase = \ @@ -61,7 +61,7 @@ run_multitestcase = \ env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" \ $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX); \ else \ - $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX); \ + $(RUNTOOL) $(RUNR) ./$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX); \ fi; \ done # Clean From 4e47bbee06405811523f5426e812620ac58e86d4 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 14 May 2014 00:50:06 +0100 Subject: [PATCH 022/152] gitignore to ignore build directory names --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ce6a3c4b7..efb6cf096 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,4 @@ Examples/test-suite/uffi/*/ Examples/scratch # Out of source tree build directories -_build*/ +*build*/ From d927fa5376d7c1c19568ab653f1097ef082cae00 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 14 May 2014 22:23:40 +0100 Subject: [PATCH 023/152] Remove unnecessary make invocation when running test-suite --- Makefile.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 8c6072b41..da9dfdce5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -285,9 +285,6 @@ check-test-suite: \ check-javascript-test-suite check-%-test-suite: - @if test -d Examples/test-suite/$*; then \ - cd Examples/test-suite/$* && $(MAKE) Makefile; \ - fi @if test -z "$(skip-$*)"; then \ echo $* unknown; \ exit 1; \ From 18d72f4562745f725e981443248b8fbea1a55cae Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 15 May 2014 20:27:01 +0100 Subject: [PATCH 024/152] Add in CPPFLAGS and LDFLAGS to examples/test-suite - Split current usage of CXXFLAGS into the conventional CPPFLAGS CXXFLAGS and LDFLAGS - Split current usage of CFLAGS into the conventional CPPFLAGS CFLAGS and LDFLAGS - This restores 'make whatever CXXFLAGS=-g' which stopped working during the recently added suppport for out of source builds. - LDFLAGS is currently empty, but is there for future use --- Examples/Makefile.in | 230 ++++++++++++++-------------- Examples/chicken/class/Makefile | 1 - Examples/chicken/constants/Makefile | 1 - Examples/chicken/multimap/Makefile | 1 - Examples/chicken/overload/Makefile | 1 - Examples/chicken/simple/Makefile | 1 - Tools/javascript/Makefile.in | 10 +- 7 files changed, 121 insertions(+), 124 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index d22a85abc..7c2d23647 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -45,8 +45,10 @@ endif TARGET = CC = @CC@ CXX = @CXX@ -CFLAGS = $(SRCDIR_INCLUDE) @PLATCFLAGS@ -CXXFLAGS = $(SRCDIR_INCLUDE) @BOOST_CPPFLAGS@ @PLATCXXFLAGS@ +CPPFLAGS = $(SRCDIR_INCLUDE) +CFLAGS = @PLATCFLAGS@ +CXXFLAGS = @BOOST_CPPFLAGS@ @PLATCXXFLAGS@ +LDFLAGS = prefix = @prefix@ exec_prefix= @exec_prefix@ SRCS = @@ -155,12 +157,12 @@ TCL_SCRIPT = $(SRCDIR)$(RUNME).tcl tclsh: $(SRCDIR_SRCS) $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) \ $(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET) tclsh_cpp: $(SRCDIR_SRCS) $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -ltclsh.i -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) \ $(TCL_LIB) $(TCL_OPTS) $(LIBS) $(SYSLIBS) -o $(TARGET) # ----------------------------------------------------------- @@ -169,8 +171,8 @@ tclsh_cpp: $(SRCDIR_SRCS) tcl: $(SRCDIR_SRCS) $(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) - $(TCLLDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE) + $(TCLLDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO) # ----------------------------------------------------------- # Build a Tcl7.5 dynamic loadable module for C++ @@ -178,8 +180,8 @@ tcl: $(SRCDIR_SRCS) tcl_cpp: $(SRCDIR_SRCS) $(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) - $(TCLCXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE) + $(TCLCXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO) # ----------------------------------------------------------------- # Run Tcl example @@ -230,8 +232,8 @@ PERL5_SCRIPT = $(SRCDIR)$(RUNME).pl perl5: $(SRCDIR_SRCS) $(SWIG) -perl5 $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c -Dbool=char $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) - $(LDSHARED) $(CFLAGS) $(PERL5_CCDLFLAGS) $(OBJS) $(IOBJS) $(PERL5_LDFLAGS) $(PERL5_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CC) -c -Dbool=char $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(PERL5_CCDLFLAGS) $(OBJS) $(IOBJS) $(PERL5_LDFLAGS) $(PERL5_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- # Build a Perl5 dynamically loadable module (C++) @@ -239,15 +241,15 @@ perl5: $(SRCDIR_SRCS) perl5_cpp: $(SRCDIR_SRCS) $(SWIG) -perl5 -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) - $(CXXSHARED) $(CXXFLAGS) $(PERL5_CCDLFLAGS) $(OBJS) $(IOBJS) $(PERL5_LDFLAGS) $(PERL5_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PERL5_CCFLAGS) $(PERL5_CCCDLFLAGS) -I$(PERL5_INCLUDE) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(PERL5_CCDLFLAGS) $(OBJS) $(IOBJS) $(PERL5_LDFLAGS) $(PERL5_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- # Build a module from existing XS C source code. (ie. from xsubpp). # ---------------------------------------------------------------- perl5_xs: $(SRCDIR_SRCS) - $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(INCLUDES) -I$(PERL5_INCLUDE) - $(LDSHARED) $(CFLAGS) $(OBJS) $(LIBS) -o $(TARGET)$(SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(INCLUDES) -I$(PERL5_INCLUDE) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)$(SO) # ---------------------------------------------------------------- # Build a statically linked Perl5 executable @@ -255,11 +257,11 @@ perl5_xs: $(SRCDIR_SRCS) perl5_static: $(SRCDIR_SRCS) $(SWIG) -perl5 -static -lperlmain.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) -Dbool=char $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Dbool=char $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) perl5_static_cpp: $(SRCDIR_SRCS) $(SWIG) -perl5 -c++ -static -lperlmain.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET) # ----------------------------------------------------------------- # Running a Perl5 example @@ -324,8 +326,8 @@ endif python: $(SRCDIR_SRCS) $(SWIGPYTHON) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(PYTHON_INCLUDE) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(PYTHON_INCLUDE) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module @@ -333,8 +335,8 @@ python: $(SRCDIR_SRCS) python_cpp: $(SRCDIR_SRCS) $(SWIGPYTHON) -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(PYTHON_INCLUDE) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(PYTHON_INCLUDE) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(PYTHON_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)_$(TARGET)$(PYTHON_SO) # ----------------------------------------------------------------- # Build statically linked Python interpreter @@ -349,12 +351,12 @@ PYTHON_LIBOPTS = $(PYTHON_LINK) @LIBS@ $(TKINTER) $(SYSLIBS) python_static: $(SRCDIR_SRCS) $(SWIGPYTHON) -lembed.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET) python_static_cpp: $(SRCDIR_SRCS) $(SWIGPYTHON) -c++ -lembed.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(PYTHON_INCLUDE) $(LIBS) -L$(PYTHON_LIB) $(PYTHON_LIBOPTS) -o $(TARGET) # ----------------------------------------------------------------- @@ -423,9 +425,9 @@ OCTAVE_SCRIPT = $(SRCDIR)$(RUNME).m octave: $(SRCDIR_SRCS) $(SWIG) -octave $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(INCLUDES) $(OCTAVE_CXX) - $(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CSRCS) $(INCLUDES) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO) + $(CXX) -g -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(INCLUDES) $(OCTAVE_CXX) + $(CC) -g -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CSRCS) $(INCLUDES) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module @@ -433,8 +435,8 @@ octave: $(SRCDIR_SRCS) octave_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -octave $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(OCTAVE_CXX) - $(CXXSHARED) -g $(CXXFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO) + $(CXX) -g -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(OCTAVE_CXX) + $(CXXSHARED) -g $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(OCTAVE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(OCTAVE_SO) # ----------------------------------------------------------------- # Running an Octave example @@ -478,14 +480,14 @@ GUILE_SCRIPT = $(SRCDIR)$(RUNME).scm #------------------------------------------------------------------ guile: $(SRCDIR_SRCS) $(SWIG) -guile -Linkage passive $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO) guile_cpp: $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO) $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO): $(SRCDIR_SRCS) $(SWIG) -c++ -guile -Linkage passive $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) $(CPP_DLLIBS) -o $@ + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) $(CPP_DLLIBS) -o $@ guile_externalhdr: $(SWIG) -guile -external-runtime $(TARGET) @@ -496,7 +498,7 @@ guile_externalhdr: guile_augmented: $(SRCDIR_SRCS) $(SWIG) -guile $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CXXFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) -o $(TARGET) + $(CC) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) -o $(TARGET) # ----------------------------------------------------------------- # Build statically linked Guile interpreter @@ -504,24 +506,24 @@ guile_augmented: $(SRCDIR_SRCS) guile_static: $(SRCDIR_SRCS) $(SWIG) -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile guile_static_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -guile -lguilemain.i -Linkage ltdlmod $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ -DSWIGINIT="SCM scm_init_$(TARGET)_module(void); scm_init_$(TARGET)_module();" \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile guile_simple: $(SRCDIR_SRCS) $(SWIG) -guile -lguilemain.i -Linkage simple $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile guile_simple_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -guile -lguilemain.i -Linkage simple $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) $(GUILE_LIBOPTS) -o $(TARGET)-guile # ----------------------------------------------------------------- @@ -575,8 +577,8 @@ JAVAC = @JAVAC@ -d . java: $(SRCDIR_SRCS) $(SWIG) -java $(SWIGOPT) -o $(ISRCS) $(realpath $(INTERFACEPATH)) - $(CC) -c $(CCSHARED) $(CFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE) - $(JAVALDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE) + $(JAVALDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) # ---------------------------------------------------------------- # Build a java dynamically loadable module (C++) @@ -584,8 +586,8 @@ java: $(SRCDIR_SRCS) java_cpp: $(SRCDIR_SRCS) $(SWIG) -java -c++ $(SWIGOPT) -o $(ICXXSRCS) $(realpath $(INTERFACEPATH)) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE) - $(JAVACXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE) + $(JAVACXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) # ---------------------------------------------------------------- # Compile java files @@ -646,16 +648,16 @@ javascript_wrapper_cpp: $(SRCDIR_SRCS) $(SWIG) -javascript -c++ $(SWIGOPT) -o $(INTERFACEDIR)$(TARGET)_wrap.cxx $(INTERFACEPATH) javascript_build: $(SRCDIR_SRCS) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(JSINCLUDES) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(JSINCLUDES) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) javascript_build_cpp: $(SRCDIR_SRCS) ifeq (node,$(JSENGINE)) sed -e 's|$$srcdir|./$(SRCDIR)|g' $(SRCDIR)binding.gyp.in > binding.gyp $(NODEGYP) --loglevel=silent configure build 1>>/dev/null else - $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) - $(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXXSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) endif @@ -664,17 +666,17 @@ endif javascript: $(SRCDIR_SRCS) javascript_custom_interpreter $(SWIG) -javascript $(SWIGOPT) $(INTERFACEPATH) ifeq (jsc, $(ENGINE)) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(JSINCLUDES) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(JSINCLUDES) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) else # (v8 | node) # v8 and node must be compiled as c++ - $(CXX) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) - $(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXXSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) endif javascript_cpp: $(SRCDIR_SRCS) javascript_custom_interpreter $(SWIG) -javascript -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) - $(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXXSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Running a Javascript example @@ -797,8 +799,6 @@ MODULA3_INCLUDE= @MODULA3INC@ modula3: $(SRCDIR_SRCS) $(SWIG) -modula3 $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) -# $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) \ -# $(OBJS) $(IOBJS) $(LIBS) modula3_cpp: $(SRCDIR_SRCS) $(SWIG) -modula3 -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) @@ -848,7 +848,7 @@ mzscheme: $(SRCDIR_SRCS) mzscheme_cpp: $(SRCDIR_SRCS) $(SWIG) -mzscheme -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) $(COMPILETOOL) $(MZC) `echo $(INCLUDES) | sed 's/-I/++ccf -I/g'` --cc $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) - $(CXXSHARED) $(CXXFLAGS) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS) + $(CXXSHARED) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $(LIBPREFIX)$(TARGET)$(MZSCHEME_SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS) # ----------------------------------------------------------------- # Run mzscheme example @@ -913,7 +913,7 @@ ocaml_dynamic: $(SRCDIR_SRCS) $(OCAMLCORE) $(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) $(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS) - $(CXXSHARED) $(CXXFLAGS) $(CCSHARED) $(CFLAGS) -o $(INTERFACE:%.i=%@SO@) \ + $(CXXSHARED) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(CCSHARED) -o $(INTERFACE:%.i=%@SO@) \ $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) $(LIBS) $(OCAMLDLGEN) $(INTERFACE:%.i=%.ml) $(INTERFACE:%.i=%@SO@) > \ $(INTERFACE:%.i=%_dynamic.ml) @@ -984,7 +984,7 @@ ocaml_dynamic_cpp: $(SRCDIR_SRCS) cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c) $(OCC) -cc '$(CXX) -Wno-write-strings' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" \ $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) -ccopt -fPIC - $(CXXSHARED) $(CXXFLAGS) -o $(INTERFACE:%.i=%@SO@) \ + $(CXXSHARED) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $(INTERFACE:%.i=%@SO@) \ $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) \ $(CPP_DLLIBS) $(LIBS) $(OCAMLDLGEN) $(INTERFACE:%.i=%.ml) $(INTERFACE:%.i=%@SO@) > \ @@ -1045,8 +1045,8 @@ RUBY_SCRIPT = $(SRCDIR)$(RUNME).rb ruby: $(SRCDIR_SRCS) $(SWIG) -ruby $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(RUBY_INCLUDE) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(RUBY_SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(RUBY_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(RUBY_INCLUDE) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(RUBY_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module @@ -1054,8 +1054,8 @@ ruby: $(SRCDIR_SRCS) ruby_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -ruby $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(RUBY_INCLUDE) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(RUBY_SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(RUBY_INCLUDE) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(RUBY_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(RUBY_SO) # ----------------------------------------------------------------- # Build statically linked Ruby interpreter @@ -1066,12 +1066,12 @@ ruby_cpp: $(SRCDIR_SRCS) ruby_static: $(SRCDIR_SRCS) $(SWIG) -ruby -lembed.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(RUBY_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(RUBY_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET) ruby_cpp_static: $(SRCDIR_SRCS) $(SWIG) -c++ -ruby -lembed.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(RUBY_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(RUBY_INCLUDE) $(LIBS) -L$(RUBY_LIB) $(RUBY_LIBOPTS) -o $(TARGET) # ----------------------------------------------------------------- @@ -1112,8 +1112,8 @@ PHP_SCRIPT = $(SRCDIR)$(RUNME).php php: $(SRCDIR_SRCS) $(SWIG) -php $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(PHP_INCLUDE) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(PHP_INCLUDE) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO) # -------------------------------------------------------------------- # Build a PHP dynamically loadable module (C++) @@ -1121,8 +1121,8 @@ php: $(SRCDIR_SRCS) php_cpp: $(SRCDIR_SRCS) $(SWIG) -php -cppext cxx -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PHP_INCLUDE) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(PHP_INCLUDE) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(PHP_SO) # ----------------------------------------------------------------- # Running a PHP example @@ -1166,8 +1166,8 @@ PIKE_SCRIPT = $(RUNME).pike pike: $(SRCDIR_SRCS) $(SWIG) -pike $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(PIKE_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(PIKE_INCLUDE) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(PIKE_CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(PIKE_INCLUDE) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module @@ -1175,8 +1175,8 @@ pike: $(SRCDIR_SRCS) pike_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -pike $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(PIKE_INCLUDE) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(PIKE_INCLUDE) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(PIKE_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Build statically linked Pike interpreter @@ -1187,12 +1187,12 @@ pike_cpp: $(SRCDIR_SRCS) pike_static: $(SRCDIR_SRCS) $(SWIG) -pike -lembed.i $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(PIKE_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(PIKE_CFLAGS) @LINKFORSHARED@ $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) \ $(PIKE_INCLUDE) $(LIBS) -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET) pike_cpp_static: $(SRCDIR_SRCS) $(SWIG) -c++ -pike -lembed.i $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(PIKE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) \ $(PIKE_INCLUDE) $(LIBS) -L$(PIKE_LIB) $(PIKE_LIBOPTS) -o $(TARGET) # ----------------------------------------------------------------- @@ -1253,9 +1253,9 @@ chicken_direct: $(SRCDIR_SRCS) $(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \ -dynamic -feature chicken-compile-shared \ -output-file $(CHICKEN_COMPILED_SCHEME) - $(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \ + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(CHICKEN_CFLAGS) \ $(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCDIR_SRCS) $(CHICKEN_COMPILED_SCHEME) - $(LDSHARED) $(CFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \ + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \ $(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO) chicken_direct_cpp: $(SRCDIR_CXXSRCS) $(CHICKSRCS) @@ -1263,9 +1263,9 @@ chicken_direct_cpp: $(SRCDIR_CXXSRCS) $(CHICKSRCS) $(CHICKEN) $(CHICKEN_GENERATED_SCHEME) $(CHICKENOPTS) \ -dynamic -feature chicken-compile-shared \ -output-file $(CHICKEN_COMPILED_SCHEME) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(CHICKEN_CFLAGS) \ + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(CHICKEN_CFLAGS) \ $(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(CHICKEN_COMPILED_SCHEME) - $(CXXSHARED) $(CXXFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \ + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(CHICKEN_COMPILED_OBJECT) $(OBJS) $(IOBJS) \ $(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- @@ -1279,10 +1279,10 @@ chicken_static: $(SRCDIR_SRCS) $(CHICKSRCS) -output-file $(CHICKEN_COMPILED_SCHEME) $(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \ -output-file $(CHICKEN_MAIN:.scm=_chicken.c) - $(CC) -c $(CCSHARED) $(CFLAGS) $(CHICKEN_CFLAGS) \ + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(CHICKEN_CFLAGS) \ $(INCLUDES) $(CHICKEN_INCLUDE) $(ISRCS) $(SRCDIR_SRCS) \ $(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN) - $(CC) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \ + $(CC) $(CFLAGS) $(LDFLAGS) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \ $(OBJS) $(IOBJS) $(LIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET) chicken_static_cpp: $(SRCDIR_CXXSRCS) $(CHICKSRCS) @@ -1291,10 +1291,10 @@ chicken_static_cpp: $(SRCDIR_CXXSRCS) $(CHICKSRCS) -output-file $(CHICKEN_COMPILED_SCHEME) $(CHICKEN) $(CHICKEN_MAIN) $(CHICKENOPTS) \ -output-file $(CHICKEN_MAIN:.scm=_chicken.c) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(CHICKEN_CFLAGS) \ + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(CHICKEN_CFLAGS) \ $(INCLUDES) $(CHICKEN_INCLUDE) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) \ $(CHICKEN_COMPILED_SCHEME) $(CHICKEN_COMPILED_MAIN) - $(CXX) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \ + $(CXX) $(CXXFLAGS) $(LDFLAGS) $(CHICKEN_COMPILED_OBJECT) $(CHICKEN_COMPILED_MAIN_OBJECT) \ $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) $(CHICKEN_SHAREDLIBOPTS) -o $(TARGET) # ---------------------------------------------------------------- @@ -1355,8 +1355,8 @@ CSHARP_RUNME = $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) ./$(RUNME). csharp: $(SRCDIR_SRCS) $(SWIG) -csharp $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(CSHARPCFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(CSHARPCFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO) # ---------------------------------------------------------------- # Build a CSharp dynamically loadable module (C++) @@ -1364,8 +1364,8 @@ csharp: $(SRCDIR_SRCS) csharp_cpp: $(SRCDIR_SRCS) $(SWIG) -csharp -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(CSHARPCFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(CSHARPCFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(CSHARP_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(CSHARP_LIBPREFIX)$(TARGET)$(CSHARPSO) # ---------------------------------------------------------------- # Compile CSharp files @@ -1428,8 +1428,8 @@ LUA_INTERP = ../lua.c lua: $(SRCDIR_SRCS) $(SWIG) -lua $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(LUA_INCLUDE) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) -o $(LIBPREFIX)$(TARGET)$(LUA_SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(LUA_INCLUDE) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) -o $(LIBPREFIX)$(TARGET)$(LUA_SO) # ----------------------------------------------------------------- # Build a C++ dynamically loadable module @@ -1437,8 +1437,8 @@ lua: $(SRCDIR_SRCS) lua_cpp: $(SRCDIR_SRCS) $(GENCXXSRCS) $(SWIG) -c++ -lua $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(GENCXXSRCS) $(INCLUDES) $(LUA_INCLUDE) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(LUA_SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(GENCXXSRCS) $(INCLUDES) $(LUA_INCLUDE) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(LUA_LIB) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(LUA_SO) # ----------------------------------------------------------------- # Build statically linked Lua interpreter @@ -1446,12 +1446,12 @@ lua_cpp: $(SRCDIR_SRCS) $(GENCXXSRCS) lua_static: $(SRCDIR_SRCS) $(SWIG) -lua -module example $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR)$(LUA_INTERP) $(INCLUDES) \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR)$(LUA_INTERP) $(INCLUDES) \ $(LUA_INCLUDE) $(LIBS) $(LUA_LIB) -o $(TARGET) lua_static_cpp: $(SRCDIR_SRCS) $(GENCXXSRCS) $(SWIG) -c++ -lua -module example $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(GENCXXSRCS) $(SRCDIR)$(LUA_INTERP) $(INCLUDES) \ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(GENCXXSRCS) $(SRCDIR)$(LUA_INTERP) $(INCLUDES) \ $(LUA_INCLUDE) $(LIBS) $(LUA_LIB) -o $(TARGET) # ----------------------------------------------------------------- @@ -1489,13 +1489,13 @@ ALLEGROCL_SCRIPT=$(RUNME).lisp allegrocl: $(SRCDIR_SRCS) $(SWIG) -allegrocl -cwrap $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) allegrocl_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -allegrocl $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Run ALLEGRO CL example @@ -1565,13 +1565,13 @@ CFFI_SCRIPT=$(RUNME).lisp cffi: $(SRCDIR_SRCS) $(SWIG) -cffi $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) -# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) -# $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) +# $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) +# $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) cffi_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -cffi $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Run CFFI example @@ -1605,13 +1605,13 @@ UFFI_SCRIPT=$(RUNME).lisp uffi: $(SRCDIR_SRCS) $(SWIG) -uffi $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) -# $(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) -# $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) +# $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(INCLUDES) $(SRCDIR_SRCS) +# $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) uffi_cpp: $(SRCDIR_SRCS) $(SWIG) -c++ -uffi $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) -# $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) -# $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) +# $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) +# $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Run UFFI example @@ -1657,7 +1657,7 @@ R_SCRIPT=$(RUNME).R r: $(SRCDIR_SRCS) $(SWIG) -r $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) ifneq ($(SRCDIR_SRCS),) - $(CC) -g -c $(CFLAGS) $(R_CFLAGS) $(SRCDIR_SRCS) $(INCLUDES) + $(CC) -g -c $(CPPFLAGS) $(CFLAGS) $(R_CFLAGS) $(SRCDIR_SRCS) $(INCLUDES) endif +( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) $(OBJS) > /dev/null ) @@ -1668,7 +1668,7 @@ endif r_cpp: $(SRCDIR_CXXSRCS) $(SWIG) -c++ -r $(SWIGOPT) -o $(RCXXSRCS) $(INTERFACEPATH) ifneq ($(SRCDIR_CXXSRCS),) - $(CXX) -g -c $(CXXFLAGS) $(R_CFLAGS) $(SRCDIR_CXXSRCS) $(INCLUDES) + $(CXX) -g -c $(CPPFLAGS) $(CXXFLAGS) $(R_CFLAGS) $(SRCDIR_CXXSRCS) $(INCLUDES) endif +( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) $(OBJS) > /dev/null ) @@ -1732,10 +1732,10 @@ GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@) go: $(SRCDIR_SRCS) $(SWIG) -go $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) if $(GO12) || $(GO13) || $(GOGCC); then \ - $(CC) -g -c $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \ + $(CC) -g -c $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \ else \ - $(CC) -g -c $(CCSHARED) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \ - $(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \ + $(CC) -g -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \ + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \ fi $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(GOSRCS) if ! $(GOGCC) ; then \ @@ -1755,7 +1755,7 @@ go: $(SRCDIR_SRCS) if $(GOGCC) ; then \ $(COMPILETOOL) $(GO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOGCCOBJS) $(OBJS) $(IOBJS); \ elif $(GO12) || $(GO13); then \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \ fi; \ @@ -1768,10 +1768,10 @@ go: $(SRCDIR_SRCS) go_cpp: $(SRCDIR_SRCS) $(SWIG) -go -c++ $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) if $(GO12) || $(GO13) || $(GOGCC); then \ - $(CXX) -g -c $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ + $(CXX) -g -c $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ else \ - $(CXX) -g -c $(CCSHARED) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ - $(CXXSHARED) $(CXXFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \ + $(CXX) -g -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES); \ + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \ fi $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(GOSRCS) if ! $(GOGCC) ; then \ @@ -1791,7 +1791,7 @@ go_cpp: $(SRCDIR_SRCS) if $(GOGCC) ; then \ $(COMPILETOOL) $(GO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOGCCOBJS) $(OBJS) $(IOBJS) -lstdc++; \ elif $(GO12) || $(GO13); then \ - $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ + $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \ else \ $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \ fi; \ @@ -1846,8 +1846,8 @@ D_RUNME = ./$(RUNME) d: $(SRCDIR_SRCS) $(SWIGD) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) -c $(CCSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) - $(LDSHARED) $(CFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(DLIBPREFIX)$(TARGET)$(SO) + $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) + $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(DLIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- # Build a dynamically loadable D wrapper for a C++ module @@ -1855,8 +1855,8 @@ d: $(SRCDIR_SRCS) d_cpp: $(SRCDIR_SRCS) $(SWIGD) -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CXXFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) - $(CXXSHARED) $(CXXFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(DLIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(DCFLAGS) $(EXTRA_CFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(DCFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(DLIBPREFIX)$(TARGET)$(SO) # ---------------------------------------------------------------- # Compile D files diff --git a/Examples/chicken/class/Makefile b/Examples/chicken/class/Makefile index 5fafa5c15..a37ea4a85 100644 --- a/Examples/chicken/class/Makefile +++ b/Examples/chicken/class/Makefile @@ -6,7 +6,6 @@ CXXSRCS = example.cxx TARGET = class INCLUDE = SWIGOPT = -CFLAGS = VARIANT = # uncomment the following lines to build a static exe (only pick one of the CHICKEN_MAIN lines) diff --git a/Examples/chicken/constants/Makefile b/Examples/chicken/constants/Makefile index a6100f757..7167e866b 100644 --- a/Examples/chicken/constants/Makefile +++ b/Examples/chicken/constants/Makefile @@ -6,7 +6,6 @@ CXXSRCS = TARGET = constants INCLUDE = SWIGOPT = -CFLAGS = VARIANT = # uncomment the following two lines to build a static exe diff --git a/Examples/chicken/multimap/Makefile b/Examples/chicken/multimap/Makefile index 79282be17..e8192e9cd 100644 --- a/Examples/chicken/multimap/Makefile +++ b/Examples/chicken/multimap/Makefile @@ -6,7 +6,6 @@ CXXSRCS = TARGET = multimap INCLUDE = SWIGOPT = -CFLAGS = VARIANT = # uncomment the following two lines to build a static exe diff --git a/Examples/chicken/overload/Makefile b/Examples/chicken/overload/Makefile index 717abd335..a9647d93e 100644 --- a/Examples/chicken/overload/Makefile +++ b/Examples/chicken/overload/Makefile @@ -6,7 +6,6 @@ CXXSRCS = example.cxx TARGET = overload INCLUDE = SWIGOPT = -proxy -unhideprimitive -CFLAGS = VARIANT = # uncomment the following lines to build a static exe diff --git a/Examples/chicken/simple/Makefile b/Examples/chicken/simple/Makefile index 9d1f34fa0..c07075efa 100644 --- a/Examples/chicken/simple/Makefile +++ b/Examples/chicken/simple/Makefile @@ -6,7 +6,6 @@ CXXSRCS = TARGET = simple INCLUDE = SWIGOPT = -CFLAGS = VARIANT = # uncomment the following two lines to build a static exe diff --git a/Tools/javascript/Makefile.in b/Tools/javascript/Makefile.in index d5c4711a0..960c661b2 100644 --- a/Tools/javascript/Makefile.in +++ b/Tools/javascript/Makefile.in @@ -16,9 +16,11 @@ all: javascript CC = @CC@ # HACK: under OSX a g++ compiled interpreter is seg-faulting when loading module libraries # with 'c++' it works... probably some missing flags? -JSCXX = @JSINTERPRETERCXX@ +JSCXX = @JSINTERPRETERCXX@ +CPPFLAGS = @BOOST_CPPFLAGS@ CFLAGS = @PLATCFLAGS@ -CXXFLAGS = @BOOST_CPPFLAGS@ @PLATCXXFLAGS@ +CXXFLAGS = @PLATCXXFLAGS@ +LDFLAGS = LINKFLAGS = @JSINTERPRETERLINKFLAGS@ ROOT_DIR = @ROOT_DIR@ @@ -54,10 +56,10 @@ JS_INTERPRETER_SRC = javascript.cxx js_shell.cxx $(JS_INTERPRETER_SRC_JSC) $(JS_ JS_INTERPRETER_OBJS = $(JS_INTERPRETER_SRC:.cxx=.o) %.o: $(srcdir)/%.cxx - $(JSCXX) $(JS_INTERPRETER_DEFINES) $(CXXFLAGS) $(JSINCLUDES) -o $@ -c $< + $(JSCXX) $(JS_INTERPRETER_DEFINES) $(CPPFLAGS) $(CXXFLAGS) $(JSINCLUDES) -o $@ -c $< javascript: $(JS_INTERPRETER_OBJS) - $(JSCXX) $^ $(CXXFLAGS) -o javascript $(JSDYNAMICLINKING) $(LINKFLAGS) + $(JSCXX) $^ $(CXXFLAGS) $(LDFLAGS) -o javascript $(JSDYNAMICLINKING) $(LINKFLAGS) clean: rm -f *.o From ce5f49463e98fe2825e87f1b1f76e6602f32f4f0 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 15 May 2014 20:50:05 +0100 Subject: [PATCH 025/152] Remove duplicate test target in CCache Makefile --- CCache/Makefile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/CCache/Makefile.in b/CCache/Makefile.in index ae77ae745..6703e2ac0 100644 --- a/CCache/Makefile.in +++ b/CCache/Makefile.in @@ -59,8 +59,6 @@ uninstall: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1 clean: /bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT) -check : test - test: test.sh SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' $(srcdir)/test.sh From 8ece62b9457a6b61de544c6885772d3bc8150299 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 15 May 2014 22:04:54 +0100 Subject: [PATCH 026/152] Neaten up test-suite Makefile regeneration --- Examples/test-suite/common.mk | 5 +---- Examples/test-suite/errors/Makefile.in | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index d93d788c9..ef697b131 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -74,11 +74,8 @@ SRCDIR = $(srcdir)/ SCRIPTDIR = $(srcdir) # Regenerate Makefile if Makefile.in or config.status have changed. -ifeq (,$(TEST_SUITE_SUBDIR)) -TEST_SUITE_SUBDIR = $(LANGUAGE) -endif Makefile: $(srcdir)/Makefile.in ../../../config.status - cd ../../../ && $(SHELL) ./config.status $(EXAMPLES)/$(TEST_SUITE)/$(TEST_SUITE_SUBDIR)/Makefile + cd ../../../ && $(SHELL) ./config.status $(EXAMPLES)/$(TEST_SUITE)/$(LANGUAGE)/Makefile # # Please keep test cases in alphabetical order. diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in index 9ca6f6ecd..da67db8bd 100644 --- a/Examples/test-suite/errors/Makefile.in +++ b/Examples/test-suite/errors/Makefile.in @@ -13,7 +13,7 @@ # file (.stderr) in addition to the test case itself. ####################################################################### -LANGUAGE = python +LANGUAGE = errors ERROR_EXT = newerr # Portable dos2unix / todos for stripping CR TODOS = tr -d '\r' @@ -35,9 +35,6 @@ C_ERROR_TEST_CASES := $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CAS ERROR_TEST_CASES := $(CPP_ERROR_TEST_CASES:=.cpptest) \ $(C_ERROR_TEST_CASES:=.ctest) -# For rebuilding Makefile from Makefile.in in common.mk -TEST_SUITE_SUBDIR = errors - include $(srcdir)/../common.mk @@ -56,5 +53,5 @@ include $(srcdir)/../common.mk @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile $(LANGUAGE)_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile python_clean @rm -f *.$(ERROR_EXT) *.py From 61818533129e7d88124e00c69b81088f060b4b39 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 14 May 2014 00:36:38 +0100 Subject: [PATCH 027/152] Fix out of source clean-android-examples --- Examples/Makefile.in | 2 +- Examples/android/class/Makefile | 2 +- Examples/android/extend/Makefile | 2 +- Examples/android/simple/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 7c2d23647..c47c075e9 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -782,7 +782,7 @@ android_version: # ----------------------------------------------------------------- android_clean: - ant -q -logfile /dev/null clean + cd $(SRCDIR) && ant -q -logfile /dev/null clean rm -f $(INTERFACEDIR)$(TARGET)_wrap.* rm -f `find $(PACKAGEDIR) -name \*.java | grep -v $(PROJECTNAME).java` rm -rf obj diff --git a/Examples/android/class/Makefile b/Examples/android/class/Makefile index 44d33de0a..574566623 100644 --- a/Examples/android/class/Makefile +++ b/Examples/android/class/Makefile @@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig TARGET = example INTERFACE = example.i INTERFACEDIR = jni/ -PACKAGEDIR = src/org/swig +PACKAGEDIR = $(SRCDIR)src/org/swig PACKAGENAME= org.swig.classexample SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/classexample PROJECTNAME= SwigClass diff --git a/Examples/android/extend/Makefile b/Examples/android/extend/Makefile index 3d0609a08..fb974d22c 100644 --- a/Examples/android/extend/Makefile +++ b/Examples/android/extend/Makefile @@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig TARGET = example INTERFACE = example.i INTERFACEDIR = jni/ -PACKAGEDIR = src/org/swig +PACKAGEDIR = $(SRCDIR)src/org/swig PACKAGENAME= org.swig.extendexample SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/extendexample PROJECTNAME= SwigExtend diff --git a/Examples/android/simple/Makefile b/Examples/android/simple/Makefile index d71b9880c..2bf41968a 100644 --- a/Examples/android/simple/Makefile +++ b/Examples/android/simple/Makefile @@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig TARGET = example INTERFACE = example.i INTERFACEDIR = jni/ -PACKAGEDIR = src/org/swig +PACKAGEDIR = $(SRCDIR)src/org/swig PACKAGENAME= org.swig.simple SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/simple PROJECTNAME= SwigSimple From 81335c5a91f134c3bbd32ecf7c7fa299f356b4f2 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 15 May 2014 23:27:26 +0100 Subject: [PATCH 028/152] Configured languages display improvement --- configure.ac | 53 ++++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/configure.ac b/configure.ac index 949986341..e2cbe9fca 100644 --- a/configure.ac +++ b/configure.ac @@ -2715,38 +2715,33 @@ EOF AC_OUTPUT langs="" -test -n "$SKIP_ALLEGROCL" || langs="$langs allegrocl" -test -n "$SKIP_CFFI" || langs="$langs cffi" -test -n "$SKIP_CHICKEN" || langs="$langs chicken" -test -n "$SKIP_CLISP" || langs="$langs clisp" -test -n "$SKIP_CSHARP" || langs="$langs csharp" -test -n "$SKIP_D" || langs="$langs d" -test -n "$SKIP_GO" || langs="$langs go" -test -n "$SKIP_GUILE" || langs="$langs guile" -test -n "$SKIP_JAVA" || langs="$langs java" -test -n "$SKIP_JAVASCRIPT" || langs="$langs javascript" -test -n "$SKIP_LUA" || langs="$langs lua" -test -n "$SKIP_MODULA3" || langs="$langs modula3" -test -n "$SKIP_MZSCHEME" || langs="$langs mzscheme" -test -n "$SKIP_OCAML" || langs="$langs ocaml" -test -n "$SKIP_OCTAVE" || langs="$langs octave" -test -n "$SKIP_PERL5" || langs="$langs perl5" -test -n "$SKIP_PHP" || langs="$langs php" -test -n "$SKIP_PIKE" || langs="$langs pike" -test -n "$SKIP_PYTHON" || langs="$langs python" -test -n "$SKIP_R" || langs="$langs r" -test -n "$SKIP_RUBY" || langs="$langs ruby" -test -n "$SKIP_TCL" || langs="$langs tcl" -test -n "$SKIP_UFFI" || langs="$langs uffi" +test -n "$SKIP_ALLEGROCL" || langs="${langs}allegrocl " +test -n "$SKIP_CFFI" || langs="${langs}cffi " +test -n "$SKIP_CHICKEN" || langs="${langs}chicken " +test -n "$SKIP_CLISP" || langs="${langs}clisp " +test -n "$SKIP_CSHARP" || langs="${langs}csharp " +test -n "$SKIP_D" || langs="${langs}d " +test -n "$SKIP_GO" || langs="${langs}go " +test -n "$SKIP_GUILE" || langs="${langs}guile " +test -n "$SKIP_JAVA" || langs="${langs}java " +test -n "$SKIP_JAVASCRIPT" || langs="${langs}javascript " +test -n "$SKIP_LUA" || langs="${langs}lua " +test -n "$SKIP_MODULA3" || langs="${langs}modula3 " +test -n "$SKIP_MZSCHEME" || langs="${langs}mzscheme " +test -n "$SKIP_OCAML" || langs="${langs}ocaml " +test -n "$SKIP_OCTAVE" || langs="${langs}octave " +test -n "$SKIP_PERL5" || langs="${langs}perl5 " +test -n "$SKIP_PHP" || langs="${langs}php " +test -n "$SKIP_PIKE" || langs="${langs}pike " +test -n "$SKIP_PYTHON" || langs="${langs}python " +test -n "$SKIP_R" || langs="${langs}r " +test -n "$SKIP_RUBY" || langs="${langs}ruby " +test -n "$SKIP_TCL" || langs="${langs}tcl " +test -n "$SKIP_UFFI" || langs="${langs}uffi " echo " -======================================================== - -SWIG is configured for use with the following languages: - +The SWIG test-suite and examples are configured for the following languages: $langs - -======================================================== " dnl configure.ac ends here From 2e0f6a21639f3a658126d49eb0e998a3f7b81a14 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 15 May 2014 23:55:36 +0100 Subject: [PATCH 029/152] Travis testing - add folding to less interesting commands See https://github.com/travis-ci/travis-ci/issues/2285 for fold syntax info. --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 26cb18910..95e433952 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,16 +68,22 @@ before_install: - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi script: + - echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r' - ./autogen.sh && ./configure $CONFIGOPTS + - echo -en 'travis_fold:end:script.1\\r' - make -s $SWIGJOBS - ./swig -version && ./swig -pcreversion - if test -z "$SWIGLANG"; then make -s $SWIGJOBS check-ccache; fi - if test -z "$SWIGLANG"; then make -s $SWIGJOBS check-errors-test-suite; fi + - echo 'Installing...' && echo -en 'travis_fold:start:script.1\\r' - if test -z "$SWIGLANG"; then sudo make -s install && swig -version && ccache-swig -V; fi + - echo -en 'travis_fold:end:script.2\\r' - if test -n "$SWIGLANG"; then make -s check-$SWIGLANG-version; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi + - echo -n 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r' - make maintainer-clean + - echo -en 'travis_fold:end:script.3\\r' branches: only: - master From 3b0a549d72fc47616c62d28abeb9d3aafab0fbc0 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 16 May 2014 06:11:39 +0100 Subject: [PATCH 030/152] Travis folding correction --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 95e433952..5d42d3ac5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,7 +75,7 @@ script: - ./swig -version && ./swig -pcreversion - if test -z "$SWIGLANG"; then make -s $SWIGJOBS check-ccache; fi - if test -z "$SWIGLANG"; then make -s $SWIGJOBS check-errors-test-suite; fi - - echo 'Installing...' && echo -en 'travis_fold:start:script.1\\r' + - echo 'Installing...' && echo -en 'travis_fold:start:script.2\\r' - if test -z "$SWIGLANG"; then sudo make -s install && swig -version && ccache-swig -V; fi - echo -en 'travis_fold:end:script.2\\r' - if test -n "$SWIGLANG"; then make -s check-$SWIGLANG-version; fi From 06d2c79c2869b709fd6ea3bb646051319bf79e7a Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 16 May 2014 06:50:37 +0100 Subject: [PATCH 031/152] Another Travis folding correction --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5d42d3ac5..a7a16f5fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,7 +81,7 @@ script: - if test -n "$SWIGLANG"; then make -s check-$SWIGLANG-version; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi - - echo -n 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r' + - echo 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r' - make maintainer-clean - echo -en 'travis_fold:end:script.3\\r' branches: From 17abb00f2046bd4b52010bb6e0235cb5e13ffbd8 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 16 May 2014 06:55:11 +0100 Subject: [PATCH 032/152] Modify Travis builds to build out of source Closes #167 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a7a16f5fd..1e7d9c657 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ before_install: - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi script: - echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r' - - ./autogen.sh && ./configure $CONFIGOPTS + - ./autogen.sh && mkdir -p build/build && cd build/build && ../../configure $CONFIGOPTS - echo -en 'travis_fold:end:script.1\\r' - make -s $SWIGJOBS - ./swig -version && ./swig -pcreversion From 8b19918a83d0a83c1b212fb1deedae4b965b6595 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 16 May 2014 08:02:11 +0100 Subject: [PATCH 033/152] Travis builds - add compiler version display --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e7d9c657..da5929e1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,8 +50,8 @@ matrix: # None before_install: - date -u - - lsb_release -a - uname -a + - lsb_release -a - sudo apt-get -qq update - time sudo apt-get -qq install libboost-dev - if test -z "$SWIGLANG"; then sudo apt-get -qq install yodl; fi @@ -67,6 +67,8 @@ before_install: - if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi + - $CC --version + - $CXX --version script: - echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r' - ./autogen.sh && mkdir -p build/build && cd build/build && ../../configure $CONFIGOPTS From 50f5b4f7f448e79d7460a14795d752a74b60eaaf Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 16 May 2014 20:46:35 +0100 Subject: [PATCH 034/152] Fix in source android examples clean --- Examples/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index c47c075e9..954a41c07 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -782,7 +782,7 @@ android_version: # ----------------------------------------------------------------- android_clean: - cd $(SRCDIR) && ant -q -logfile /dev/null clean + test -n "$(SRCDIR)" && cd $(SRCDIR) ; ant -q -logfile /dev/null clean rm -f $(INTERFACEDIR)$(TARGET)_wrap.* rm -f `find $(PACKAGEDIR) -name \*.java | grep -v $(PROJECTNAME).java` rm -rf obj From 46e5f722c337320807deeacc0e20c6a598390936 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 16 May 2014 21:08:06 +0100 Subject: [PATCH 035/152] Travis testing: check configure still runs after make maintainer-clean --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index da5929e1e..96e4fc9a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,7 +84,7 @@ script: - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi - echo 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r' - - make maintainer-clean + - make maintainer-clean && ../../configure $CONFIGOPTS - echo -en 'travis_fold:end:script.3\\r' branches: only: From b8b61be301a40521c2908e0236f04369e71749d3 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 17 May 2014 23:32:09 +0100 Subject: [PATCH 036/152] Detect Javascript v8 on 64 bit Linux --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e2cbe9fca..2ff5dc8db 100644 --- a/configure.ac +++ b/configure.ac @@ -1259,7 +1259,7 @@ else AC_MSG_CHECKING(for V8 Javascript library) AC_ARG_WITH(jsv8lib,[ --with-v8lib=path Set location of V8 Javascript library directory],[JSV8LIBDIR="$withval"], [JSV8LIB=]) - v8libdirs="$JSV8LIBDIR /usr/lib/ /usr/local/lib/" + v8libdirs="$JSV8LIBDIR /usr/lib*/ /usr/local/lib*/" for d in $v8libdirs ; do if test -r $d/libv8.so; then JSV8LIBDIR=$d From ac89f7f7854907f8b45b42ef1f447234d5eb1c64 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 18 May 2014 00:59:47 +0100 Subject: [PATCH 037/152] Javascript examples tidy up - Remove empty files - Improve clean --- .gitignore | 11 +++++++---- Examples/Makefile.in | 3 ++- Examples/javascript/functor/Makefile | 2 +- Examples/javascript/functor/binding.gyp.in | 2 +- Examples/javascript/functor/example.cxx | 0 Examples/javascript/pointer/typemaps.i | 0 Examples/test-suite/javascript/Makefile.in | 9 +++------ 7 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 Examples/javascript/functor/example.cxx delete mode 100644 Examples/javascript/pointer/typemaps.i diff --git a/.gitignore b/.gitignore index efb6cf096..c7961efd7 100644 --- a/.gitignore +++ b/.gitignore @@ -124,16 +124,19 @@ Examples/test-suite/uffi/*/ *_wrap.c *_wrap.cxx +# C# generated files +*_runme.exe.mdb +*_runme.exe + +# Javascript generated files +*.gyp + # Python generated files, based on: # https://github.com/github/gitignore/blob/master/Python.gitignore *.py[cod] */__pycache__/ /__pycache__/ -# C# generated files -*_runme.exe.mdb -*_runme.exe - # Scratch directories Examples/scratch diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 954a41c07..b22fd2e76 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -730,7 +730,8 @@ javascript_clean: rm -f *_wrap* $(RUNME) rm -f core @EXTRA_CLEAN@ rm -f *.@OBJEXT@ *@JSSO@ *.$(SO) - (cd $(ROOT_DIR)/Tools/javascript && $(MAKE) -s clean) + rm -f binding.gyp + cd $(ROOT_DIR)/Tools/javascript && $(MAKE) -s clean ################################################################## ##### ANDROID ###### diff --git a/Examples/javascript/functor/Makefile b/Examples/javascript/functor/Makefile index 54a8f7b03..0402f8d09 100644 --- a/Examples/javascript/functor/Makefile +++ b/Examples/javascript/functor/Makefile @@ -1,3 +1,3 @@ -SRCS = example.cxx +SRCS = include $(SRCDIR)../example.mk diff --git a/Examples/javascript/functor/binding.gyp.in b/Examples/javascript/functor/binding.gyp.in index c56a650e9..59779aef4 100644 --- a/Examples/javascript/functor/binding.gyp.in +++ b/Examples/javascript/functor/binding.gyp.in @@ -2,7 +2,7 @@ "targets": [ { "target_name": "example", - "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "sources": [ "example_wrap.cxx" ], "include_dirs": ["$srcdir"] } ] diff --git a/Examples/javascript/functor/example.cxx b/Examples/javascript/functor/example.cxx deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/javascript/pointer/typemaps.i b/Examples/javascript/pointer/typemaps.i deleted file mode 100644 index e69de29bb..000000000 diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index 87e4c6ecb..fc5255155 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -116,9 +116,6 @@ endif %.clean: rm -rf $* - -clean: - rm -f *_wrap.cxx - rm -f *_wrap.c - rm -f *.so - rm -f *.o + rm -f $*_wrap.* + rm -f $*.so + rm -f $*.o From 176c697c8b50856de8c2be99e1674c4a82c9f800 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 18 May 2014 01:06:56 +0100 Subject: [PATCH 038/152] Remove PHP director_basic runtime test until fixed. See #164 --- Examples/test-suite/php/director_basic_runme.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Examples/test-suite/php/director_basic_runme.php b/Examples/test-suite/php/director_basic_runme.php index de6b50502..1458725f1 100644 --- a/Examples/test-suite/php/director_basic_runme.php +++ b/Examples/test-suite/php/director_basic_runme.php @@ -3,6 +3,7 @@ require "tests.php"; require "director_basic.php"; +/* Removed until runtime error is fixed, see https://github.com/swig/swig/issues/164 // No new functions check::functions(array(foo_ping,foo_pong,foo_get_self,a_f,a_rg,a1_ff,myclass_method,myclass_vmethod,myclass_pmethod,myclass_cmethod,myclass_get_self,myclass_call_pmethod,myclasst_i_method)); // No new classes @@ -53,6 +54,7 @@ $cc->method($b); check::equal($bc->x, 34, "bc failed"); check::equal($bd->x, 16, "bd failed"); +*/ check::done(); ?> From 46cfdba5ca7c1385840005470ec433bef0ea8768 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 18 May 2014 01:36:29 +0100 Subject: [PATCH 039/152] Attempt to fix li_boost_intrusive_ptr C# compile error Using boost 1.36 and gcc-4.3.4 --- Examples/test-suite/li_boost_intrusive_ptr.i | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/test-suite/li_boost_intrusive_ptr.i b/Examples/test-suite/li_boost_intrusive_ptr.i index 4916d0285..01613be0e 100644 --- a/Examples/test-suite/li_boost_intrusive_ptr.i +++ b/Examples/test-suite/li_boost_intrusive_ptr.i @@ -14,13 +14,13 @@ %warnfilter(SWIGWARN_LANG_SMARTPTR_MISSING) KlassDerivedDerived; %{ -template void intrusive_ptr_add_ref(const T* r) { r->addref(); } -template void intrusive_ptr_release(const T* r) { r->release(); } - #include #include #include +template void intrusive_ptr_add_ref(const T* r) { r->addref(); } +template void intrusive_ptr_release(const T* r) { r->release(); } + // Uncomment macro below to turn on intrusive_ptr memory leak checking as described above //#define INTRUSIVE_PTR_WRAPPER From def3c08943ea533102dbb2b4b7a64607516f5d3b Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sun, 18 May 2014 20:20:30 +1200 Subject: [PATCH 040/152] Fix comment typos --- Examples/test-suite/lua/operator_overload_runme.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Examples/test-suite/lua/operator_overload_runme.lua b/Examples/test-suite/lua/operator_overload_runme.lua index 5ba06ff08..c34c09021 100644 --- a/Examples/test-suite/lua/operator_overload_runme.lua +++ b/Examples/test-suite/lua/operator_overload_runme.lua @@ -1,4 +1,4 @@ --- demo of lua swig capacilities (operator overloading) +-- demo of lua swig capacities (operator overloading) require("import") -- the import fn import("operator_overload") -- import lib @@ -33,7 +33,7 @@ assert(b>=c) assert(b>d) assert(b>=d) --- lua does not support += operators: skiping +-- lua does not support += operators: skipping -- test + f=Op(1) @@ -50,7 +50,7 @@ assert(f/g==Op(1)) --lua 5.0.2 defines that unary - is __unm(self,nil) --lua 5.1.2 defines that unary - is __unm(self,self) ---C++ expectes unary - as operator-() +--C++ expects unary - as operator-() --however the latest version of SWIG strictly checks the number of args --and will complain if too many args are provided --therefore disabling these tests for now @@ -79,7 +79,7 @@ assert(tostring(Op(1))=="Op(1)") assert(tostring(Op(-3))=="Op(-3)") --- check that operator overloads are correctly propogated down inheritance hierarchy +-- check that operator overloads are correctly propagated down inheritance hierarchy a_d=OpDerived() b_d=OpDerived(5) From 95f09b49d2be5804501e5e1eafe3cf8f58ff3510 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sun, 18 May 2014 20:38:43 +1200 Subject: [PATCH 041/152] Don't use // comments in C code. --- Lib/lua/luarun.swg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index d038f4af1..ad735a541 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -268,7 +268,7 @@ typedef struct swig_lua_class { swig_lua_method *methods; swig_lua_attribute *attributes; swig_lua_namespace *cls_static; - swig_lua_method *metatable; // 0 for -eluac + swig_lua_method *metatable; /* 0 for -eluac */ struct swig_lua_class **bases; const char **base_names; } swig_lua_class; @@ -1629,7 +1629,7 @@ SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_cla lua_pop(L,1); assert(lua_gettop(L) == begin); } -#endif // elua && eluac +#endif /* elua && eluac */ /* ----------------------------------------------------------------------------- * Class/structure conversion fns From aa55154ccfa967297181e886a350a36b03c64e07 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Sun, 18 May 2014 01:29:45 -0700 Subject: [PATCH 042/152] JavaScript: Added missing static modifiers to avoid duplicate symbol problems with multiple SWIG modules. --- Lib/javascript/jsc/javascriptcode.swg | 42 ++++++++++++------------ Lib/javascript/jsc/javascripthelpers.swg | 10 +++--- Lib/javascript/v8/javascripthelpers.swg | 12 +++---- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Lib/javascript/jsc/javascriptcode.swg b/Lib/javascript/jsc/javascriptcode.swg index 738b54d70..a5f395944 100644 --- a/Lib/javascript/jsc/javascriptcode.swg +++ b/Lib/javascript/jsc/javascriptcode.swg @@ -8,7 +8,7 @@ * ----------------------------------------------------------------------------- */ %fragment ("js_ctor", "templates") %{ -JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { $jslocals if(argc != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper."); @@ -28,7 +28,7 @@ JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc * ----------------------------------------------------------------------------- */ %fragment ("js_veto_ctor", "templates") %{ -JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, +static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { SWIG_exception(SWIG_ERROR, "Class $jsname can not be instantiated"); @@ -44,7 +44,7 @@ JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, * ----------------------------------------------------------------------------- */ %fragment ("js_ctor_dispatcher", "templates") %{ -JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, +static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { JSObjectRef thisObject = NULL; @@ -70,7 +70,7 @@ JSObjectRef $jswrapper(JSContextRef context, JSObjectRef ctorObject, * ----------------------------------------------------------------------------- */ %fragment ("js_overloaded_ctor", "templates") %{ -JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { $jslocals $jscode @@ -105,7 +105,7 @@ JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size_t argc * ----------------------------------------------------------------------------- */ %fragment ("js_dtor", "templates") %{ -void $jswrapper(JSObjectRef thisObject) +static void $jswrapper(JSObjectRef thisObject) { SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); if(t && t->swigCMemOwn) free (($jstype)t->swigCObject); @@ -121,7 +121,7 @@ void $jswrapper(JSObjectRef thisObject) * ----------------------------------------------------------------------------- */ %fragment ("js_dtoroverride", "templates") %{ -void $jswrapper(JSObjectRef thisObject) +static void $jswrapper(JSObjectRef thisObject) { SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); if(t && t->swigCMemOwn) { @@ -140,7 +140,7 @@ void $jswrapper(JSObjectRef thisObject) * ----------------------------------------------------------------------------- */ %fragment ("js_getter", "templates") %{ -JSValueRef $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +static JSValueRef $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { $jslocals JSValueRef jsresult; @@ -162,7 +162,7 @@ JSValueRef $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef * ----------------------------------------------------------------------------- */ %fragment ("js_setter", "templates") %{ -bool $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +static bool $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { $jslocals $jscode @@ -183,7 +183,7 @@ bool $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStringRef proper * ----------------------------------------------------------------------------- */ %fragment ("js_function", "templates") %{ -JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { $jslocals JSValueRef jsresult; @@ -208,7 +208,7 @@ JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef th * ----------------------------------------------------------------------------- */ %fragment ("js_function_dispatcher", "templates") %{ -JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { $jslocals JSValueRef jsresult; @@ -232,7 +232,7 @@ JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef th * ----------------------------------------------------------------------------- */ %fragment ("js_overloaded_function", "templates") %{ -int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) +static int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) { $jslocals JSValueRef jsresult; @@ -291,11 +291,11 @@ int $jswrapper(JSContextRef context, JSObjectRef function, JSObjectRef thisObjec * ----------------------------------------------------------------------------- */ %fragment ("jsc_class_declaration", "templates") %{ -JSClassDefinition $jsmangledname_classDefinition; +static JSClassDefinition $jsmangledname_classDefinition; -JSClassDefinition $jsmangledname_objectDefinition; +static JSClassDefinition $jsmangledname_objectDefinition; -JSClassRef $jsmangledname_classRef; +static JSClassRef $jsmangledname_classRef; %} /* ----------------------------------------------------------------------------- @@ -308,22 +308,22 @@ JSClassRef $jsmangledname_classRef; * ----------------------------------------------------------------------------- */ %fragment ("jsc_class_tables", "templates") %{ -JSStaticValue $jsmangledname_staticValues[] = { +static JSStaticValue $jsmangledname_staticValues[] = { $jsstaticclassvariables { 0, 0, 0, 0 } }; -JSStaticFunction $jsmangledname_staticFunctions[] = { +static JSStaticFunction $jsmangledname_staticFunctions[] = { $jsstaticclassfunctions { 0, 0, 0 } }; -JSStaticValue $jsmangledname_values[] = { +static JSStaticValue $jsmangledname_values[] = { $jsclassvariables { 0, 0, 0, 0 } }; -JSStaticFunction $jsmangledname_functions[] = { +static JSStaticFunction $jsmangledname_functions[] = { $jsclassfunctions { 0, 0, 0 } }; @@ -382,17 +382,17 @@ JSStaticFunction $jsmangledname_functions[] = { * ----------------------------------------------------------------------------- */ %fragment ("jsc_nspace_declaration", "templates") %{ -JSStaticValue $jsnspace_values[] = { +static JSStaticValue $jsnspace_values[] = { $jsglobalvariables { 0, 0, 0, 0 } }; -JSStaticFunction $jsnspace_functions[] = { +static JSStaticFunction $jsnspace_functions[] = { $jsglobalfunctions { 0, 0, 0 } }; -JSClassDefinition $jsnspace_classDefinition; +static JSClassDefinition $jsnspace_classDefinition; %} /* ----------------------------------------------------------------------------- diff --git a/Lib/javascript/jsc/javascripthelpers.swg b/Lib/javascript/jsc/javascripthelpers.swg index 820075ca6..405280161 100644 --- a/Lib/javascript/jsc/javascripthelpers.swg +++ b/Lib/javascript/jsc/javascripthelpers.swg @@ -1,6 +1,6 @@ %insert(wrapper) %{ -bool JS_registerClass(JSGlobalContextRef context, JSObjectRef parentObject, +SWIGINTERN bool JS_registerClass(JSGlobalContextRef context, JSObjectRef parentObject, const char* className, JSClassDefinition* definition) { @@ -14,7 +14,7 @@ bool JS_registerClass(JSGlobalContextRef context, JSObjectRef parentObject, return true; } -bool JS_registerNamespace(JSGlobalContextRef context, +SWIGINTERN bool JS_registerNamespace(JSGlobalContextRef context, JSObjectRef namespaceObj, JSObjectRef parentNamespace, const char* name) { @@ -28,7 +28,7 @@ bool JS_registerNamespace(JSGlobalContextRef context, } -bool JS_registerFunction(JSGlobalContextRef context, JSObjectRef object, +SWIGINTERN bool JS_registerFunction(JSGlobalContextRef context, JSObjectRef object, const char* functionName, JSObjectCallAsFunctionCallback callback) { JSStringRef js_functionName = JSStringCreateWithUTF8CString(functionName); @@ -39,7 +39,7 @@ bool JS_registerFunction(JSGlobalContextRef context, JSObjectRef object, return true; } -bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +SWIGINTERN bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { char buffer[256]; char msg[512]; @@ -57,7 +57,7 @@ bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObject, JSString return false; } -JSValueRef JS_CharPtrToJSValue(JSContextRef context, char* cstr) { +SWIGINTERN JSValueRef JS_CharPtrToJSValue(JSContextRef context, char* cstr) { JSValueRef val; JSStringRef jsstring = JSStringCreateWithUTF8CString((char*) cstr); diff --git a/Lib/javascript/v8/javascripthelpers.swg b/Lib/javascript/v8/javascripthelpers.swg index 8da6627e2..f6303cced 100644 --- a/Lib/javascript/v8/javascripthelpers.swg +++ b/Lib/javascript/v8/javascripthelpers.swg @@ -16,7 +16,7 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfoVoid; /** * Creates a class template for a class with specified initialization function. */ -v8::Handle SWIGV8_CreateClassTemplate(const char* symbol) { +SWIGRUNTIME v8::Handle SWIGV8_CreateClassTemplate(const char* symbol) { v8::HandleScope scope; v8::Local class_templ = v8::FunctionTemplate::New(); class_templ->SetClassName(v8::String::NewSymbol(symbol)); @@ -36,7 +36,7 @@ v8::Handle SWIGV8_CreateClassTemplate(const char* symbol) /** * Registers a class method with given name for a given class template. */ -void SWIGV8_AddMemberFunction(v8::Handle class_templ, const char* symbol, +SWIGRUNTIME void SWIGV8_AddMemberFunction(v8::Handle class_templ, const char* symbol, SwigV8FunctionCallback _func) { v8::Handle proto_templ = class_templ->PrototypeTemplate(); proto_templ->Set(v8::String::NewSymbol(symbol), v8::FunctionTemplate::New(_func)); @@ -45,7 +45,7 @@ void SWIGV8_AddMemberFunction(v8::Handle class_templ, cons /** * Registers a class property with given name for a given class template. */ -void SWIGV8_AddMemberVariable(v8::Handle class_templ, const char* symbol, +SWIGRUNTIME void SWIGV8_AddMemberVariable(v8::Handle class_templ, const char* symbol, SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { v8::Handle proto_templ = class_templ->InstanceTemplate(); proto_templ->SetAccessor(v8::String::NewSymbol(symbol), getter, setter); @@ -54,7 +54,7 @@ void SWIGV8_AddMemberVariable(v8::Handle class_templ, cons /** * Registers a class method with given name for a given object. */ -void SWIGV8_AddStaticFunction(v8::Handle obj, const char* symbol, +SWIGRUNTIME void SWIGV8_AddStaticFunction(v8::Handle obj, const char* symbol, const SwigV8FunctionCallback& _func) { obj->Set(v8::String::NewSymbol(symbol), v8::FunctionTemplate::New(_func)->GetFunction()); } @@ -62,12 +62,12 @@ void SWIGV8_AddStaticFunction(v8::Handle obj, const char* symbol, /** * Registers a class method with given name for a given object. */ -void SWIGV8_AddStaticVariable(v8::Handle obj, const char* symbol, +SWIGRUNTIME void SWIGV8_AddStaticVariable(v8::Handle obj, const char* symbol, SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { obj->SetAccessor(v8::String::NewSymbol(symbol), getter, setter); } -void JS_veto_set_variable(v8::Local property, v8::Local value, +SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid& info) { char buffer[256]; From b4534a481aa370a58d376522ea67072fcc446d8f Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Sun, 18 May 2014 01:32:26 -0700 Subject: [PATCH 043/152] JavaScriptCore: Bug fix for finalizer. The finalizer needs to be set on the objectDefinition, not the classDefinition. Otherwise, all the finalize callbacks get NULL back for the PrivateData and can't free the SwigPrivData, causing massive leakage. --- Lib/javascript/jsc/javascriptcode.swg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/javascript/jsc/javascriptcode.swg b/Lib/javascript/jsc/javascriptcode.swg index a5f395944..da6130a6a 100644 --- a/Lib/javascript/jsc/javascriptcode.swg +++ b/Lib/javascript/jsc/javascriptcode.swg @@ -341,7 +341,7 @@ static JSStaticFunction $jsmangledname_functions[] = { $jsmangledname_classDefinition.staticFunctions = $jsmangledname_staticFunctions; $jsmangledname_classDefinition.staticValues = $jsmangledname_staticValues; $jsmangledname_classDefinition.callAsConstructor = $jsctor; - $jsmangledname_classDefinition.finalize = $jsdtor; + $jsmangledname_objectDefinition.finalize = $jsdtor; $jsmangledname_objectDefinition.staticValues = $jsmangledname_values; $jsmangledname_objectDefinition.staticFunctions = $jsmangledname_functions; $jsclass_inheritance From fcb48336605474e97e73ca2bc89076ee01e0b8fa Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Sun, 18 May 2014 20:33:10 +0200 Subject: [PATCH 044/152] JavascriptCore: fix cleanup code. --- Lib/javascript/jsc/javascriptcode.swg | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Lib/javascript/jsc/javascriptcode.swg b/Lib/javascript/jsc/javascriptcode.swg index da6130a6a..3fe9d49e9 100644 --- a/Lib/javascript/jsc/javascriptcode.swg +++ b/Lib/javascript/jsc/javascriptcode.swg @@ -108,8 +108,13 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size static void $jswrapper(JSObjectRef thisObject) { SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t && t->swigCMemOwn) free (($jstype)t->swigCObject); - if(t) free(t); + if(t) { + if (t->swigCMemOwn) { + free (($jstype)t->swigCObject); + } + JSObjectSetPrivate(thisObject, NULL); + free(t); + } } %} @@ -124,11 +129,15 @@ static void $jswrapper(JSObjectRef thisObject) static void $jswrapper(JSObjectRef thisObject) { SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); - if(t && t->swigCMemOwn) { - $jstype arg1 = ($jstype)t->swigCObject; - ${destructor_action} + if(t) { + if (t->swigCMemOwn) { + $jstype arg1 = ($jstype)t->swigCObject; + ${destructor_action} + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); } - if(t) free(t); } %} From 486e903de1bbf847a0a60aa85ab1e1a44c8ca159 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Sun, 18 May 2014 01:35:46 -0700 Subject: [PATCH 045/152] JavaScriptCore: Bug fix for SWIGJSC_AppendOutput. This function requires a return value. I think it should be arr, but somebody should scrutinize this. --- Lib/javascript/jsc/javascriptrun.swg | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 3463d2351..95f00659d 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -295,4 +295,5 @@ JSValueRef SWIGJSC_AppendOutput(JSContextRef context, JSValueRef value, JSValueR length = SWIGJSC_ArrayLength(context, arr); JSObjectSetPropertyAtIndex(context, arr, length, obj, 0); + return arr; } From fade0bcbdef3a1127d677f6ff72be064bcda5a57 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Sun, 18 May 2014 01:50:05 -0700 Subject: [PATCH 046/152] JavaScriptCore: C89: declare variables at the top for antiquated compilers like Microsoft Visual Studio. --- Lib/javascript/jsc/javascriptrun.swg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 95f00659d..fce22a452 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -128,11 +128,12 @@ int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** } int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { + JSObjectRef objRef; if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; } - JSObjectRef objRef = JSValueToObject(context, valRef, NULL); + objRef = JSValueToObject(context, valRef, NULL); if(objRef == NULL) { return SWIG_ERROR; } From 8498e4878d130a6ae24843084408339f3bf910ce Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Sun, 18 May 2014 03:03:46 -0700 Subject: [PATCH 047/152] JavaScriptCore: More missing static modifiers. --- Lib/javascript/jsc/javascriptrun.swg | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index fce22a452..813c7deb4 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -7,13 +7,13 @@ #define SWIG_exception(code, msg) SWIG_JSC_exception(context, exception, code, msg) #define SWIG_fail goto fail -void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* type) { +SWIGRUNTIME void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* type) { JSStringRef message = JSStringCreateWithUTF8CString(type); *exception = JSValueMakeString(context, message); JSStringRelease(message); } -void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { +SWIGRUNTIME void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { SWIG_Javascript_Raise(context, exception, msg); } @@ -28,7 +28,7 @@ typedef struct { swig_type_info *info; } SwigPrivData; -JSValueRef _wrap_SwigObject_disown(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +SWIGRUNTIME JSValueRef _wrap_SwigObject_disown(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { JSValueRef jsresult; @@ -41,7 +41,7 @@ JSValueRef _wrap_SwigObject_disown(JSContextRef context, JSObjectRef function, J return jsresult; } -JSValueRef _wrap_SwigObject_getCPtr(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +SWIGRUNTIME JSValueRef _wrap_SwigObject_getCPtr(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { JSValueRef jsresult; long result; @@ -55,7 +55,7 @@ JSValueRef _wrap_SwigObject_getCPtr(JSContextRef context, JSObjectRef function, return jsresult; } -JSValueRef _wrap_SwigObject_equals(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +SWIGRUNTIME JSValueRef _wrap_SwigObject_equals(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) { JSValueRef jsresult; bool result; @@ -72,13 +72,13 @@ JSValueRef _wrap_SwigObject_equals(JSContextRef context, JSObjectRef function, J return jsresult; } -JSStaticValue _SwigObject_values[] = { +SWIGRUNTIME JSStaticValue _SwigObject_values[] = { { 0, 0, 0, 0 } }; -JSStaticFunction _SwigObject_functions[] = { +SWIGRUNTIME JSStaticFunction _SwigObject_functions[] = { { "disown",_wrap_SwigObject_disown, kJSPropertyAttributeNone }, @@ -93,12 +93,12 @@ JSStaticFunction _SwigObject_functions[] = { } }; -JSClassDefinition _SwigObject_objectDefinition; +SWIGRUNTIME JSClassDefinition _SwigObject_objectDefinition; -JSClassRef _SwigObject_classRef; +SWIGRUNTIME JSClassRef _SwigObject_classRef; -int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { +SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); if(cdata == NULL) { return SWIG_ERROR; @@ -127,7 +127,7 @@ int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** return SWIG_OK; } -int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { +SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { JSObjectRef objRef; if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; @@ -141,7 +141,7 @@ int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swi return SWIG_JSC_ConvertInstancePtr(context, objRef, ptr, info, flags); } -JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { +SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { JSClassRef classRef; if(info->clientdata == NULL) { @@ -182,18 +182,18 @@ typedef struct { swig_type_info *type; } SwigPackedData; -JSStaticValue _SwigPackedData_values[] = { +SWIGRUNTIME JSStaticValue _SwigPackedData_values[] = { { 0, 0, 0, 0 } }; -JSStaticFunction _SwigPackedData_functions[] = { +SWIGRUNTIME JSStaticFunction _SwigPackedData_functions[] = { { 0, 0, 0 } }; -JSClassDefinition _SwigPackedData_objectDefinition; -JSClassRef _SwigPackedData_classRef; +SWIGRUNTIME JSClassDefinition _SwigPackedData_objectDefinition; +SWIGRUNTIME JSClassRef _SwigPackedData_classRef; SWIGRUNTIMEINLINE int SwigJSCPacked_Check(JSContextRef context, JSValueRef valRef) { @@ -244,7 +244,7 @@ JSValueRef SWIG_JSC_NewPackedObj(JSContextRef context, void *data, size_t size, } /* SwigPackedData wrappers */ - +SWIGRUNTIME void _wrap_SwigPackedData_delete(JSObjectRef obj) { SwigPackedData* cdata = (SwigPackedData*) JSObjectGetPrivate(obj); @@ -263,7 +263,7 @@ void _wrap_SwigPackedData_delete(JSObjectRef obj) * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) * * ---------------------------------------------------------------------------*/ - +SWIGRUNTIME unsigned int SWIGJSC_ArrayLength(JSContextRef context, JSObjectRef arr) { static JSStringRef LENGTH = 0; JSValueRef exception = NULL; From 05ed0325dc4bd9ddc126d3dacc6b38686f7382cf Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Sun, 18 May 2014 03:43:47 -0700 Subject: [PATCH 048/152] JavaScriptCore: ConvertPtr should allow JavaScript null to be a valid value. It is common in C to accept NULL to functions for pointer parameters. extern void DoSomething(struct Foo* foo); ... DoSomething(NULL); Thus, JavaScript null should be allowed: module.DoSomething(null); But the current ConvertPtr definition accepts only objects. This modifies it to allow null. --- Lib/javascript/jsc/javascriptrun.swg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 813c7deb4..9655b0eb6 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -129,6 +129,13 @@ SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef ob SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { JSObjectRef objRef; + + /* special case: JavaScript null => C NULL pointer */ + if(JSValueIsNull(context, valRef)) { + *ptr=0; + return SWIG_OK; + } + if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; } From 7824322b146f67590c1a460f88379bce3a7d4d58 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Sun, 18 May 2014 22:40:22 +0200 Subject: [PATCH 049/152] Javascript: fix warnings in li_std_string test. Old typemaps for std::string were in place instead of delegating to UTL. --- Lib/javascript/jsc/std_string.i | 70 +---------------------------- Lib/javascript/v8/std_string.i | 80 +-------------------------------- 2 files changed, 2 insertions(+), 148 deletions(-) diff --git a/Lib/javascript/jsc/std_string.i b/Lib/javascript/jsc/std_string.i index fb1bd62b5..dc1378ae6 100644 --- a/Lib/javascript/jsc/std_string.i +++ b/Lib/javascript/jsc/std_string.i @@ -1,69 +1 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for const std::string&. - * To use non-const std::string references use the following %apply: - * %apply const std::string & {std::string &}; - * - * ----------------------------------------------------------------------------- */ - -%{ -#include - -std::string SWIGJSC_valueToString(JSContextRef context, JSValueRef value) { - JSStringRef jsstring = JSValueToStringCopy(context, value, /* JSValueRef *exception */ 0); - unsigned int length = JSStringGetLength(jsstring); - char *cstr = new char[length + 1]; - JSStringGetUTF8CString(jsstring, cstr, length + 1); - - // create a copy - std::string result(cstr); - - JSStringRelease(jsstring); - delete[] cstr; - - return result; -} - -JSValueRef SWIGJSC_stringToValue(JSContextRef context, const std::string& s) -{ - JSValueRef result; - JSStringRef jsstring = JSStringCreateWithUTF8CString(s.c_str()); - result = JSValueMakeString(context, jsstring); - JSStringRelease(jsstring); - return result; -} -%} - -namespace std { - %naturalvar string; - - class string; - - - %typemap(in) string - %{ - $1 = SWIGJSC_valueToString(context, $input); - %} - - %typemap(in) const string & - %{ - $1 = new std::string(SWIGJSC_valueToString(context, $input)); - %} - - %typemap(freearg) const string & - %{ - delete $1; - %} - - %typemap(out) string - %{ - $result = SWIGJSC_stringToValue(context, $1); - %} - - %typemap(out) const string & - %{ - $result = SWIGJSC_stringToValue(context, *$1); - %} - -} +%include diff --git a/Lib/javascript/v8/std_string.i b/Lib/javascript/v8/std_string.i index 5ad1ead27..dc1378ae6 100644 --- a/Lib/javascript/v8/std_string.i +++ b/Lib/javascript/v8/std_string.i @@ -1,79 +1 @@ -/* ----------------------------------------------------------------------------- - * std_string.i - * - * Typemaps for std::string and const std::string&. - * - * To use non-const std::string references use the following %apply: - * %apply const std::string & {std::string &}; - * - * ----------------------------------------------------------------------------- */ - -%{ -#include -%} - -%fragment("SWIGV8_valueToString", "header", fragment="SWIG_AsCharPtrAndSize") { -std::string* SWIGV8_valueToStringPtr(v8::Handle val) { - - if (!val->IsString()) return 0; - - int alloc; - size_t size; - char* chars; - int res = SWIG_AsCharPtrAndSize(val, &chars, &size, &alloc); - - if(res != SWIG_OK) { - v8::ThrowException(v8::Exception::TypeError(v8::String::New("Could not convert to string."))); - return 0; - } - - // copies the data (again) - std::string *str = new std::string(chars); - - if (alloc) delete[] chars; - - return str; -} -} - -%fragment("SWIGV8_stringToValue", "header", fragment="SWIG_FromCharPtrAndSize") { -v8::Handle SWIGV8_stringToValue(const std::string &str) { - return SWIG_FromCharPtrAndSize(str.c_str(), str.length()); -} -} - -namespace std { - %naturalvar string; - - class string; - - %typemap(in, fragment="SWIGV8_valueToString") string (std::string* tmp) - %{ - tmp = SWIGV8_valueToStringPtr($input); - $1 = *tmp; - if (tmp == 0) { v8::ThrowException(v8::Exception::TypeError(v8::String::New("Null pointer."))); goto fail; } - if (tmp) delete tmp; - %} - - %typemap(in, fragment="SWIGV8_valueToString") const string & - %{ - $1 = SWIGV8_valueToStringPtr($input); - if ($1 == 0) { v8::ThrowException(v8::Exception::TypeError(v8::String::New("Null pointer."))); goto fail; } - %} - - %typemap(freearg) const string & - %{ - if ($1) delete $1; - %} - - %typemap(out, fragment="SWIGV8_stringToValue") string - %{ - $result = SWIGV8_stringToValue($1); - %} - - %typemap(out, fragment="SWIGV8_stringToValue") const string & - %{ - $result = SWIGV8_stringToValue(*$1); - %} - -} +%include From d2ab75f9071ae15d98dbf091f6461ef397d66ef5 Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Mon, 19 May 2014 02:05:23 +0400 Subject: [PATCH 050/152] obscure case workaround in std::set wrapper, where ignored type still need to be processed --- Source/Modules/typepass.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Modules/typepass.cxx b/Source/Modules/typepass.cxx index ec6f64587..3e323f910 100644 --- a/Source/Modules/typepass.cxx +++ b/Source/Modules/typepass.cxx @@ -661,15 +661,15 @@ class TypePass:private Dispatcher { * ------------------------------------------------------------ */ virtual int cDeclaration(Node *n) { - if (GetFlag(n, "feature:ignore")) { - return SWIG_OK; - } if (NoExcept) { Delattr(n, "throws"); } /* Normalize types. */ SwigType *ty = Getattr(n, "type"); + if (!ty) { + return SWIG_OK; + } normalize_type(ty); SwigType *decl = Getattr(n, "decl"); if (decl) { From 0c42158723ad29ddd199fc1eeb959bf777f7062f Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 00:20:19 +0200 Subject: [PATCH 051/152] Javascript: preparations for using Language::getNSpace(). --- Source/Modules/javascript.cxx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx index 20af76f9f..e535bc179 100644 --- a/Source/Modules/javascript.cxx +++ b/Source/Modules/javascript.cxx @@ -318,6 +318,10 @@ public: **/ virtual int fragmentDirective(Node *n); +public: + + virtual String *getNSpace() const; + private: JSEmitter *emitter; @@ -467,6 +471,10 @@ int JAVASCRIPT::fragmentDirective(Node *n) { return SWIG_OK; } +String *JAVASCRIPT::getNSpace() const { + return Language::getNSpace(); +} + /* --------------------------------------------------------------------- * top() * @@ -1346,14 +1354,26 @@ int JSEmitter::switchNamespace(Node *n) { return SWIG_OK; } - String *nspace = Getattr(n, "sym:nspace"); - // if nspace is deactivated, everything goes into the global scope if (!GetFlag(n, "feature:nspace")) { current_namespace = Getattr(namespaces, "::"); return SWIG_OK; } +// EXPERIMENTAL: we want to use Language::getNSpace() here +// However, it is not working yet. +// For namespace functions Language::getNSpace() does not give a valid result +#if 0 + JAVASCRIPT *lang = static_cast(Language::instance()); + String *_nspace = lang->getNSpace(); + if (!Equal(nspace, _nspace)) { + Printf(stdout, "##### Custom vs Language::getNSpace(): %s | %s\n", nspace, _nspace); + Swig_print_node(n); + } +#endif + + String *nspace = Getattr(n, "sym:nspace"); + if (nspace == NULL) { // It seems that only classes have 'sym:nspace' set. // We try to get the namespace from the qualified name (i.e., everything before the last '::') From 11963788e0d008e1c6e997577086cd8dd584c03f Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 00:21:21 +0200 Subject: [PATCH 052/152] Javascript: support null pointers. We allow to set pointer types using JS null. --- .../javascript/null_pointer_runme.js | 9 +++++++++ Lib/javascript/jsc/javascriptrun.swg | 18 +++++++++++++----- Lib/javascript/v8/javascriptrun.swg | 12 ++++++++++-- 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 Examples/test-suite/javascript/null_pointer_runme.js diff --git a/Examples/test-suite/javascript/null_pointer_runme.js b/Examples/test-suite/javascript/null_pointer_runme.js new file mode 100644 index 000000000..7c0d61244 --- /dev/null +++ b/Examples/test-suite/javascript/null_pointer_runme.js @@ -0,0 +1,9 @@ +var null_pointer = require("null_pointer"); + +if (!null_pointer.func(null)) { + throw new Error("Javascript 'null' should be converted into NULL."); +} + +if (null_pointer.getnull() != null) { + throw new Error("NULL should be converted into Javascript 'null'."); +} diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 9655b0eb6..1ff10a183 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -99,7 +99,9 @@ SWIGRUNTIME JSClassRef _SwigObject_classRef; SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { - SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); + SwigPrivData *cdata; + + cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); if(cdata == NULL) { return SWIG_ERROR; } @@ -135,7 +137,7 @@ SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, voi *ptr=0; return SWIG_OK; } - + if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; } @@ -149,17 +151,23 @@ SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, voi } SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { - JSClassRef classRef; + JSObjectRef result; + SwigPrivData *cdata; + + if (ptr == NULL) { + return JSValueToObject(context, JSValueMakeNull(context), 0); + } + if(info->clientdata == NULL) { classRef = _SwigObject_classRef; } else { classRef = (JSClassRef) info->clientdata; } - JSObjectRef result = JSObjectMake(context, classRef, NULL); + result = JSObjectMake(context, classRef, NULL); - SwigPrivData* cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); + cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); cdata->swigCObject = ptr; cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; cdata->info = info; diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg index 2e0a46717..f200f1520 100644 --- a/Lib/javascript/v8/javascriptrun.swg +++ b/Lib/javascript/v8/javascriptrun.swg @@ -220,7 +220,11 @@ void SWIGV8_SetPrivateData(v8::Handle obj, void* ptr, swig_type_info int SWIG_V8_ConvertPtr(v8::Handle valRef, void** ptr, swig_type_info *info, int flags) { v8::HandleScope scope; - + /* special case: JavaScript null => C NULL pointer */ + if(valRef->IsNull()) { + *ptr=0; + return SWIG_OK; + } if(!valRef->IsObject()) { return SWIG_TypeError; } @@ -228,10 +232,14 @@ int SWIG_V8_ConvertPtr(v8::Handle valRef, void** ptr, swig_type_info return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); } -v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { +v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { v8::HandleScope scope; v8::Handle class_templ; + if (ptr == NULL) { + return scope.Close(v8::Null()); + } + #if (SWIG_V8_VERSION < 0x031900) if(info->clientdata != 0) { class_templ = ((SWIGV8_ClientData*) info->clientdata)->class_templ; From 243671700fd8ac0e18880962c19bf10cf4d91e1b Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 18 May 2014 23:09:58 +0100 Subject: [PATCH 053/152] Fix li_boost_intrusive_ptr for various versions of boost Modify testcase to fix compile errors on various versions of boost. Tested using various combinations from boost-1.33/gcc-3.4.2 to boost-1.53/gcc-4.7.3. Originally noticed as broken on boost-1.36/gcc-4.3.4 on SLE 11. Add in some diagnostics when reference count is wrong... which does still happen occasionally. --- .../java/li_boost_intrusive_ptr_runme.java | 20 ++++++++++--------- Examples/test-suite/li_boost_intrusive_ptr.i | 15 +++++++++++--- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java b/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java index 530008a87..750ec5067 100644 --- a/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java +++ b/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java @@ -33,7 +33,7 @@ public class li_boost_intrusive_ptr_runme { // Change loop count to run for a long time to monitor memory final int loopCount = 5000; //5000; for (int i=0; i #include #include -template void intrusive_ptr_add_ref(const T* r) { r->addref(); } -template void intrusive_ptr_release(const T* r) { r->release(); } - // Uncomment macro below to turn on intrusive_ptr memory leak checking as described above //#define INTRUSIVE_PTR_WRAPPER @@ -132,6 +135,8 @@ struct Klass { void release(void) const { if (--count == 0) delete this; } int use_count(void) const { return count; } static long getTotal_count() { return total_count; } + friend void intrusive_ptr_add_ref(const Klass* r) { r->addref(); } + friend void intrusive_ptr_release(const Klass* r) { r->release(); } private: static void increment() { ++total_count; if (debug_shared) cout << " ++xxxxx Klass::increment tot: " << total_count << endl;} @@ -177,6 +182,8 @@ struct IgnoredRefCountingBase { void addref(void) const { ++count; } void release(void) const { if (--count == 0) delete this; } int use_count(void) const { return count; } + inline friend void intrusive_ptr_add_ref(const IgnoredRefCountingBase* r) { r->addref(); } + inline friend void intrusive_ptr_release(const IgnoredRefCountingBase* r) { r->release(); } static long getTotal_count() { return total_count; } private: @@ -414,6 +421,8 @@ template struct Base { void addref(void) const { count++; } void release(void) const { if (--count == 0) delete this; } int use_count(void) const { return count; } + inline friend void intrusive_ptr_add_ref(const Base* r) { r->addref(); } + inline friend void intrusive_ptr_release(const Base* r) { r->release(); } }; %} From a64549034c5579a148c37c7f3e070c8704dca459 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 00:58:32 +0200 Subject: [PATCH 054/152] Javascript: generalise test-case 'typemap_variables' so that it can be used for Javascript V8. The original version contains output typemaps that produced incompatible code. Introduce a pre-processor macro that is set to a valid value for v8. --- Examples/test-suite/javascript/Makefile.in | 8 ------- Examples/test-suite/typemap_variables.i | 27 +++++++++++++++------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index fc5255155..be4350d1e 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -28,14 +28,6 @@ _setup = \ echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $*" ; \ fi; -ifneq (jsc,$(ENGINE)) - - # This test can not be run with v8 as it uses v8 API incompatible output typemaps - typemap_variables.cpptest: - echo "skipping $(LANGUAGE) ($(JSENGINE)) testcase typemap_variables" ; - -endif - ifeq (node,$(JSENGINE)) SWIGOPT += -v8 -DBUILDING_NODE_EXTENSION=1 diff --git a/Examples/test-suite/typemap_variables.i b/Examples/test-suite/typemap_variables.i index 142e35060..047007a1c 100644 --- a/Examples/test-suite/typemap_variables.i +++ b/Examples/test-suite/typemap_variables.i @@ -13,33 +13,44 @@ %} #endif +// For Javascript V8 we can not use '0' for out typemaps +#if defined(SWIG_JAVASCRIPT_V8) +%header %{ +#define OUT_NULL_VALUE v8::Null() +%} +#else +%header %{ +#define OUT_NULL_VALUE 0 +%} +#endif + // Scripting languages use varin/varout for variables (except non-static member variables where in/out are used ???) %typemap(varin) int "this_will_not_compile_varin " %typemap(varout) int "this_will_not_compile_varout" %typemap(varin) int globul "/*int globul varin */ TYPEMAP_VARIABLES_FAIL" -%typemap(varout) int globul "/*int globul varout*/ $result=0;" +%typemap(varout) int globul "/*int globul varout*/ $result=OUT_NULL_VALUE;" %typemap(varin) int Space::nspace "/*int nspace varin */ TYPEMAP_VARIABLES_FAIL" -%typemap(varout) int Space::nspace "/*int nspace varout*/ $result=0;" +%typemap(varout) int Space::nspace "/*int nspace varout*/ $result=OUT_NULL_VALUE;" //%typemap(varin) int member "/*int member varin */" -//%typemap(varout) int member "/*int member varout*/ $result=0;" +//%typemap(varout) int member "/*int member varout*/ $result=OUT_NULL_VALUE;" %typemap(varin) int Space::Struct::smember "/*int smember varin */ TYPEMAP_VARIABLES_FAIL" -%typemap(varout) int Space::Struct::smember "/*int smember varout*/ $result=0;" +%typemap(varout) int Space::Struct::smember "/*int smember varout*/ $result=OUT_NULL_VALUE;" // Statically typed languages use in/out for variables %typemap(in) int "this_will_not_compile_in " %typemap(out) int "this_will_not_compile_out" %typemap(in) int globul "/*int globul in */ $1=0;" -%typemap(out) int globul "/*int globul out*/ $result=0;" +%typemap(out) int globul "/*int globul out*/ $result=OUT_NULL_VALUE;" %typemap(in) int Space::nspace "/*int nspace in */ $1=0;" -%typemap(out) int Space::nspace "/*int nspace out*/ $result=0;" +%typemap(out) int Space::nspace "/*int nspace out*/ $result=OUT_NULL_VALUE;" %typemap(in) int member "/*int member in */ $1=0;" #ifdef SWIGTCL %typemap(out) int member "/*int member out*/" #else -%typemap(out) int member "/*int member out*/ $result=0;" +%typemap(out) int member "/*int member out*/ $result=OUT_NULL_VALUE;" #endif %typemap(in) int Space::Struct::smember "/*int smember in */ $1=0;" -%typemap(out) int Space::Struct::smember "/*int smember out*/ $result=0;" +%typemap(out) int Space::Struct::smember "/*int smember out*/ $result=OUT_NULL_VALUE;" %typemap(javain) int "this_will_not_compile_javain " %typemap(javaout) int "this_will_not_compile_javaout" From 7cc617a19d2c7834ee877af920a824cd29a92a89 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 11:46:21 +0200 Subject: [PATCH 055/152] Revert "Javascript: support null pointers." This reverts commit 11963788e0d008e1c6e997577086cd8dd584c03f. --- .../javascript/null_pointer_runme.js | 9 --------- Lib/javascript/jsc/javascriptrun.swg | 18 +++++------------- Lib/javascript/v8/javascriptrun.swg | 12 ++---------- 3 files changed, 7 insertions(+), 32 deletions(-) delete mode 100644 Examples/test-suite/javascript/null_pointer_runme.js diff --git a/Examples/test-suite/javascript/null_pointer_runme.js b/Examples/test-suite/javascript/null_pointer_runme.js deleted file mode 100644 index 7c0d61244..000000000 --- a/Examples/test-suite/javascript/null_pointer_runme.js +++ /dev/null @@ -1,9 +0,0 @@ -var null_pointer = require("null_pointer"); - -if (!null_pointer.func(null)) { - throw new Error("Javascript 'null' should be converted into NULL."); -} - -if (null_pointer.getnull() != null) { - throw new Error("NULL should be converted into Javascript 'null'."); -} diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 1ff10a183..9655b0eb6 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -99,9 +99,7 @@ SWIGRUNTIME JSClassRef _SwigObject_classRef; SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { - SwigPrivData *cdata; - - cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); + SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); if(cdata == NULL) { return SWIG_ERROR; } @@ -137,7 +135,7 @@ SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, voi *ptr=0; return SWIG_OK; } - + if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; } @@ -151,23 +149,17 @@ SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, voi } SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { + JSClassRef classRef; - JSObjectRef result; - SwigPrivData *cdata; - - if (ptr == NULL) { - return JSValueToObject(context, JSValueMakeNull(context), 0); - } - if(info->clientdata == NULL) { classRef = _SwigObject_classRef; } else { classRef = (JSClassRef) info->clientdata; } - result = JSObjectMake(context, classRef, NULL); + JSObjectRef result = JSObjectMake(context, classRef, NULL); - cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); + SwigPrivData* cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); cdata->swigCObject = ptr; cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; cdata->info = info; diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg index f200f1520..2e0a46717 100644 --- a/Lib/javascript/v8/javascriptrun.swg +++ b/Lib/javascript/v8/javascriptrun.swg @@ -220,11 +220,7 @@ void SWIGV8_SetPrivateData(v8::Handle obj, void* ptr, swig_type_info int SWIG_V8_ConvertPtr(v8::Handle valRef, void** ptr, swig_type_info *info, int flags) { v8::HandleScope scope; - /* special case: JavaScript null => C NULL pointer */ - if(valRef->IsNull()) { - *ptr=0; - return SWIG_OK; - } + if(!valRef->IsObject()) { return SWIG_TypeError; } @@ -232,14 +228,10 @@ int SWIG_V8_ConvertPtr(v8::Handle valRef, void** ptr, swig_type_info return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); } -v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { +v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { v8::HandleScope scope; v8::Handle class_templ; - if (ptr == NULL) { - return scope.Close(v8::Null()); - } - #if (SWIG_V8_VERSION < 0x031900) if(info->clientdata != 0) { class_templ = ((SWIGV8_ClientData*) info->clientdata)->class_templ; From d9bb3a84150990cc9e1980398f3dc7afd2dead79 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 11:46:29 +0200 Subject: [PATCH 056/152] Revert "JavaScriptCore: ConvertPtr should allow JavaScript null to be a valid value." This reverts commit 05ed0325dc4bd9ddc126d3dacc6b38686f7382cf. --- Lib/javascript/jsc/javascriptrun.swg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 9655b0eb6..813c7deb4 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -129,13 +129,6 @@ SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef ob SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { JSObjectRef objRef; - - /* special case: JavaScript null => C NULL pointer */ - if(JSValueIsNull(context, valRef)) { - *ptr=0; - return SWIG_OK; - } - if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; } From 2471e4ad9f1b6b9f851cf359fd6fd6b9aa34e9b8 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 12:11:15 +0200 Subject: [PATCH 057/152] Javascript: Use RUNTOOL for running tests. --- Examples/test-suite/javascript/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index be4350d1e..a54fcd7e7 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -85,7 +85,7 @@ else run_testcase = \ if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \ - $(top_builddir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \ + $(RUNTOOL) $(top_builddir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \ fi %.ctest: From d5ea32d7607c1991ae74293472d73740c90e5db8 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Sun, 18 May 2014 03:43:47 -0700 Subject: [PATCH 058/152] JavaScriptCore: ConvertPtr should allow JavaScript null to be a valid value. It is common in C to accept NULL to functions for pointer parameters. extern void DoSomething(struct Foo* foo); ... DoSomething(NULL); Thus, JavaScript null should be allowed: module.DoSomething(null); But the current ConvertPtr definition accepts only objects. This modifies it to allow null. --- Lib/javascript/jsc/javascriptrun.swg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 813c7deb4..9655b0eb6 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -129,6 +129,13 @@ SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef ob SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { JSObjectRef objRef; + + /* special case: JavaScript null => C NULL pointer */ + if(JSValueIsNull(context, valRef)) { + *ptr=0; + return SWIG_OK; + } + if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; } From 3f0f58889131baacb23583a7deb35d9394bfc141 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 00:21:21 +0200 Subject: [PATCH 059/152] Javascript: support null pointers. We allow to set pointer types using JS null. --- .../javascript/null_pointer_runme.js | 9 +++++++++ Lib/javascript/jsc/javascriptrun.swg | 18 +++++++++++++----- Lib/javascript/v8/javascriptrun.swg | 12 ++++++++++-- 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 Examples/test-suite/javascript/null_pointer_runme.js diff --git a/Examples/test-suite/javascript/null_pointer_runme.js b/Examples/test-suite/javascript/null_pointer_runme.js new file mode 100644 index 000000000..7c0d61244 --- /dev/null +++ b/Examples/test-suite/javascript/null_pointer_runme.js @@ -0,0 +1,9 @@ +var null_pointer = require("null_pointer"); + +if (!null_pointer.func(null)) { + throw new Error("Javascript 'null' should be converted into NULL."); +} + +if (null_pointer.getnull() != null) { + throw new Error("NULL should be converted into Javascript 'null'."); +} diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 9655b0eb6..1ff10a183 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -99,7 +99,9 @@ SWIGRUNTIME JSClassRef _SwigObject_classRef; SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { - SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); + SwigPrivData *cdata; + + cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); if(cdata == NULL) { return SWIG_ERROR; } @@ -135,7 +137,7 @@ SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, voi *ptr=0; return SWIG_OK; } - + if(!JSValueIsObject(context, valRef)) { return SWIG_TypeError; } @@ -149,17 +151,23 @@ SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, voi } SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { - JSClassRef classRef; + JSObjectRef result; + SwigPrivData *cdata; + + if (ptr == NULL) { + return JSValueToObject(context, JSValueMakeNull(context), 0); + } + if(info->clientdata == NULL) { classRef = _SwigObject_classRef; } else { classRef = (JSClassRef) info->clientdata; } - JSObjectRef result = JSObjectMake(context, classRef, NULL); + result = JSObjectMake(context, classRef, NULL); - SwigPrivData* cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); + cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); cdata->swigCObject = ptr; cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; cdata->info = info; diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg index 2e0a46717..f200f1520 100644 --- a/Lib/javascript/v8/javascriptrun.swg +++ b/Lib/javascript/v8/javascriptrun.swg @@ -220,7 +220,11 @@ void SWIGV8_SetPrivateData(v8::Handle obj, void* ptr, swig_type_info int SWIG_V8_ConvertPtr(v8::Handle valRef, void** ptr, swig_type_info *info, int flags) { v8::HandleScope scope; - + /* special case: JavaScript null => C NULL pointer */ + if(valRef->IsNull()) { + *ptr=0; + return SWIG_OK; + } if(!valRef->IsObject()) { return SWIG_TypeError; } @@ -228,10 +232,14 @@ int SWIG_V8_ConvertPtr(v8::Handle valRef, void** ptr, swig_type_info return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); } -v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { +v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { v8::HandleScope scope; v8::Handle class_templ; + if (ptr == NULL) { + return scope.Close(v8::Null()); + } + #if (SWIG_V8_VERSION < 0x031900) if(info->clientdata != 0) { class_templ = ((SWIGV8_ClientData*) info->clientdata)->class_templ; From 61b7da1671f5d88127eae0cde4561cd7883c825b Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 19 May 2014 15:59:14 +0200 Subject: [PATCH 060/152] JavascriptCore: Bugfix for null-pointer support. This solution must be considered as a preliminary workaround. --- Lib/javascript/jsc/javascriptrun.swg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 1ff10a183..ae1567e87 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -156,7 +156,11 @@ SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, SwigPrivData *cdata; if (ptr == NULL) { - return JSValueToObject(context, JSValueMakeNull(context), 0); + // HACK: it is not possible to use JSValueToObject (causing seg-fault) + // This static cast turned out to be a workaround + // In future, we should change the interface of this method + // to return JSValueRef instead of JSObjectRef. + return (JSObjectRef) JSValueMakeNull(context); } if(info->clientdata == NULL) { From 71e72c45ed89457e2a17f412219d37aad67040be Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 21 May 2014 19:16:15 +0100 Subject: [PATCH 061/152] Create separate extetnd.c file for handling extensions / %extend This is just a simple code refactor, moving and function renaming to remove the %extend code out of the parser into its own file now that it isn't just used in the parser. --- Source/CParse/cparse.h | 2 +- Source/CParse/parser.y | 179 ++++++++------------------------------ Source/CParse/util.c | 14 +++ Source/Makefile.am | 1 + Source/Modules/main.cxx | 3 +- Source/Modules/nested.cxx | 16 ++-- Source/Swig/extend.c | 141 ++++++++++++++++++++++++++++++ Source/Swig/swig.h | 7 ++ 8 files changed, 205 insertions(+), 158 deletions(-) create mode 100644 Source/Swig/extend.c diff --git a/Source/CParse/cparse.h b/Source/CParse/cparse.h index 6d7342a45..5a0d52d23 100644 --- a/Source/CParse/cparse.h +++ b/Source/CParse/cparse.h @@ -59,7 +59,7 @@ extern "C" { extern void cparse_normalize_void(Node *); extern Parm *Swig_cparse_parm(String *s); extern ParmList *Swig_cparse_parms(String *s, Node *file_line_node); - + extern Node *new_node(const_String_or_char_ptr tag); /* templ.c */ extern int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab *tscope); diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index a1a62cb62..4ce8f0e6d 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -41,7 +41,6 @@ int yyparse(); static Node *top = 0; /* Top of the generated parse tree */ static int unnamed = 0; /* Unnamed datatype counter */ -Hash *extendhash = 0; /* Hash table of added methods */ static Hash *classes = 0; /* Hash table of classes */ static Hash *classes_typedefs = 0; /* Hash table of typedef classes: typedef struct X {...} Y; */ static Symtab *prev_symtab = 0; @@ -71,14 +70,6 @@ static void yyerror (const char *e) { (void)e; } -static Node *new_node(const_String_or_char_ptr tag) { - Node *n = NewHash(); - set_nodeType(n,tag); - Setfile(n,cparse_file); - Setline(n,cparse_line); - return n; -} - /* Copies a node. Does not copy tree links or symbol table data (except for sym:name) */ @@ -650,106 +641,6 @@ static void add_symbols_copy(Node *n) { } } -/* Extension merge. This function is used to handle the %extend directive - when it appears before a class definition. To handle this, the %extend - actually needs to take precedence. Therefore, we will selectively nuke symbols - from the current symbol table, replacing them with the added methods */ - -void merge_extensions(Node *cls, Node *am) { - Node *n; - Node *csym; - - n = firstChild(am); - while (n) { - String *symname; - if (Strcmp(nodeType(n),"constructor") == 0) { - symname = Getattr(n,"sym:name"); - if (symname) { - if (Strcmp(symname,Getattr(n,"name")) == 0) { - /* If the name and the sym:name of a constructor are the same, - then it hasn't been renamed. However---the name of the class - itself might have been renamed so we need to do a consistency - check here */ - if (Getattr(cls,"sym:name")) { - Setattr(n,"sym:name", Getattr(cls,"sym:name")); - } - } - } - } - - symname = Getattr(n,"sym:name"); - DohIncref(symname); - if ((symname) && (!Getattr(n,"error"))) { - /* Remove node from its symbol table */ - Swig_symbol_remove(n); - csym = Swig_symbol_add(symname,n); - if (csym != n) { - /* Conflict with previous definition. Nuke previous definition */ - String *e = NewStringEmpty(); - String *en = NewStringEmpty(); - String *ec = NewStringEmpty(); - Printf(ec,"Identifier '%s' redefined by %%extend (ignored),",symname); - Printf(en,"%%extend definition of '%s'.",symname); - SWIG_WARN_NODE_BEGIN(n); - Swig_warning(WARN_PARSE_REDEFINED,Getfile(csym),Getline(csym),"%s\n",ec); - Swig_warning(WARN_PARSE_REDEFINED,Getfile(n),Getline(n),"%s\n",en); - SWIG_WARN_NODE_END(n); - Printf(e,"%s:%d:%s\n%s:%d:%s\n",Getfile(csym),Getline(csym),ec, - Getfile(n),Getline(n),en); - Setattr(csym,"error",e); - Delete(e); - Delete(en); - Delete(ec); - Swig_symbol_remove(csym); /* Remove class definition */ - Swig_symbol_add(symname,n); /* Insert extend definition */ - } - } - n = nextSibling(n); - } -} - -void append_previous_extension(Node *cls, Node *am) { - Node *n, *ne; - Node *pe = 0; - Node *ae = 0; - - if (!am) return; - - n = firstChild(am); - while (n) { - ne = nextSibling(n); - set_nextSibling(n,0); - /* typemaps and fragments need to be prepended */ - if (((Cmp(nodeType(n),"typemap") == 0) || (Cmp(nodeType(n),"fragment") == 0))) { - if (!pe) pe = new_node("extend"); - appendChild(pe, n); - } else { - if (!ae) ae = new_node("extend"); - appendChild(ae, n); - } - n = ne; - } - if (pe) prependChild(cls,pe); - if (ae) appendChild(cls,ae); -} - - -/* Check for unused %extend. Special case, don't report unused - extensions for templates */ - -void check_extensions() { - Iterator ki; - - if (!extendhash) return; - for (ki = First(extendhash); ki.key; ki = Next(ki)) { - if (!Strchr(ki.key,'<')) { - SWIG_WARN_NODE_BEGIN(ki.item); - Swig_warning(WARN_PARSE_EXTEND_UNDEF,Getfile(ki.item), Getline(ki.item), "%%extend defined for an undeclared class %s.\n", SwigType_namestr(ki.key)); - SWIG_WARN_NODE_END(ki.item); - } - } -} - /* Check a set of declarations to see if any are pure-abstract */ static List *pure_abstracts(Node *n) { @@ -1682,14 +1573,13 @@ extend_directive : EXTEND options idcolon LBRACE { cplus_mode = CPLUS_PUBLIC; if (!classes) classes = NewHash(); if (!classes_typedefs) classes_typedefs = NewHash(); - if (!extendhash) extendhash = NewHash(); clsname = make_class_name($3); cls = Getattr(classes,clsname); if (!cls) { cls = Getattr(classes_typedefs, clsname); if (!cls) { /* No previous definition. Create a new scope */ - Node *am = Getattr(extendhash,clsname); + Node *am = Getattr(Swig_extend_hash(),clsname); if (!am) { Swig_symbol_newscope(); Swig_symbol_setscopename($3); @@ -1735,13 +1625,13 @@ extend_directive : EXTEND options idcolon LBRACE { appendChild(current_class,$$); } else { /* We store the extensions in the extensions hash */ - Node *am = Getattr(extendhash,clsname); + Node *am = Getattr(Swig_extend_hash(),clsname); if (am) { /* Append the members to the previous extend methods */ appendChild(am,$6); } else { appendChild($$,$6); - Setattr(extendhash,clsname,$$); + Setattr(Swig_extend_hash(),clsname,$$); } } current_class = 0; @@ -2824,8 +2714,7 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va /* !!! This may be broken. We may have to add the %extend methods at the beginning of the class */ - - if (extendhash) { + { String *stmp = 0; String *clsname; Node *am; @@ -2834,32 +2723,32 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va } else { clsname = Getattr(templnode,"name"); } - am = Getattr(extendhash,clsname); + am = Getattr(Swig_extend_hash(),clsname); if (am) { Symtab *st = Swig_symbol_current(); Swig_symbol_setscope(Getattr(templnode,"symtab")); /* Printf(stdout,"%s: %s %p %p\n", Getattr(templnode,"name"), clsname, Swig_symbol_current(), Getattr(templnode,"symtab")); */ - merge_extensions(templnode,am); + Swig_extend_merge(templnode,am); Swig_symbol_setscope(st); - append_previous_extension(templnode,am); - Delattr(extendhash,clsname); + Swig_extend_append_previous(templnode,am); + Delattr(Swig_extend_hash(),clsname); } if (stmp) Delete(stmp); } - /* Add to classes hash */ - if (!classes) classes = NewHash(); - { - if (Namespaceprefix) { - String *temp = NewStringf("%s::%s", Namespaceprefix, Getattr(templnode,"name")); - Setattr(classes,temp,templnode); - Delete(temp); - } else { - String *qs = Swig_symbol_qualifiedscopename(templnode); - Setattr(classes, qs,templnode); - Delete(qs); - } - } + /* Add to classes hash */ + if (!classes) + classes = NewHash(); + + if (Namespaceprefix) { + String *temp = NewStringf("%s::%s", Namespaceprefix, Getattr(templnode,"name")); + Setattr(classes,temp,templnode); + Delete(temp); + } else { + String *qs = Swig_symbol_qualifiedscopename(templnode); + Setattr(classes, qs,templnode); + Delete(qs); + } } } @@ -3571,13 +3460,12 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE { Setattr($$,"abstracts", pure_abstracts($7)); /* This bit of code merges in a previously defined %extend directive (if any) */ - - if (extendhash) { + { String *clsname = Swig_symbol_qualifiedscopename(0); - am = Getattr(extendhash, clsname); + am = Getattr(Swig_extend_hash(), clsname); if (am) { - merge_extensions($$, am); - Delattr(extendhash, clsname); + Swig_extend_merge($$, am); + Delattr(Swig_extend_hash(), clsname); } Delete(clsname); } @@ -3588,7 +3476,7 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE { appendChild($$, $7); if (am) - append_previous_extension($$, am); + Swig_extend_append_previous($$, am); p = $9; if (p && !nscope_inner) { @@ -3787,15 +3675,16 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE { n = nextSibling(n); } n = $8; - /* Check for previous extensions */ - if (extendhash) { + + /* Check for previous extensions */ + { String *clsname = Swig_symbol_qualifiedscopename(0); - Node *am = Getattr(extendhash,clsname); + Node *am = Getattr(Swig_extend_hash(),clsname); if (am) { - /* Merge the extension into the symbol table */ - merge_extensions($$,am); - append_previous_extension($$,am); - Delattr(extendhash,clsname); + /* Merge the extension into the symbol table */ + Swig_extend_merge($$,am); + Swig_extend_append_previous($$,am); + Delattr(Swig_extend_hash(),clsname); } Delete(clsname); } diff --git a/Source/CParse/util.c b/Source/CParse/util.c index 7572dff10..320671d9a 100644 --- a/Source/CParse/util.c +++ b/Source/CParse/util.c @@ -88,3 +88,17 @@ void cparse_normalize_void(Node *n) { } } } + +/* ----------------------------------------------------------------------------- + * new_node() + * + * Create an empty parse node, setting file and line number information + * ----------------------------------------------------------------------------- */ + +Node *new_node(const_String_or_char_ptr tag) { + Node *n = NewHash(); + set_nodeType(n,tag); + Setfile(n,cparse_file); + Setline(n,cparse_line); + return n; +} diff --git a/Source/Makefile.am b/Source/Makefile.am index d5331cba1..da65b2326 100644 --- a/Source/Makefile.am +++ b/Source/Makefile.am @@ -77,6 +77,7 @@ eswig_SOURCES = CParse/cscanner.c \ Swig/cwrap.c \ Swig/deprecate.c \ Swig/error.c \ + Swig/extend.c \ Swig/fragment.c \ Swig/getopt.c \ Swig/include.c \ diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index d8f20c207..47d0d374b 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -198,7 +198,6 @@ static String *external_runtime_name = 0; enum { STAGE1=1, STAGE2=2, STAGE3=4, STAGE4=8, STAGEOVERFLOW=16 }; static List *libfiles = 0; static List *all_output_files = 0; -extern "C" void check_extensions(); /* ----------------------------------------------------------------------------- * check_extension() @@ -1173,7 +1172,7 @@ int SWIG_main(int argc, char *argv[], Language *l) { Printf(stdout, "Processing unnamed structs...\n"); Swig_nested_name_unnamed_c_structs(top); } - check_extensions(); + Swig_extend_unused_check(); if (Verbose) { Printf(stdout, "Processing types...\n"); diff --git a/Source/Modules/nested.cxx b/Source/Modules/nested.cxx index ca1c79a31..9ec52ead1 100644 --- a/Source/Modules/nested.cxx +++ b/Source/Modules/nested.cxx @@ -338,9 +338,7 @@ static void insertNodeAfter(Node *n, Node *c) { set_nextSibling(n, c); set_previousSibling(c, n); } -extern "C" Hash *extendhash; -extern "C" void merge_extensions(Node *cls, Node *am); -extern "C" void append_previous_extension(Node *cls, Node *am); + void Swig_nested_name_unnamed_c_structs(Node *n) { if (!classhash) classhash = Getattr(n, "classes"); @@ -378,13 +376,11 @@ void Swig_nested_name_unnamed_c_structs(Node *n) { decl = nextSibling(decl); } Delete(ty); - if (extendhash) { - if (Node *am = Getattr(extendhash, name)) { - // Merge the extension into the symbol table - merge_extensions(c, am); - append_previous_extension(c, am); - Delattr(extendhash, name); - } + if (Node *am = Getattr(Swig_extend_hash(), name)) { + // Merge the extension into the symbol table + Swig_extend_merge(c, am); + Swig_extend_append_previous(c, am); + Delattr(Swig_extend_hash(), name); } Swig_symbol_setscope(Swig_symbol_global_scope()); add_symbols_c(c); diff --git a/Source/Swig/extend.c b/Source/Swig/extend.c new file mode 100644 index 000000000..30097b434 --- /dev/null +++ b/Source/Swig/extend.c @@ -0,0 +1,141 @@ +/* ----------------------------------------------------------------------------- + * This file is part of SWIG, which is licensed as a whole under version 3 + * (or any later version) of the GNU General Public License. Some additional + * terms also apply to certain portions of SWIG. The full details of the SWIG + * license and copyrights can be found in the LICENSE and COPYRIGHT files + * included with the SWIG source code as distributed by the SWIG developers + * and at http://www.swig.org/legal.html. + * + * extend.c + * + * Extensions support (%extend) + * ----------------------------------------------------------------------------- */ + +#include "swig.h" +#include "cparse.h" + +static Hash *extendhash = 0; /* Hash table of added methods */ + +/* ----------------------------------------------------------------------------- + * Swig_extend_hash() + * + * Access the extend hash + * ----------------------------------------------------------------------------- */ +Hash *Swig_extend_hash(void) { + if (!extendhash) + extendhash = NewHash(); + return extendhash; +} + +/* ----------------------------------------------------------------------------- + * Swig_extend_merge() + * + * Extension merge. This function is used to handle the %extend directive + * when it appears before a class definition. To handle this, the %extend + * actually needs to take precedence. Therefore, we will selectively nuke symbols + * from the current symbol table, replacing them with the added methods. + * ----------------------------------------------------------------------------- */ + +void Swig_extend_merge(Node *cls, Node *am) { + Node *n; + Node *csym; + + n = firstChild(am); + while (n) { + String *symname; + if (Strcmp(nodeType(n),"constructor") == 0) { + symname = Getattr(n,"sym:name"); + if (symname) { + if (Strcmp(symname,Getattr(n,"name")) == 0) { + /* If the name and the sym:name of a constructor are the same, + then it hasn't been renamed. However---the name of the class + itself might have been renamed so we need to do a consistency + check here */ + if (Getattr(cls,"sym:name")) { + Setattr(n,"sym:name", Getattr(cls,"sym:name")); + } + } + } + } + + symname = Getattr(n,"sym:name"); + DohIncref(symname); + if ((symname) && (!Getattr(n,"error"))) { + /* Remove node from its symbol table */ + Swig_symbol_remove(n); + csym = Swig_symbol_add(symname,n); + if (csym != n) { + /* Conflict with previous definition. Nuke previous definition */ + String *e = NewStringEmpty(); + String *en = NewStringEmpty(); + String *ec = NewStringEmpty(); + Printf(ec,"Identifier '%s' redefined by %%extend (ignored),",symname); + Printf(en,"%%extend definition of '%s'.",symname); + SWIG_WARN_NODE_BEGIN(n); + Swig_warning(WARN_PARSE_REDEFINED,Getfile(csym),Getline(csym),"%s\n",ec); + Swig_warning(WARN_PARSE_REDEFINED,Getfile(n),Getline(n),"%s\n",en); + SWIG_WARN_NODE_END(n); + Printf(e,"%s:%d:%s\n%s:%d:%s\n",Getfile(csym),Getline(csym),ec, + Getfile(n),Getline(n),en); + Setattr(csym,"error",e); + Delete(e); + Delete(en); + Delete(ec); + Swig_symbol_remove(csym); /* Remove class definition */ + Swig_symbol_add(symname,n); /* Insert extend definition */ + } + } + n = nextSibling(n); + } +} + +/* ----------------------------------------------------------------------------- + * Swig_extend_append_previous() + * ----------------------------------------------------------------------------- */ + +void Swig_extend_append_previous(Node *cls, Node *am) { + Node *n, *ne; + Node *pe = 0; + Node *ae = 0; + + if (!am) return; + + n = firstChild(am); + while (n) { + ne = nextSibling(n); + set_nextSibling(n,0); + /* typemaps and fragments need to be prepended */ + if (((Cmp(nodeType(n),"typemap") == 0) || (Cmp(nodeType(n),"fragment") == 0))) { + if (!pe) pe = new_node("extend"); + appendChild(pe, n); + } else { + if (!ae) ae = new_node("extend"); + appendChild(ae, n); + } + n = ne; + } + if (pe) prependChild(cls,pe); + if (ae) appendChild(cls,ae); +} + + +/* ----------------------------------------------------------------------------- + * Swig_extend_unused_check() + * + * Check for unused %extend. Special case, don't report unused + * extensions for templates + * ----------------------------------------------------------------------------- */ + +void Swig_extend_unused_check(void) { + Iterator ki; + + if (!extendhash) return; + for (ki = First(extendhash); ki.key; ki = Next(ki)) { + if (!Strchr(ki.key,'<')) { + SWIG_WARN_NODE_BEGIN(ki.item); + Swig_warning(WARN_PARSE_EXTEND_UNDEF,Getfile(ki.item), Getline(ki.item), "%%extend defined for an undeclared class %s.\n", SwigType_namestr(ki.key)); + SWIG_WARN_NODE_END(ki.item); + } + } +} + diff --git a/Source/Swig/swig.h b/Source/Swig/swig.h index 5334a29f0..5ee7f8d95 100644 --- a/Source/Swig/swig.h +++ b/Source/Swig/swig.h @@ -420,6 +420,13 @@ extern int ParmList_is_compactdefargs(ParmList *p); extern void Swig_fragment_emit(String *name); extern void Swig_fragment_clear(String *section); +/* --- Extension support --- */ + + extern Hash *Swig_extend_hash(void); + extern void Swig_extend_merge(Node *cls, Node *am); + extern void Swig_extend_append_previous(Node *cls, Node *am); + extern void Swig_extend_unused_check(void); + /* hacks defined in C++ ! */ extern int Swig_director_mode(void); extern int Swig_director_protected_mode(void); From d9cac664620d282aa423d3f0ef55ab9a677156a4 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 21 May 2014 20:04:48 +0100 Subject: [PATCH 062/152] Add missing entries into changes files. --- CHANGES.current | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGES.current b/CHANGES.current index 8b67392b2..e73a91c3f 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,18 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.1 (in progress) =========================== +2014-05-18: vkalinin + Bug #175 - Restore %extend to work for unnamed nested structures by using a C + symbol comprising the outer structure name and unnamed variable instance name. + +2014-05-15: kwwette + Add #166 - 'make check' now works out of source. This required te examples to build + out of source. The main languages have been tested - C#, Go, Guile, Java, Javascript, + Lua, Octave, Perl, PHP, Python, Ruby and Tcl. + +2014-05-01: Oliver Buchtala + Javascript support added, see Javascript chapter in the documentation. + 2014-05-01: olly [PHP] The generated __isset() method now returns true for read-only properties. From 9846f3f1eac0835e9d1870f41ea0c03f3006a687 Mon Sep 17 00:00:00 2001 From: Harvey Falcic Date: Wed, 16 Apr 2014 11:13:21 -0400 Subject: [PATCH 063/152] Python 3 byte string output: use errors="surrogateescape" ... if available on the version of Python that's in use. This allows obtaining the original byte string (and potentially trying a fallback encoding) if the bytes can't be decoded as UTF-8. Previously, a UnicodeDecodeError would be raised with no way to treat the data as bytes or try another codec. --- Lib/python/pystrings.swg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/python/pystrings.swg b/Lib/python/pystrings.swg index f6a4eba8a..2b14547ad 100644 --- a/Lib/python/pystrings.swg +++ b/Lib/python/pystrings.swg @@ -89,7 +89,11 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); } else { %#if PY_VERSION_HEX >= 0x03000000 +%#if PY_VERSION_HEX >= 0x03010000 + return PyUnicode_DecodeUTF8(carray, %numeric_cast(size,int), "surrogateescape"); +%#else return PyUnicode_FromStringAndSize(carray, %numeric_cast(size,int)); +%#endif %#else return PyString_FromStringAndSize(carray, %numeric_cast(size,int)); %#endif From 791f070e66ee4cf96f0df0a4d00e1fe688f6bb80 Mon Sep 17 00:00:00 2001 From: Harvey Falcic Date: Thu, 22 May 2014 22:53:07 -0400 Subject: [PATCH 064/152] Add "unicode_strings" test case for new Python 3 behavior --- Examples/test-suite/common.mk | 1 + .../test-suite/python/unicode_strings_runme.py | 4 ++++ Examples/test-suite/unicode_strings.i | 15 +++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 Examples/test-suite/python/unicode_strings_runme.py create mode 100644 Examples/test-suite/unicode_strings.i diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index bfb960fe5..bc1ca5cb8 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -473,6 +473,7 @@ CPP_TEST_CASES += \ typemap_various \ typename \ types_directive \ + unicode_strings \ union_scope \ using1 \ using2 \ diff --git a/Examples/test-suite/python/unicode_strings_runme.py b/Examples/test-suite/python/unicode_strings_runme.py new file mode 100644 index 000000000..2d26599aa --- /dev/null +++ b/Examples/test-suite/python/unicode_strings_runme.py @@ -0,0 +1,4 @@ +import unicode_strings + +unicode_strings.test_c_str() +unicode_strings.test_std_string() diff --git a/Examples/test-suite/unicode_strings.i b/Examples/test-suite/unicode_strings.i new file mode 100644 index 000000000..f4a8b8b50 --- /dev/null +++ b/Examples/test-suite/unicode_strings.i @@ -0,0 +1,15 @@ +%module unicode_strings + +%include + +%inline %{ + +const char* test_c_str(void) { + return "h\xe9llo"; +} + +std::string test_std_string(void) { + return std::string("h\xe9llo"); +} + +%} From 5fc851a1e0928d5c179c2b9336e76d5e19324d25 Mon Sep 17 00:00:00 2001 From: Harvey Falcic Date: Fri, 23 May 2014 15:24:35 -0400 Subject: [PATCH 065/152] Add Python 3 'surrogateescape' documentation --- Doc/Manual/Python.html | 87 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index bdb1ada30..45725065d 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -116,6 +116,7 @@

  • Function annotation
  • Buffer interface
  • Abstract base classes +
  • Byte string output conversion @@ -5928,6 +5929,92 @@ For details of abstract base class, please see PEP 3119.

    +

    35.12.4 Byte string output conversion

    + + +

    +By default, any byte string (char* or std::string) returned +from C or C++ code is decoded to text as UTF-8. This decoding uses the +surrogateescape error handler under Python 3.1 or higher -- this +error handler decodes invalid byte sequences to high surrogate characters +in the range U+DC80 to U+DCFF. + +As an example, consider the following SWIG interface, which exposes a byte +string that cannot be completely decoded as UTF-8: +

    + +
    +%module example
    +
    +%include <std_string.i>
    +
    +%inline %{
    +
    +const char* non_utf8_c_str(void) {
    +        return "h\xe9llo w\xc3\xb6rld";
    +}
    +
    +%}
    +
    + +

    +When this method is called from Python 3, the return value is the following +text string: +

    + +
    +>>> s = test.non_utf8_c_str()
    +>>> s
    +'h\udce9llo wörld'
    +
    + +

    +Since the C string contains bytes that cannot be decoded as UTF-8, those raw +bytes are represented as high surrogate characters that can be used to obtain +the original byte sequence: +

    + +
    +>>> b = s.encode('utf-8', errors='surrogateescape')
    +>>> b
    +b'h\xe9llo w\xc3\xb6rld'
    +
    + +

    +One can then attempt a different encoding, if desired (or simply leave the +byte string as a raw sequence of bytes for use in binary protocols): +

    + +
    +>>> b.decode('latin-1')
    +'héllo wörld'
    +
    + +

    +Note, however, that text strings containing surrogate characters are rejected +with the default strict codec error handler. For example: +

    + +
    +>>> with open('test', 'w') as f:
    +...     print(s, file=f)
    +...
    +Traceback (most recent call last):
    +  File "<stdin>", line 2, in <module>
    +UnicodeEncodeError: 'utf-8' codec can't encode character '\udce9' in position 1: surrogates not allowed
    +
    + +

    +This requires the user to check most strings returned by SWIG bindings, but +the alternative is for a non-UTF8 byte string to be completely inaccessible +in Python 3 code. +

    + +

    +For more details about the surrogateescape error handler, please see +PEP 383. +

    + From 8d3902a6666799a01ff23ee501c478b1371d19a1 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sat, 24 May 2014 11:10:57 +1200 Subject: [PATCH 066/152] Work towards C90 compatibility for Lua --- Lib/lua/luarun.swg | 49 ++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index ad735a541..dd668587f 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -392,8 +392,9 @@ static int swig_lua_elua_emulate_unique_key; /* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) { + int i, table_parsed, parsed_tables_array, target_table; assert(lua_istable(L,-1)); - int target_table = lua_gettop(L); + target_table = lua_gettop(L); /* Get the registry where we put all parsed tables to avoid loops */ lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); if(lua_isnil(L,-1)) { @@ -402,11 +403,10 @@ SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_ent lua_pushvalue(L,-1); lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); } - int parsed_tables_array = lua_gettop(L); + parsed_tables_array = lua_gettop(L); lua_pushvalue(L,target_table); lua_rawsetp(L, parsed_tables_array, table); - int i; - int table_parsed = 0; + table_parsed = 0; const int SWIGUNUSED pairs_start = lua_gettop(L); for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) { @@ -606,7 +606,7 @@ SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); /* helper function - register namespace methods and attributes into namespace */ SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) { - int i = 0; + int i; /* There must be namespace table (not metatable) at the top of the stack */ assert(lua_istable(L,-1)); SWIG_Lua_InstallConstants(L, ns->ns_constants); @@ -753,11 +753,13 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED /* first_arg - position of the object in stack. Everything that is above are arguments * and is passed to every evocation of the func */ int last_arg = lua_gettop(L);/* position of last argument */ - lua_getmetatable(L,first_arg); - int original_metatable = last_arg + 1; + int original_metatable; size_t bases_count; + int result; + lua_getmetatable(L,first_arg); + original_metatable = last_arg + 1; SWIG_LUA_INIT_BASE_SEARCH(bases_count); - int result = SWIG_ERROR; + result = SWIG_ERROR; if(ret) *ret = 0; if(bases_count>0) @@ -766,10 +768,11 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED int j; int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ int valid = 1; + int subcall_last_arg; + swig_type_info *base_swig_type = 0; for(j=first_arg;j<=last_arg;j++) lua_pushvalue(L,j); - int subcall_last_arg = lua_gettop(L); - swig_type_info *base_swig_type = 0; + subcall_last_arg = lua_gettop(L); /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ for(i=0;ifqname); /* get the name */ @@ -1499,7 +1507,6 @@ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *c } lua_pop(L,2); /* tidy stack */ /* Recursively initialize all bases */ - int i = 0; for(i=0;clss->bases[i];i++) { SWIG_Lua_class_register_instance(L,clss->bases[i]); @@ -1604,6 +1611,7 @@ SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) { const int SWIGUNUSED begin = lua_gettop(L); + int i; /* if name already there (class is already registered) then do nothing */ SWIG_Lua_get_class_registry(L); /* get the registry */ lua_pushstring(L,clss->fqname); /* get the name */ @@ -1615,7 +1623,6 @@ SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_cla } lua_pop(L,2); /* tidy stack */ /* Recursively initialize all bases */ - int i = 0; for(i=0;clss->bases[i];i++) { SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); From 1a0b8abec735ec0db088a1c4c2da1b71cad7ff0e Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sat, 24 May 2014 11:11:51 +1200 Subject: [PATCH 067/152] Fix comment typo --- Lib/lua/luarun.swg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index dd668587f..7cfcff212 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -1838,8 +1838,8 @@ SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { #endif /* Executes a C string in Lua which is a really simple way of calling lua from C Unfortunately lua keeps changing its APIs, so we need a conditional compile -In lua 5.0.X its lua_dostring() -In lua 5.1.X its luaL_dostring() +In lua 5.0.X it's lua_dostring() +In lua 5.1.X it's luaL_dostring() */ SWIGINTERN int SWIG_Lua_dostring(lua_State *L, const char *str) { From 879296f71bcfd56a7659355942c784176ae06e6c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 24 May 2014 00:12:27 +0100 Subject: [PATCH 068/152] Correct CFLAGS CXXFLAGS for Javascript and guile examples --- Examples/Makefile.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index b22fd2e76..3a91cddd3 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -498,7 +498,7 @@ guile_externalhdr: guile_augmented: $(SRCDIR_SRCS) $(SWIG) -guile $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) - $(CC) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) -o $(TARGET) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(GUILE_CFLAGS) $(GUILE_LIBS) $(LIBS) -o $(TARGET) # ----------------------------------------------------------------- # Build statically linked Guile interpreter @@ -656,8 +656,8 @@ ifeq (node,$(JSENGINE)) sed -e 's|$$srcdir|./$(SRCDIR)|g' $(SRCDIR)binding.gyp.in > binding.gyp $(NODEGYP) --loglevel=silent configure build 1>>/dev/null else - $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) - $(CXXSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) endif @@ -669,14 +669,14 @@ ifeq (jsc, $(ENGINE)) $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(INCLUDES) $(JSINCLUDES) $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO) else # (v8 | node) # v8 and node must be compiled as c++ - $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) - $(CXXSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) endif javascript_cpp: $(SRCDIR_SRCS) javascript_custom_interpreter $(SWIG) -javascript -c++ $(SWIGOPT) $(INTERFACEPATH) - $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) - $(CXXSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) + $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(INCLUDES) $(JSINCLUDES) + $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO) # ----------------------------------------------------------------- # Running a Javascript example From f39ed94419e4a30b8b2ba1d49c138fd245010262 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 24 May 2014 00:14:01 +0100 Subject: [PATCH 069/152] Fix compiler warnings in examples when using -std=c++98 -std=gnu89 -pedantic -Wreturn-type --- Examples/csharp/extend/example.h | 2 +- Examples/csharp/reference/example.cxx | 2 +- Examples/csharp/variables/example.c | 4 ++-- Examples/d/extend/example.h | 2 +- Examples/d/variables/example.c | 4 ++-- Examples/go/extend/example.h | 2 +- Examples/go/reference/reference.cxx | 2 +- Examples/java/extend/example.h | 2 +- Examples/java/reference/example.cxx | 2 +- Examples/java/variables/example.c | 4 ++-- Examples/javascript/reference/example.cxx | 2 +- Examples/javascript/variables/example.cxx | 4 ++-- Examples/lua/arrays/example.c | 2 +- Examples/lua/dual/dual.cpp | 6 +++--- Examples/lua/embed2/embed2.c | 10 +++++----- Examples/lua/functest/example.i | 13 ++++++------- Examples/lua/owner/example.cxx | 11 +++++++---- Examples/lua/variables/example.c | 4 ++-- Examples/modula3/reference/example.cxx | 2 +- Examples/octave/extend/example.h | 2 +- Examples/octave/reference/example.cxx | 2 +- Examples/octave/variables/example.c | 4 ++-- Examples/perl5/extend/example.h | 2 +- Examples/perl5/reference/example.cxx | 2 +- Examples/perl5/value/example.i | 2 +- Examples/perl5/variables/example.c | 4 ++-- Examples/php/extend/example.h | 2 +- Examples/php/reference/example.cxx | 10 +++++----- Examples/php/reference/example.i | 2 +- Examples/php/sync/example.cxx | 2 +- Examples/php/value/example.i | 2 +- Examples/php/variables/example.c | 4 ++-- Examples/python/extend/example.h | 2 +- Examples/python/reference/example.cxx | 2 +- Examples/python/swigrun/example.cxx | 2 +- Examples/python/swigrun/example.h | 2 +- Examples/python/variables/example.c | 4 ++-- Examples/ruby/reference/example.cxx | 2 +- Examples/ruby/value/example.i | 2 +- Examples/ruby/variables/example.c | 4 ++-- Examples/tcl/reference/example.cxx | 2 +- Examples/tcl/value/example.i | 2 +- Examples/tcl/variables/example.c | 4 ++-- 43 files changed, 75 insertions(+), 73 deletions(-) diff --git a/Examples/csharp/extend/example.h b/Examples/csharp/extend/example.h index b27ab9711..ca1aed28f 100644 --- a/Examples/csharp/extend/example.h +++ b/Examples/csharp/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/csharp/reference/example.cxx b/Examples/csharp/reference/example.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/csharp/reference/example.cxx +++ b/Examples/csharp/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/csharp/variables/example.c b/Examples/csharp/variables/example.c index 05e17c8c5..85685fe72 100644 --- a/Examples/csharp/variables/example.c +++ b/Examples/csharp/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/d/extend/example.h b/Examples/d/extend/example.h index 7ad93fbc1..7a8c04c33 100644 --- a/Examples/d/extend/example.h +++ b/Examples/d/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/d/variables/example.c b/Examples/d/variables/example.c index 3b4e9f346..f5356c755 100644 --- a/Examples/d/variables/example.c +++ b/Examples/d/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/go/extend/example.h b/Examples/go/extend/example.h index b27ab9711..ca1aed28f 100644 --- a/Examples/go/extend/example.h +++ b/Examples/go/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/go/reference/reference.cxx b/Examples/go/reference/reference.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/go/reference/reference.cxx +++ b/Examples/go/reference/reference.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/java/extend/example.h b/Examples/java/extend/example.h index b27ab9711..ca1aed28f 100644 --- a/Examples/java/extend/example.h +++ b/Examples/java/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/java/reference/example.cxx b/Examples/java/reference/example.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/java/reference/example.cxx +++ b/Examples/java/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/java/variables/example.c b/Examples/java/variables/example.c index 05e17c8c5..85685fe72 100644 --- a/Examples/java/variables/example.c +++ b/Examples/java/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/javascript/reference/example.cxx b/Examples/javascript/reference/example.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/javascript/reference/example.cxx +++ b/Examples/javascript/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/javascript/variables/example.cxx b/Examples/javascript/variables/example.cxx index f10390a9e..15314b383 100644 --- a/Examples/javascript/variables/example.cxx +++ b/Examples/javascript/variables/example.cxx @@ -57,9 +57,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/lua/arrays/example.c b/Examples/lua/arrays/example.c index ed23738c8..da1bd755a 100644 --- a/Examples/lua/arrays/example.c +++ b/Examples/lua/arrays/example.c @@ -13,7 +13,7 @@ void sort_int(int* arr, int len) qsort(arr, len, sizeof(int), compare_int); } -// ditto doubles +/* ditto doubles */ int compare_double(const void * a, const void * b) { return (int)( *(double*)a - *(double*)b ); diff --git a/Examples/lua/dual/dual.cpp b/Examples/lua/dual/dual.cpp index b54e44de1..2108a7275 100644 --- a/Examples/lua/dual/dual.cpp +++ b/Examples/lua/dual/dual.cpp @@ -45,14 +45,14 @@ void testModule(lua_State *L) swig_type_info *pTypeInfo=0,*pTypeInfo2=0; swig_module_info *pModule=0; pModule=SWIG_GetModule(L); - DEBUG2(" SWIG_GetModule() returns %p\n",pModule) + DEBUG2(" SWIG_GetModule() returns %p\n", (void *)pModule) if(pModule==0) return; pTypeInfo = SWIG_TypeQuery(L,"Foo *"); DEBUG2(" Type (Foo*) is %s\n",pTypeInfo==0?"unknown":"known"); - DEBUG3(" Module %p typeinfo(Foo*) %p\n",pModule,pTypeInfo); + DEBUG3(" Module %p typeinfo(Foo*) %p\n", (void *)pModule, (void *)pTypeInfo); pTypeInfo2 = SWIG_TypeQuery(L,"Bar *"); DEBUG2(" Type (Bar*) is %s\n",pTypeInfo2==0?"unknown":"known"); - DEBUG3(" Module %p typeinfo(Bar*) %p\n",pModule,pTypeInfo2); + DEBUG3(" Module %p typeinfo(Bar*) %p\n", (void *)pModule, (void *)pTypeInfo2); } int main(int argc,char* argv[]) diff --git a/Examples/lua/embed2/embed2.c b/Examples/lua/embed2/embed2.c index 7b2ca9b67..0ce9f8f7f 100644 --- a/Examples/lua/embed2/embed2.c +++ b/Examples/lua/embed2/embed2.c @@ -53,7 +53,7 @@ int call_add(lua_State *L,int a,int b,int* res) { lua_getglobal(L, "add"); /* function to be called */ if (!lua_isfunction(L,-1)) { printf("[C] error: cannot find function 'add'\n"); - lua_settop(L,top); // reset + lua_settop(L,top); return 0; } lua_pushnumber(L,a); @@ -61,18 +61,18 @@ int call_add(lua_State *L,int a,int b,int* res) { if (lua_pcall(L, 2, 1, 0) != 0) /* call function with 2 arguments and 1 result */ { printf("[C] error running function `add': %s\n",lua_tostring(L, -1)); - lua_settop(L,top); // reset + lua_settop(L,top); return 0; } - // check results + /* check results */ if (!lua_isnumber(L,-1)) { printf("[C] error: returned value is not a number\n"); - lua_settop(L,top); // reset + lua_settop(L,top); return 0; } *res=(int)lua_tonumber(L,-1); lua_settop(L,top); /* reset stack */ - return 1; // ok + return 1; } /* This is a variargs call function for calling from C into Lua. diff --git a/Examples/lua/functest/example.i b/Examples/lua/functest/example.i index 631e0602d..9bb64cbf5 100644 --- a/Examples/lua/functest/example.i +++ b/Examples/lua/functest/example.i @@ -1,13 +1,12 @@ /* File : example.i */ %module example -%include "typemaps.i" // you must have this for the typemaps for ptrs -// basic function testing -// +%include "typemaps.i" + %inline %{ -extern int add1(int x, int y); // return x+y -- basic function test -extern void add2(int x, int *INPUT, int *OUTPUT); // *z = x+*y -- argin and argout test -extern int add3(int x, int y, int *OUTPUT); // return x+y, *z=x-y -- returning 2 values -extern void add4(int x, int *INOUT); // *y += x -- INOUT dual purpose variable +extern int add1(int x, int y); /* return x+y -- basic function test */ +extern void add2(int x, int *INPUT, int *OUTPUT); /* *z = x+*y -- argin and argout test */ +extern int add3(int x, int y, int *OUTPUT); /* return x+y, *z=x-y -- returning 2 values */ +extern void add4(int x, int *INOUT); /* *y += x -- INOUT dual purpose variable */ %} diff --git a/Examples/lua/owner/example.cxx b/Examples/lua/owner/example.cxx index bce484aea..c2c073d79 100644 --- a/Examples/lua/owner/example.cxx +++ b/Examples/lua/owner/example.cxx @@ -39,12 +39,15 @@ Square* createSquare(double w) return new Square(w); } -ShapeOwner::ShapeOwner() {printf(" ShapeOwner(%p)\n",this);} +ShapeOwner::ShapeOwner() { + printf(" ShapeOwner(%p)\n", (void *)this); +} + ShapeOwner::~ShapeOwner() { - printf(" ~ShapeOwner(%p)\n",this); - for(unsigned i=0;ix : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/modula3/reference/example.cxx b/Examples/modula3/reference/example.cxx index 649b0169c..9dbaed2ee 100644 --- a/Examples/modula3/reference/example.cxx +++ b/Examples/modula3/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %x (%g,%g,%g)", (int)this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/octave/extend/example.h b/Examples/octave/extend/example.h index 9e15cf8e4..77a26ec95 100644 --- a/Examples/octave/extend/example.h +++ b/Examples/octave/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/octave/reference/example.cxx b/Examples/octave/reference/example.cxx index 9b72ca6a2..632a03a5b 100644 --- a/Examples/octave/reference/example.cxx +++ b/Examples/octave/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/octave/variables/example.c b/Examples/octave/variables/example.c index e2b72e0ea..a9102a9d5 100644 --- a/Examples/octave/variables/example.c +++ b/Examples/octave/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/perl5/extend/example.h b/Examples/perl5/extend/example.h index b27ab9711..ca1aed28f 100644 --- a/Examples/perl5/extend/example.h +++ b/Examples/perl5/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/perl5/reference/example.cxx b/Examples/perl5/reference/example.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/perl5/reference/example.cxx +++ b/Examples/perl5/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/perl5/value/example.i b/Examples/perl5/value/example.i index 98fd60ed5..39663c6b8 100644 --- a/Examples/perl5/value/example.i +++ b/Examples/perl5/value/example.i @@ -26,7 +26,7 @@ Vector *new_Vector(double x, double y, double z) { } void vector_print(Vector *v) { - printf("Vector %p = (%g, %g, %g)\n", v, v->x, v->y, v->z); + printf("Vector %p = (%g, %g, %g)\n", (void *)v, v->x, v->y, v->z); } %} diff --git a/Examples/perl5/variables/example.c b/Examples/perl5/variables/example.c index 05e17c8c5..85685fe72 100644 --- a/Examples/perl5/variables/example.c +++ b/Examples/perl5/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/php/extend/example.h b/Examples/php/extend/example.h index b27ab9711..ca1aed28f 100644 --- a/Examples/php/extend/example.h +++ b/Examples/php/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/php/reference/example.cxx b/Examples/php/reference/example.cxx index 13e47eade..7ead7fbf6 100644 --- a/Examples/php/reference/example.cxx +++ b/Examples/php/reference/example.cxx @@ -19,23 +19,23 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::as_string() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } VectorArray::VectorArray(int size) { items = new Vector[size]; maxsize = size; - printf("VectorArray new: self=%p\n",this); + printf("VectorArray new: self=%p\n", (void *)this); } VectorArray::~VectorArray() { - printf("VectorArray delete: self=%p\n",this); + printf("VectorArray delete: self=%p\n", (void *)this); delete [] items; } Vector &VectorArray::operator[](int index) { - printf("VectorArray: read[%d] self=%p\n",index,this); + printf("VectorArray: read[%d] self=%p\n", index, (void *)this); if ((index < 0) || (index >= maxsize)) { printf("Panic! Array index out of bounds.\n"); exit(1); @@ -44,6 +44,6 @@ Vector &VectorArray::operator[](int index) { } int VectorArray::size() { - printf("VectorArray: size %d self=%p\n",maxsize,this); + printf("VectorArray: size %d self=%p\n", maxsize, (void *)this); return maxsize; } diff --git a/Examples/php/reference/example.i b/Examples/php/reference/example.i index d6122866b..a372439b1 100644 --- a/Examples/php/reference/example.i +++ b/Examples/php/reference/example.i @@ -37,7 +37,7 @@ public: /* This wrapper provides an alternative to the [] operator */ %extend { Vector &get(int index) { - printf("VectorArray extended get: %p %d\n",$self,index); + printf("VectorArray extended get: %p %d\n", (void *)$self, index); return (*$self)[index]; } void set(int index, Vector &a) { diff --git a/Examples/php/sync/example.cxx b/Examples/php/sync/example.cxx index 31ed2021b..0942279b2 100644 --- a/Examples/php/sync/example.cxx +++ b/Examples/php/sync/example.cxx @@ -10,4 +10,4 @@ void Sync::printer(void) { printf("The value of global x is %d\n", x); printf("The value of class s is %s\n", s); printf("The value of class x is %d\n", x); -}; +} diff --git a/Examples/php/value/example.i b/Examples/php/value/example.i index 386fa3b84..20a453468 100644 --- a/Examples/php/value/example.i +++ b/Examples/php/value/example.i @@ -11,7 +11,7 @@ %inline %{ void vector_print(Vector *v) { - printf("Vector %p = (%g, %g, %g)\n", v, v->x, v->y, v->z); + printf("Vector %p = (%g, %g, %g)\n", (void *)v, v->x, v->y, v->z); } %} diff --git a/Examples/php/variables/example.c b/Examples/php/variables/example.c index b21dee32d..d4c6d026d 100644 --- a/Examples/php/variables/example.c +++ b/Examples/php/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %c%c%c%c%c\n", name[0],name[1],name[2],name[3],name[4]); - printf("ptptr = %p %s\n", ptptr, Point_print( ptptr ) ); + printf("ptptr = %p %s\n", (void *)ptptr, Point_print( ptptr ) ); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/python/extend/example.h b/Examples/python/extend/example.h index b27ab9711..ca1aed28f 100644 --- a/Examples/python/extend/example.h +++ b/Examples/python/extend/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/python/reference/example.cxx b/Examples/python/reference/example.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/python/reference/example.cxx +++ b/Examples/python/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/python/swigrun/example.cxx b/Examples/python/swigrun/example.cxx index 25906a559..2d2471301 100644 --- a/Examples/python/swigrun/example.cxx +++ b/Examples/python/swigrun/example.cxx @@ -9,7 +9,7 @@ Manager* convert_to_Manager(PyObject *py_obj) { Manager* c_ptr; swig_type_info *ty = SWIG_TypeQuery("Manager *"); - printf("manager ty %p \n", ty); + printf("manager ty %p \n", (void *)ty); if (SWIG_ConvertPtr(py_obj, (void **) &c_ptr, ty, 0) == -1) { c_ptr = 0; } else { diff --git a/Examples/python/swigrun/example.h b/Examples/python/swigrun/example.h index 69e6fe4de..e89f7baaa 100644 --- a/Examples/python/swigrun/example.h +++ b/Examples/python/swigrun/example.h @@ -14,7 +14,7 @@ public: virtual std::string getTitle() { return getPosition() + " " + getName(); } virtual std::string getName() { return name; } virtual std::string getPosition() const { return "Employee"; } - virtual ~Employee() { printf("~Employee() @ %p\n", this); } + virtual ~Employee() { printf("~Employee() @ %p\n", (void *)this); } }; diff --git a/Examples/python/variables/example.c b/Examples/python/variables/example.c index 05e17c8c5..85685fe72 100644 --- a/Examples/python/variables/example.c +++ b/Examples/python/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/ruby/reference/example.cxx b/Examples/ruby/reference/example.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/ruby/reference/example.cxx +++ b/Examples/ruby/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/ruby/value/example.i b/Examples/ruby/value/example.i index 98fd60ed5..39663c6b8 100644 --- a/Examples/ruby/value/example.i +++ b/Examples/ruby/value/example.i @@ -26,7 +26,7 @@ Vector *new_Vector(double x, double y, double z) { } void vector_print(Vector *v) { - printf("Vector %p = (%g, %g, %g)\n", v, v->x, v->y, v->z); + printf("Vector %p = (%g, %g, %g)\n", (void *)v, v->x, v->y, v->z); } %} diff --git a/Examples/ruby/variables/example.c b/Examples/ruby/variables/example.c index 05e17c8c5..85685fe72 100644 --- a/Examples/ruby/variables/example.c +++ b/Examples/ruby/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } diff --git a/Examples/tcl/reference/example.cxx b/Examples/tcl/reference/example.cxx index 8a513bf49..9dbaed2ee 100644 --- a/Examples/tcl/reference/example.cxx +++ b/Examples/tcl/reference/example.cxx @@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) { char *Vector::print() { static char temp[512]; - sprintf(temp,"Vector %p (%g,%g,%g)", this, x,y,z); + sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z); return temp; } diff --git a/Examples/tcl/value/example.i b/Examples/tcl/value/example.i index 98fd60ed5..39663c6b8 100644 --- a/Examples/tcl/value/example.i +++ b/Examples/tcl/value/example.i @@ -26,7 +26,7 @@ Vector *new_Vector(double x, double y, double z) { } void vector_print(Vector *v) { - printf("Vector %p = (%g, %g, %g)\n", v, v->x, v->y, v->z); + printf("Vector %p = (%g, %g, %g)\n", (void *)v, v->x, v->y, v->z); } %} diff --git a/Examples/tcl/variables/example.c b/Examples/tcl/variables/example.c index 05e17c8c5..85685fe72 100644 --- a/Examples/tcl/variables/example.c +++ b/Examples/tcl/variables/example.c @@ -52,9 +52,9 @@ void print_vars() { printf("cvar = %c\n", cvar); printf("strvar = %s\n", strvar ? strvar : "(null)"); printf("cstrvar = %s\n", cstrvar); - printf("iptrvar = %p\n", iptrvar); + printf("iptrvar = %p\n", (void *)iptrvar); printf("name = %s\n", name); - printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); + printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0); printf("pt = (%d, %d)\n", pt.x, pt.y); printf("status = %d\n", status); } From 3191473523de629d75181b134c75a83f7fd7297b Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 24 May 2014 00:14:18 +0100 Subject: [PATCH 070/152] Fix compiler warnings in generated code when using -std=c++98 -std=gnu89 -pedantic -Wreturn-type --- Lib/guile/guile_scm_run.swg | 3 +- Lib/javascript/v8/javascriptinit.swg | 2 +- Lib/lua/lua_fnptr.i | 1 - Lib/lua/luarun.swg | 122 ++++++++++++++++----------- Lib/lua/luaruntime.swg | 2 +- Lib/lua/typemaps.i | 2 +- Lib/php/const.i | 4 +- Lib/php/utils.i | 2 +- Lib/ruby/file.i | 2 +- 9 files changed, 80 insertions(+), 60 deletions(-) diff --git a/Lib/guile/guile_scm_run.swg b/Lib/guile/guile_scm_run.swg index 322d660c5..94cf4d101 100644 --- a/Lib/guile/guile_scm_run.swg +++ b/Lib/guile/guile_scm_run.swg @@ -27,8 +27,7 @@ scm_module_variable (SCM module, SCM sym) #endif #if SCM_MAJOR_VERSION >= 2 -// scm_c_define_gsubr takes a different parameter type -// depending on the guile version +/* scm_c_define_gsubr takes a different parameter type depending on the guile version */ typedef scm_t_subr swig_guile_proc; #else diff --git a/Lib/javascript/v8/javascriptinit.swg b/Lib/javascript/v8/javascriptinit.swg index de1fe91f4..b428d4af9 100644 --- a/Lib/javascript/v8/javascriptinit.swg +++ b/Lib/javascript/v8/javascriptinit.swg @@ -113,6 +113,6 @@ void SWIGV8_INIT (v8::Handle exports, v8::Handle /*modul } #if defined(BUILDING_NODE_EXTENSION) -NODE_MODULE($jsname, $jsname_initialize); +NODE_MODULE($jsname, $jsname_initialize) #endif %} diff --git a/Lib/lua/lua_fnptr.i b/Lib/lua/lua_fnptr.i index 4e2c8dc6a..481cfafa6 100644 --- a/Lib/lua/lua_fnptr.i +++ b/Lib/lua/lua_fnptr.i @@ -103,7 +103,6 @@ void swiglua_ref_clear(SWIGLUA_REF* pref){ } void swiglua_ref_set(SWIGLUA_REF* pref,lua_State* L,int idx){ -// swiglua_ref_clear(pref); /* just in case */ pref->L=L; lua_pushvalue(L,idx); /* copy obj to top */ pref->ref=luaL_ref(L,LUA_REGISTRYINDEX); /* remove obj from top & put into registry */ diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index 7cfcff212..1dd3b9f09 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -630,10 +630,12 @@ SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace * /* Register all classes in the namespace */ SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) { + swig_lua_class **classes; + /* There must be a module/namespace table at the top of the stack */ assert(lua_istable(L,-1)); - swig_lua_class **classes = ns->ns_classes; + classes = ns->ns_classes; if( classes != 0 ) { while(*classes != 0) { @@ -650,6 +652,7 @@ SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace */ SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) { + swig_lua_namespace **sub_namespace; /* 1 argument - table on the top of the stack */ const int SWIGUNUSED begin = lua_gettop(L); assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ @@ -681,7 +684,7 @@ SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns /* Register classes */ SWIG_Lua_add_namespace_classes(L,ns); - swig_lua_namespace **sub_namespace = ns->ns_namespaces; + sub_namespace = ns->ns_namespaces; if( sub_namespace != 0) { while(*sub_namespace != 0) { SWIG_Lua_namespace_register(L, *sub_namespace, 1); @@ -753,22 +756,21 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED /* first_arg - position of the object in stack. Everything that is above are arguments * and is passed to every evocation of the func */ int last_arg = lua_gettop(L);/* position of last argument */ - int original_metatable; + int original_metatable = last_arg + 1; size_t bases_count; - int result; + int result = SWIG_ERROR; lua_getmetatable(L,first_arg); - original_metatable = last_arg + 1; SWIG_LUA_INIT_BASE_SEARCH(bases_count); - result = SWIG_ERROR; if(ret) *ret = 0; if(bases_count>0) { + int to_remove; size_t i; int j; + int subcall_last_arg; int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ int valid = 1; - int subcall_last_arg; swig_type_info *base_swig_type = 0; for(j=first_arg;j<=last_arg;j++) lua_pushvalue(L,j); @@ -792,7 +794,7 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED lua_pushvalue(L,original_metatable); lua_setmetatable(L,first_arg); /* Clear - remove everything between last_arg and subcall_last_arg including */ - const int to_remove = subcall_last_arg - last_arg; + to_remove = subcall_last_arg - last_arg; for(j=0;jtype; + int result; + swig_lua_userdata *usr; + swig_type_info *type; int ret = 0; - int result = SWIG_Lua_class_do_get(L,type,1,&ret); + assert(lua_isuserdata(L,1)); + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + type = usr->type; + result = SWIG_Lua_class_do_get(L,type,1,&ret); if(result == SWIG_OK) return ret; @@ -902,6 +905,7 @@ SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int fi (3) any for the new value */ + int bases_search_result; int substack_start = lua_gettop(L) - 3; lua_checkstack(L,5); assert(lua_isuserdata(L,substack_start+1)); /* just in case */ @@ -944,14 +948,12 @@ SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int fi lua_pop(L,1); /* remove value */ lua_pop(L,1); /* remove metatable */ - { - /* Search among bases */ - int bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); - if(ret) - assert(*ret == 0); - assert(lua_gettop(L) == substack_start + 3); - return bases_search_result; - } + /* Search among bases */ + bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); + if(ret) + assert(*ret == 0); + assert(lua_gettop(L) == substack_start + 3); + return bases_search_result; } /* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly @@ -964,11 +966,14 @@ SWIGINTERN int SWIG_Lua_class_set(lua_State *L) (2) string name of the attribute (3) any for the new value */ - assert(lua_isuserdata(L,1)); - swig_lua_userdata *usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - swig_type_info *type = usr->type; int ret = 0; - int result = SWIG_Lua_class_do_set(L,type,1,&ret); + int result; + swig_lua_userdata *usr; + swig_type_info *type; + assert(lua_isuserdata(L,1)); + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + type = usr->type; + result = SWIG_Lua_class_do_set(L,type,1,&ret); if(result != SWIG_OK) { SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); lua_error(L); @@ -1004,13 +1009,15 @@ SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) { /* there should be 1 param passed in (1) userdata (not the metatable) */ + const char *className; + void* userData; assert(lua_isuserdata(L,1)); /* just in case */ - void* userData = lua_touserdata(L,1); /* get the userdata address for later */ + userData = lua_touserdata(L,1); /* get the userdata address for later */ lua_getmetatable(L,1); /* get the meta table */ assert(lua_istable(L,-1)); /* just in case */ lua_getfield(L, -1, ".type"); - const char *className = lua_tostring(L, -1); + className = lua_tostring(L, -1); lua_pushfstring(L, "<%s userdata: %p>", className, userData); return 1; @@ -1238,10 +1245,10 @@ SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) { int i; + size_t bases_count = 0; /* Add bases to .bases table */ SWIG_Lua_get_table(L,".bases"); assert(lua_istable(L,-1)); /* just in case */ - size_t bases_count = 0; for(i=0;clss->bases[i];i++) { SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); @@ -1296,7 +1303,7 @@ SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration /* The real function that resolves a metamethod. * Function searches given class and all it's bases(recursively) for first instance of something that is - * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actuall metamethod implementation + * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the * answer. * Returns 1 if found, 0 otherwise. @@ -1310,6 +1317,9 @@ SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class int skip_check) { /* This function is called recursively */ + int result = 0; + int i = 0; + if (!skip_check) { SWIG_Lua_get_class_metatable(L, clss->fqname); lua_pushvalue(L, metamethod_name_idx); @@ -1326,8 +1336,6 @@ SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class } /* Forwarding calls to bases */ - int result = 0; - int i = 0; for(i=0;clss->bases[i];i++) { result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); @@ -1342,21 +1350,26 @@ SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class * and calls it */ SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) { + int numargs; + int metamethod_name_idx; + const swig_lua_class* clss; + int result; + lua_checkstack(L,5); - const int numargs = lua_gettop(L); /* number of arguments to pass to actuall metamethod */ + numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ /* Get upvalues from closure */ lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ - const int metamethod_name_idx = lua_gettop(L); + metamethod_name_idx = lua_gettop(L); lua_pushvalue(L, lua_upvalueindex(2)); - const swig_lua_class* clss = (const swig_lua_class*)(lua_touserdata(L,-1)); + clss = (const swig_lua_class*)(lua_touserdata(L,-1)); lua_pop(L,1); /* remove lightuserdata with clss from stack */ - /* Actuall work */ - const int result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); + /* Actual work */ + result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); if (!result) { - SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actuall metamethod. Memory corruption is most likely explanation."); + SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); lua_error(L); return 0; } @@ -1374,10 +1387,14 @@ SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) */ SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) { + int key_index; + int success = 0; + int i = 0; + /* metamethod name - on the top of the stack */ assert(lua_isstring(L,-1)); - const int key_index = lua_gettop(L); + key_index = lua_gettop(L); /* Check whether method is already defined in metatable */ lua_pushvalue(L,key_index); /* copy of the key */ @@ -1389,8 +1406,6 @@ SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class * lua_pop(L,1); /* Iterating over immediate bases */ - int success = 0; - int i = 0; for(i=0;clss->bases[i];i++) { const swig_lua_class *base = clss->bases[i]; @@ -1420,11 +1435,15 @@ SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class * SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) { + int metatable_index; + int metamethods_info_index; + int tostring_undefined; + SWIG_Lua_get_class_metatable(L, clss->fqname); - const int metatable_index = lua_gettop(L); + metatable_index = lua_gettop(L); SWIG_Lua_get_inheritable_metamethods(L); assert(lua_istable(L,-1)); - const int metamethods_info_index = lua_gettop(L); + metamethods_info_index = lua_gettop(L); lua_pushnil(L); /* first key */ while(lua_next(L, metamethods_info_index) != 0 ) { /* key at index -2, value at index -1 */ @@ -1442,7 +1461,7 @@ SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class lua_pushstring(L, "__tostring"); lua_pushvalue(L,-1); lua_rawget(L,metatable_index); - const int tostring_undefined = lua_isnil(L,-1); + tostring_undefined = lua_isnil(L,-1); lua_pop(L,1); if( tostring_undefined ) { lua_pushcfunction(L, SWIG_Lua_class_tostring); @@ -1494,6 +1513,7 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *cls */ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) { + int new_metatable_index; const int SWIGUNUSED begin = lua_gettop(L); int i; /* if name already there (class is already registered) then do nothing */ @@ -1520,11 +1540,12 @@ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *c * It would get us all special methods: __getitem, __add etc. * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away */ - const int new_metatable_index = lua_absindex(L,-1); + new_metatable_index = lua_absindex(L,-1); for(i=0;clss->bases[i];i++) { + int base_metatable; SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - const int base_metatable = lua_absindex(L,-1); + base_metatable = lua_absindex(L,-1); SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); lua_pop(L,1); } @@ -1573,6 +1594,7 @@ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *c SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) { + int SWIGUNUSED begin; assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ SWIG_Lua_class_register_instance(L,clss); SWIG_Lua_class_register_static(L,clss); @@ -1587,7 +1609,7 @@ SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) * | ".set" --> .... * |=============================== ".instance" */ - const int SWIGUNUSED begin = lua_gettop(L); + begin = lua_gettop(L); lua_pushstring(L,clss->cls_static->name); lua_rawget(L,-2); /* get class static table */ assert(lua_istable(L,-1)); diff --git a/Lib/lua/luaruntime.swg b/Lib/lua/luaruntime.swg index 26dab93f6..89908044b 100644 --- a/Lib/lua/luaruntime.swg +++ b/Lib/lua/luaruntime.swg @@ -29,6 +29,7 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ { #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ int i; + int globalRegister = 0; /* start with global table */ lua_pushglobaltable (L); /* SWIG's internal initialisation */ @@ -49,7 +50,6 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); } } - int globalRegister = 0; #ifdef SWIG_LUA_MODULE_GLOBAL globalRegister = 1; #endif diff --git a/Lib/lua/typemaps.i b/Lib/lua/typemaps.i index 7a095a1e0..c662cd31e 100644 --- a/Lib/lua/typemaps.i +++ b/Lib/lua/typemaps.i @@ -296,7 +296,7 @@ This is one giant macro to define the typemaps & the helpers for array handling */ %define SWIG_TYPEMAP_NUM_ARR(NAME,TYPE) -%{SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE);%} +%{SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)%} // fixed size array's %typemap(in) TYPE INPUT[ANY] diff --git a/Lib/php/const.i b/Lib/php/const.i index 82c48022b..329b0cf07 100644 --- a/Lib/php/const.i +++ b/Lib/php/const.i @@ -34,12 +34,12 @@ SWIGTYPE &&, SWIGTYPE [] { zval *z_var; + zend_constant c; + size_t len = sizeof("$symname") - 1; MAKE_STD_ZVAL(z_var); SWIG_SetPointerZval(z_var, (void*)$value, $1_descriptor, 0); - zend_constant c; c.value = *z_var; zval_copy_ctor(&c.value); - size_t len = sizeof("$symname") - 1; c.name = zend_strndup("$symname", len); c.name_len = len+1; c.flags = CONST_CS | CONST_PERSISTENT; diff --git a/Lib/php/utils.i b/Lib/php/utils.i index 4e53e25a7..408a3b366 100644 --- a/Lib/php/utils.i +++ b/Lib/php/utils.i @@ -92,6 +92,7 @@ %fragment("t_output_helper","header") %{ static void t_output_helper(zval **target, zval *o TSRMLS_DC) { + zval *tmp; if ( (*target)->type == IS_ARRAY ) { /* it's already an array, just append */ add_next_index_zval( *target, o ); @@ -102,7 +103,6 @@ t_output_helper(zval **target, zval *o TSRMLS_DC) { FREE_ZVAL(o); return; } - zval *tmp; ALLOC_INIT_ZVAL(tmp); *tmp = **target; zval_copy_ctor(tmp); diff --git a/Lib/ruby/file.i b/Lib/ruby/file.i index d64937ed1..f9aaa2754 100644 --- a/Lib/ruby/file.i +++ b/Lib/ruby/file.i @@ -4,7 +4,7 @@ extern "C" { #endif -// Ruby 1.9 changed the file name of this header +/* Ruby 1.9 changed the file name of this header */ #ifdef HAVE_RUBY_IO_H #include "ruby/io.h" #else From c2368a40b244e3454a0300e5c671ebe6e98048ab Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 24 May 2014 09:30:37 +0100 Subject: [PATCH 071/152] Javascript warnings for c++98 - remove vla --- Lib/javascript/jsc/javascriptstrings.swg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/javascript/jsc/javascriptstrings.swg b/Lib/javascript/jsc/javascriptstrings.swg index 10a0e252a..b3f46ae41 100644 --- a/Lib/javascript/jsc/javascriptstrings.swg +++ b/Lib/javascript/jsc/javascriptstrings.swg @@ -53,7 +53,7 @@ SWIG_JSC_FromCharPtrAndSize(JSContextRef context, const char* carray, size_t siz } else { JSStringRef jsstring; if(size < 2) { - char c[size+1]; + char c[2]; int i; for(i=0;i Date: Sat, 24 May 2014 10:12:06 +0100 Subject: [PATCH 072/152] Refactor Lua class base search to make ISO c/c++ compliant --- Lib/lua/luarun.swg | 85 +++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index 1dd3b9f09..6f2068e7a 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -708,46 +708,6 @@ SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); -/* Macros for iteration among class bases */ -#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) -#define SWIG_LUA_INIT_BASE_SEARCH(bases_count)\ - (void)swig_type;\ - SWIG_Lua_get_table(L,".bases");\ - assert(lua_istable(L,-1));\ - bases_count = lua_rawlen(L,-1);\ - const int bases_table = lua_gettop(L); -#define SWIG_LUA_GET_BASE_METATABLE(i,base_swig_type, valid)\ - lua_rawgeti(L,bases_table,i+1);\ - base_swig_type = 0;\ - if(lua_isnil(L,-1)) {\ - valid = 0;\ - lua_pop(L,1);\ - } else\ - valid = 1; - -#else /* In elua .bases table doesn't exist. Use table from swig_lua_class */ - -#define SWIG_LUA_INIT_BASE_SEARCH(bases_count)\ - assert(swig_type!=0);\ - swig_module_info *module=SWIG_GetModule(L);\ - swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases;\ - const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names;\ - bases_count = 0;\ - for(;base_names[bases_count];bases_count++);/* get length of bases */ - -#define SWIG_LUA_GET_BASE_METATABLE(i,base_swig_type, valid)\ - swig_lua_class *base_class = bases[i];\ - if(!base_class)\ - valid = 0;\ - else {\ - valid = 1;\ - SWIG_Lua_get_class_metatable(L,base_class->fqname);\ - base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]);\ - assert(base_swig_type != 0);\ - } - -#endif - typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, @@ -759,8 +719,28 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED int original_metatable = last_arg + 1; size_t bases_count; int result = SWIG_ERROR; + int bases_table; + (void)swig_type; lua_getmetatable(L,first_arg); - SWIG_LUA_INIT_BASE_SEARCH(bases_count); + + /* initialise base search */ +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); + bases_count = lua_rawlen(L,-1); + bases_table = lua_gettop(L); +#else + /* In elua .bases table doesn't exist. Use table from swig_lua_class */ + (void)bases_table; + assert(swig_type!=0); + swig_module_info *module=SWIG_GetModule(L); + swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; + const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; + bases_count = 0; + for(;base_names[bases_count]; + bases_count++);/* get length of bases */ +#endif + if(ret) *ret = 0; if(bases_count>0) @@ -778,7 +758,28 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ for(i=0;ifqname); + base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); + assert(base_swig_type != 0); + } +#endif + if(!valid) continue; assert(lua_isuserdata(L, subcall_first_arg)); From ab86f8a8f51a877615f173c37cd9da34f8bd5905 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 24 May 2014 10:29:34 +0100 Subject: [PATCH 073/152] Warning fixes in test-suite --- .../test-suite/smart_pointer_templatemethods.i | 2 +- Examples/test-suite/struct_initialization.i | 2 +- Examples/test-suite/typemap_array_qualifiers.i | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Examples/test-suite/smart_pointer_templatemethods.i b/Examples/test-suite/smart_pointer_templatemethods.i index f79bbcc9d..bd8808aff 100644 --- a/Examples/test-suite/smart_pointer_templatemethods.i +++ b/Examples/test-suite/smart_pointer_templatemethods.i @@ -45,7 +45,7 @@ public: %template(QueryInterfaceObjct) Objct::QueryInterface; #endif -}; // namespace +} // namespace %} diff --git a/Examples/test-suite/struct_initialization.i b/Examples/test-suite/struct_initialization.i index c378ba31d..da1604f1b 100644 --- a/Examples/test-suite/struct_initialization.i +++ b/Examples/test-suite/struct_initialization.i @@ -3,7 +3,7 @@ %inline %{ -// Named types +/* Named types */ struct StructA { int x; } instanceA1; diff --git a/Examples/test-suite/typemap_array_qualifiers.i b/Examples/test-suite/typemap_array_qualifiers.i index 14df649d3..cbc6c95ff 100644 --- a/Examples/test-suite/typemap_array_qualifiers.i +++ b/Examples/test-suite/typemap_array_qualifiers.i @@ -43,8 +43,8 @@ $1 = 0; /* Correct typemap for $symname: $type */ } %inline %{ - void func1a(myarray x) {}; - void func1b(volatile myarray x) {}; + void func1a(myarray x) {} + void func1b(volatile myarray x) {} %} CLEAR_SWIGTYPE_TYPEMAPS; @@ -57,9 +57,9 @@ $1 = 0; /* Correct typemap for $symname: $type */ } %inline %{ - void func2a(const myarray x) {}; - void func2b(const myconstarray x) {}; - void func2c(const volatile myconstarray x) {}; + void func2a(const myarray x) {} + void func2b(const myconstarray x) {} + void func2c(const volatile myconstarray x) {} %} CLEAR_SWIGTYPE_TYPEMAPS; @@ -72,7 +72,7 @@ $1 = 0; /* Correct typemap for $symname: $type */ } %inline %{ - void func3a(const mycrazyarray x, const mycrazyarray y[7]) {}; + void func3a(const mycrazyarray x, const mycrazyarray y[7]) {} %} CLEAR_SWIGTYPE_TYPEMAPS; @@ -81,5 +81,5 @@ $1 = 0; /* Correct typemap for $symname: $type */ } %inline %{ - void func4a(mycrazyfunc *const x, const mycrazyfuncptr y) {}; + void func4a(mycrazyfunc *const x, const mycrazyfuncptr y) {} %} From 5990872cf741fa31523e2b72ee66fdc8d27da442 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 24 May 2014 00:12:00 +0100 Subject: [PATCH 074/152] Travis testing - examples use stricter CFLAGS and CXXFLAGS --- .travis.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 96e4fc9a7..5859c946f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,6 +67,35 @@ before_install: - if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi + # Stricter compile flags for examples. Various headers and SWIG generated code prevents full use of -pedantic. + - declare -A CFLAGS_EXAMPLES && CFLAGS_EXAMPLES=( + ["csharp"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["go"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["guile"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["java"]="-Werror -std=gnu89 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["javascript"]="-Werror -std=gnu89 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["lua"]="-Werror -std=gnu89 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["octave"]="-Werror -std=gnu89 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["perl5"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["php"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["python"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["ruby"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["tcl"]="-Werror -std=gnu89 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ) + - declare -A CXXFLAGS_EXAMPLES && CXXFLAGS_EXAMPLES=( + ["csharp"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["go"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["guile"]="-Werror -std=c++98 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["java"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["javascript"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["lua"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["octave"]="-Werror -std=c++98 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["perl5"]="-Werror -std=c++98 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ["php"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["python"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["ruby"]="-Werror -std=c++98 -fdiagnostics-show-option -pedantic -Wno-long-long -Wreturn-type" + ["tcl"]="-Werror -std=c++98 -fdiagnostics-show-option -Wno-long-long -Wreturn-type" + ) - $CC --version - $CXX --version script: @@ -81,7 +110,7 @@ script: - if test -z "$SWIGLANG"; then sudo make -s install && swig -version && ccache-swig -V; fi - echo -en 'travis_fold:end:script.2\\r' - if test -n "$SWIGLANG"; then make -s check-$SWIGLANG-version; fi - - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples; fi + - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples CFLAGS="${CFLAGS_EXAMPLES[$SWIGLANG]}" CXXFLAGS="${CXXFLAGS_EXAMPLES[$SWIGLANG]}"; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi - echo 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r' - make maintainer-clean && ../../configure $CONFIGOPTS From 20ddfb7fcded992bd0e98b9ef8797104fe0900fd Mon Sep 17 00:00:00 2001 From: Harvey Falcic Date: Sat, 24 May 2014 13:22:41 -0400 Subject: [PATCH 075/152] Python 3 'surrogateescape' docs: fix div class for Python code --- Doc/Manual/Python.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index 45725065d..6dc0ff9ba 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -5962,8 +5962,8 @@ When this method is called from Python 3, the return value is the following text string:

    -
    ->>> s = test.non_utf8_c_str()
    +
    +>>> s = example.non_utf8_c_str()
     >>> s
     'h\udce9llo wörld'
     
    @@ -5974,7 +5974,7 @@ bytes are represented as high surrogate characters that can be used to obtain the original byte sequence:

    -
    +
     >>> b = s.encode('utf-8', errors='surrogateescape')
     >>> b
     b'h\xe9llo w\xc3\xb6rld'
    @@ -5985,7 +5985,7 @@ One can then attempt a different encoding, if desired (or simply leave the
     byte string as a raw sequence of bytes for use in binary protocols):
     

    -
    +
     >>> b.decode('latin-1')
     'héllo wörld'
     
    @@ -5995,7 +5995,7 @@ Note, however, that text strings containing surrogate characters are rejected with the default strict codec error handler. For example:

    -
    +
     >>> with open('test', 'w') as f:
     ...     print(s, file=f)
     ...
    
    From bdc63e5a9faf8b2cc0a8b311ab0eea9edd026d02 Mon Sep 17 00:00:00 2001
    From: Karl Wette 
    Date: Sat, 24 May 2014 20:07:52 +0200
    Subject: [PATCH 076/152] Remove example Makefiles when running
     distclean-examples in out-of-src build
    
    ---
     Makefile.in | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/Makefile.in b/Makefile.in
    index da9dfdce5..a040d41a1 100644
    --- a/Makefile.in
    +++ b/Makefile.in
    @@ -420,6 +420,11 @@ distclean-examples:
     	@echo distcleaning Examples
     	@$(MAKE) $(FLAGS) clean-examples
     	@cd Examples && $(MAKE) $(FLAGS) distclean
    +	@if test "x$(srcdir)" != "x."; then \
    +		for mkfile in `cd $(srcdir) && find Examples/ -type f -name Makefile`; do \
    +			rm -f "$$mkfile"; \
    +		done; \
    +	fi
     
     distclean-ccache:
     	@test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) $(FLAGS) distclean)
    
    From 3e978fce9ff9d655a7e9469a59c5d6ccc73fb7cb Mon Sep 17 00:00:00 2001
    From: Karl Wette 
    Date: Sat, 24 May 2014 20:25:56 +0200
    Subject: [PATCH 077/152] Record files left over after maintainer-clean in
     Travis build
    
    ---
     .travis.yml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/.travis.yml b/.travis.yml
    index 5859c946f..89bed90a1 100644
    --- a/.travis.yml
    +++ b/.travis.yml
    @@ -113,7 +113,7 @@ script:
       - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples CFLAGS="${CFLAGS_EXAMPLES[$SWIGLANG]}" CXXFLAGS="${CXXFLAGS_EXAMPLES[$SWIGLANG]}"; fi
       - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi
       - echo 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r'
    -  - make maintainer-clean && ../../configure $CONFIGOPTS
    +  - make maintainer-clean && find . -type f | sed 's/^/File left after maintainer-clean - /' && ../../configure $CONFIGOPTS
       - echo -en 'travis_fold:end:script.3\\r'
     branches:
       only:
    
    From 5c5dfc106f00b4125f1ae7a173463afc8cdeccad Mon Sep 17 00:00:00 2001
    From: Harvey Falcic 
    Date: Sat, 24 May 2014 15:39:53 -0400
    Subject: [PATCH 078/152] Python unicode_strings test case: restrict to Python
     > 3.0
    
    Also adjust the test method names and content to match the docs.
    ---
     Examples/test-suite/python/unicode_strings_runme.py | 7 +++++--
     Examples/test-suite/unicode_strings.i               | 8 ++++----
     2 files changed, 9 insertions(+), 6 deletions(-)
    
    diff --git a/Examples/test-suite/python/unicode_strings_runme.py b/Examples/test-suite/python/unicode_strings_runme.py
    index 2d26599aa..162f40972 100644
    --- a/Examples/test-suite/python/unicode_strings_runme.py
    +++ b/Examples/test-suite/python/unicode_strings_runme.py
    @@ -1,4 +1,7 @@
    +import sys
    +
     import unicode_strings
     
    -unicode_strings.test_c_str()
    -unicode_strings.test_std_string()
    +if sys.version_info > (3, 0):
    +    unicode_strings.non_utf8_c_str()
    +    unicode_strings.non_utf8_std_string()
    diff --git a/Examples/test-suite/unicode_strings.i b/Examples/test-suite/unicode_strings.i
    index f4a8b8b50..56063c8a4 100644
    --- a/Examples/test-suite/unicode_strings.i
    +++ b/Examples/test-suite/unicode_strings.i
    @@ -4,12 +4,12 @@
     
     %inline %{
     
    -const char* test_c_str(void) {
    -        return "h\xe9llo";
    +const char* non_utf8_c_str(void) {
    +        return "h\xe9llo w\xc3\xb6rld";
     }
     
    -std::string test_std_string(void) {
    -        return std::string("h\xe9llo");
    +std::string non_utf8_std_string(void) {
    +        return std::string("h\xe9llo w\xc3\xb6rld");
     }
     
     %}
    
    From 2533d0210fb2f3b2e9f441c38bd03b99f4a57a44 Mon Sep 17 00:00:00 2001
    From: Harvey Falcic 
    Date: Sat, 24 May 2014 16:50:33 -0400
    Subject: [PATCH 079/152] unicode_strings test: check return values
    
    ---
     Examples/test-suite/python/unicode_strings_runme.py | 9 +++++++--
     1 file changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/Examples/test-suite/python/unicode_strings_runme.py b/Examples/test-suite/python/unicode_strings_runme.py
    index 162f40972..0e2e1af06 100644
    --- a/Examples/test-suite/python/unicode_strings_runme.py
    +++ b/Examples/test-suite/python/unicode_strings_runme.py
    @@ -2,6 +2,11 @@ import sys
     
     import unicode_strings
     
    +# The 'u' string prefix isn't valid in Python 3.0 - 3.2 and is redundant
    +# in 3.3+. Since this file is run through 2to3 before testing, though,
    +# mark this as a unicode string in 2.x so it'll become a str in 3.x.
    +test_string = u'h\udce9llo w\u00f6rld'
    +
     if sys.version_info > (3, 0):
    -    unicode_strings.non_utf8_c_str()
    -    unicode_strings.non_utf8_std_string()
    +    assert unicode_strings.non_utf8_c_str() == test_string
    +    assert unicode_strings.non_utf8_std_string() == test_string
    
    From ab527b0e4bf592e55b038a6de0fb8fe4540eea92 Mon Sep 17 00:00:00 2001
    From: Harvey Falcic 
    Date: Sat, 24 May 2014 17:54:53 -0400
    Subject: [PATCH 080/152] unicode_strings_runme.py: fix version check
    
    Python 3.0.1 shouldn't pass.
    ---
     Examples/test-suite/python/unicode_strings_runme.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/Examples/test-suite/python/unicode_strings_runme.py b/Examples/test-suite/python/unicode_strings_runme.py
    index 0e2e1af06..2110c5ce7 100644
    --- a/Examples/test-suite/python/unicode_strings_runme.py
    +++ b/Examples/test-suite/python/unicode_strings_runme.py
    @@ -7,6 +7,6 @@ import unicode_strings
     # mark this as a unicode string in 2.x so it'll become a str in 3.x.
     test_string = u'h\udce9llo w\u00f6rld'
     
    -if sys.version_info > (3, 0):
    +if sys.version_info[0:2] >= (3, 1):
         assert unicode_strings.non_utf8_c_str() == test_string
         assert unicode_strings.non_utf8_std_string() == test_string
    
    From 91e93838fc6dbc181181f6ffacb024b6a87cfe63 Mon Sep 17 00:00:00 2001
    From: Harvey Falcic 
    Date: Sat, 24 May 2014 18:00:04 -0400
    Subject: [PATCH 081/152] unicode_strings test: manually check values instead
     of using assert
    
    ---
     Examples/test-suite/python/unicode_strings_runme.py | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/Examples/test-suite/python/unicode_strings_runme.py b/Examples/test-suite/python/unicode_strings_runme.py
    index 2110c5ce7..e1fc7adec 100644
    --- a/Examples/test-suite/python/unicode_strings_runme.py
    +++ b/Examples/test-suite/python/unicode_strings_runme.py
    @@ -8,5 +8,7 @@ import unicode_strings
     test_string = u'h\udce9llo w\u00f6rld'
     
     if sys.version_info[0:2] >= (3, 1):
    -    assert unicode_strings.non_utf8_c_str() == test_string
    -    assert unicode_strings.non_utf8_std_string() == test_string
    +    if unicode_strings.non_utf8_c_str() != test_string:
    +        raise ValueError('Test comparison mismatch')
    +    if unicode_strings.non_utf8_std_string() != test_string:
    +        raise ValueError('Test comparison mismatch')
    
    From 575ac1c170cbfb9de6ced5f9e7075b928d4a4227 Mon Sep 17 00:00:00 2001
    From: William S Fulton 
    Date: Sun, 25 May 2014 00:01:24 +0100
    Subject: [PATCH 082/152] Add 3.0.1 release notes summary
    
    ---
     RELEASENOTES | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    diff --git a/RELEASENOTES b/RELEASENOTES
    index 949f58e38..542ff4b10 100644
    --- a/RELEASENOTES
    +++ b/RELEASENOTES
    @@ -4,6 +4,14 @@ and CHANGES files.
     
     Release Notes
     =============
    +SWIG-3.0.1 summary:
    +- Javascript module added. This supports JavascriptCore (Safari/Webkit),
    +  v8 (Chromium) and node.js currently.
    +- A few notable regressions introduced in 3.0.0 have been fixed - in 
    +  Lua, nested classes and parsing of operator <<.
    +- The usual round of bug fixes and minor improvements for:
    +  C#, GCJ, Go, Java, Lua, PHP and Python.
    +
     SWIG-3.0.0 summary:
     - This is a major new release focusing primarily on C++ improvements.
     - C++11 support added. Please see documentation for details of supported
    
    From 4ab2eb96cd34503f2ceaa3ee88c22801cb546dda Mon Sep 17 00:00:00 2001
    From: William S Fulton 
    Date: Sun, 25 May 2014 00:29:32 +0100
    Subject: [PATCH 083/152] R examples building out-of-source
    
    They still don't run though
    ---
     Examples/Makefile.in | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/Examples/Makefile.in b/Examples/Makefile.in
    index 3a91cddd3..caf848596 100644
    --- a/Examples/Makefile.in
    +++ b/Examples/Makefile.in
    @@ -14,7 +14,7 @@
     #
     # 2.   To use this makefile, set required variables, eg SRCS, INTERFACE,
     #      INTERFACEDIR, INCLUDES, LIBS, TARGET, and do a
    -#           $(MAKE) -f Makefile.template.in SRCS='$(SRCS)' \
    +#           $(MAKE) -f Makefile.template.in SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
     #           INCLUDES='$(INCLUDES) LIBS='$(LIBS)' INTERFACE='$(INTERFACE)' \
     #           INTERFACEDIR='$(INTERFACEDIR)' TARGET='$(TARGET)' method
     #
    @@ -1660,7 +1660,7 @@ r: $(SRCDIR_SRCS)
     ifneq ($(SRCDIR_SRCS),)
     	$(CC) -g -c $(CPPFLAGS) $(CFLAGS) $(R_CFLAGS) $(SRCDIR_SRCS) $(INCLUDES)
     endif
    -	+( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) $(OBJS) > /dev/null )
    +	+( PKG_CPPFLAGS="$(CPPFLAGS) $(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) $(OBJS) > /dev/null )
     
     # ----------------------------------------------------------------
     # Build a R dynamically loadable module (C++)
    @@ -1671,7 +1671,7 @@ r_cpp: $(SRCDIR_CXXSRCS)
     ifneq ($(SRCDIR_CXXSRCS),)
     	$(CXX) -g -c $(CPPFLAGS) $(CXXFLAGS) $(R_CFLAGS) $(SRCDIR_CXXSRCS) $(INCLUDES)
     endif
    -	+( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) $(OBJS) > /dev/null )
    +	+( PKG_CPPFLAGS="$(CPPFLAGS) $(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) $(OBJS) > /dev/null )
     
     # -----------------------------------------------------------------
     # Run R example
    
    From 597c671e8630f959b48d716ffbc0be57990dc585 Mon Sep 17 00:00:00 2001
    From: William S Fulton 
    Date: Sun, 25 May 2014 12:00:42 +0100
    Subject: [PATCH 084/152] More diagnostics for csharp_exceptions testcase for
     diagnosing erratic failures
    
    ---
     Examples/test-suite/csharp/csharp_exceptions_runme.cs | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/Examples/test-suite/csharp/csharp_exceptions_runme.cs b/Examples/test-suite/csharp/csharp_exceptions_runme.cs
    index 43585b106..51805ce87 100644
    --- a/Examples/test-suite/csharp/csharp_exceptions_runme.cs
    +++ b/Examples/test-suite/csharp/csharp_exceptions_runme.cs
    @@ -323,7 +323,9 @@ public class TestThread {
              } catch (ArgumentOutOfRangeException e) {
                String expectedMessage = "caught:" + i + "\n" + "Parameter name: input";
                if (e.Message.Replace(runme.CRLF,"\n") != expectedMessage)
    -             throw new Exception("Exception message incorrect. Expected:\n[" + expectedMessage + "]\n" + "Received:\n[" + e.Message + "]");
    +             throw new Exception("Exception message incorrect. Expected:\n[" + 
    +                 expectedMessage + "]\n" + "Received:\n[" + 
    +                 e.Message + "]");
                if (e.ParamName != "input")
                  throw new Exception("Exception ParamName incorrect. Expected:\n[input]\n" + "Received:\n[" + e.ParamName + "]");
                if (e.InnerException != null)
    @@ -333,7 +335,7 @@ public class TestThread {
                throw new Exception("throwsException.dub = " + throwsClass.dub + " expected: 1234.5678");
            }
          } catch (Exception e) {
    -       Console.Error.WriteLine("Test failed (thread " + threadId + "): " + e.Message);
    +       Console.Error.WriteLine("Test failed (thread " + threadId + "): " + e.Message + "\n  TestThread Inner stack trace: " + e.StackTrace);
            Failed = true;
          }
        }
    
    From 01f8253b192224d8996e5bffd3c8121fa32ad0ea Mon Sep 17 00:00:00 2001
    From: Oliver Buchtala 
    Date: Mon, 26 May 2014 21:38:00 +0200
    Subject: [PATCH 085/152] Javascript: added a section about known issues.
    
    ---
     Doc/Manual/Javascript.html | 32 +++++++++++---------------------
     1 file changed, 11 insertions(+), 21 deletions(-)
    
    diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html
    index 011e61051..e6f422bd8 100644
    --- a/Doc/Manual/Javascript.html
    +++ b/Doc/Manual/Javascript.html
    @@ -128,33 +128,23 @@ $ make check-javascript-examples ENGINE=jsc
     $ make check-javascript-test-suite ENGINE=jsc
    -

    Tests should run without any problems, i.e., have been tried out, on the following platforms/interpreters:

    -
    -
    -- Ubuntu Precise 12.04 64bit
    -    - JavascriptCore (Webkit 1.8.3)
    -    - Node.js (0.10.26)
    -    - v8 (3.7.12)
    -- Ubuntu Saucy 13.10 64bit
    -    - JavascriptCore (Webkit 1.10.2)
    -    - Node.js
    -    - v8 (3.14.5)
    -- Mac OSX Mountain Lion 10.8
    -    - JavascriptCore (built-in)
    -    - Node.js
    -- Windows 7 64bit (VS 2010)
    -    - Node.js
    -
    -

    26.2.3 Future work

    +

    26.2.1 Known Issues

    +

    At the moment, the Javascript generators pass all tests syntactically, i.e., the generated source code compiles. However, there are still remaining runtime issues.

    -

    The Javascript module is not yet as mature as other modules and some things are still missing. As it makes use of SWIG's Unified Typemap Library (UTL), many typemaps are inherited. We could work on that if requested:

      -
    • More typemaps: compared to other modules there are only a few typemaps implemented. For instance a lot of the std_*.i typemaps are missing, such as std_iostream, for instance.

    • -
    • Director support: this would allow to extend a C++ abstract base class in Javascript. A pragmatic intermediate step for the most important usecase would be to support Javascript callbacks as arguments.

    • +
    • Default optional arguments do not work for all targeted interpreters

    • +
    • Mutliple output arguments do not work for JSC

    • +
    • Memory leaks have been observed for all generators

    • +
    • C89 incompatibily: the JSC generator might still generate C89 violating code

    • +
    • long long is not supported q

    • +
    • Javascript callbacks are not supported

    • +
    • instanceOf does not work under JSC

    +

    The primary development environment has been Linux (Ubuntu 12.04). Windows and OSX have been tested sporadically. Therefore, the generators might have more issues on those platforms. Please report back any problem you observe to help us improving this module quickly.

    +

    26.3 Integration

    From 6f69555225d818530e60cc50a7cd57f8bafd46f1 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Mon, 19 May 2014 17:15:49 -0700 Subject: [PATCH 086/152] JavaScriptCore: Fixed exception object so sourceURL (file name), line (number), and message can be recovered. The current implementation only returns an error string. But this is insufficient for debugging (what file and line number did it fail at?). As documented here: http://parmanoir.com/Taming_JavascriptCore_within_and_without_WebView converting the JSValueRef of string to an JSObjectRef (via JSValueToObject) will trigger JSCore into filling the "sourceURL" and "line" properties into the object so they can be inspected by the caller. Additionally, JavaScriptCore has a "message" property which contains the message string. JSCore doesn't seem to be filling this in for us automatically, unlike "sourceURL" and "line". So this patch also fills that property in too. Thanks to Brian Barnes for the detailed information about "sourceURL", "line", and "message". Below is an example (derived from Brian Barnes's information) on how you typically use/extract these exception details. void script_exception_to_string(JSContextRef js_context,JSValueRef exception_value_ref,char* return_error_string, int return_error_string_max_length) { JSObjectRef exception_object; JSValueRef value_ref; JSStringRef jsstring_property_name = NULL; JSValueRef temporary_exception = NULL; JSStringRef js_return_string = NULL; size_t bytes_needed; char* c_result_string = NULL; exception_object = JSValueToObject(js_context, exception_value_ref, NULL); // source and line numbers strcpy(return_error_string,"["); jsstring_property_name = JSStringCreateWithUTF8CString("sourceURL"); value_ref = JSObjectGetProperty(js_context, exception_object, jsstring_property_name, &temporary_exception); JSStringRelease(jsstring_property_name); js_return_string = JSValueToStringCopy(js_context, value_ref, NULL); bytes_needed = JSStringGetMaximumUTF8CStringSize(js_return_string); c_result_string = (char*)calloc(bytes_needed, sizeof(char)); JSStringGetUTF8CString(js_return_string, c_result_string, bytes_needed); SDL_Log("c_result_string: %s\n", c_result_string); JSStringRelease(js_return_string); strncat(return_error_string, c_result_string, return_error_string_max_length-1); free(c_result_string); strncat(return_error_string, ":", return_error_string_max_length-1); jsstring_property_name = JSStringCreateWithUTF8CString("line"); value_ref = JSObjectGetProperty(js_context, exception_object, jsstring_property_name, &temporary_exception); JSStringRelease(jsstring_property_name); js_return_string = JSValueToStringCopy(js_context, value_ref, NULL); bytes_needed = JSStringGetMaximumUTF8CStringSize(js_return_string); c_result_string = (char*)calloc(bytes_needed, sizeof(char)); JSStringGetUTF8CString(js_return_string, c_result_string, bytes_needed); SDL_Log("c_result_string: %s\n", c_result_string); JSStringRelease(js_return_string); strncat(return_error_string, c_result_string, return_error_string_max_length-1); //SDL_Log("c_result_string: %s\n", c_result_string); free(c_result_string); strncat(return_error_string, "]", return_error_string_max_length-1); /* get message */ jsstring_property_name = JSStringCreateWithUTF8CString("message"); value_ref = JSObjectGetProperty(js_context, exception_object, jsstring_property_name, &temporary_exception); JSStringRelease(jsstring_property_name); if(NULL == value_ref) { strncat(return_error_string, "Unknown Error", return_error_string_max_length-1); } else { js_return_string = JSValueToStringCopy(js_context, value_ref, NULL); bytes_needed = JSStringGetMaximumUTF8CStringSize(js_return_string); c_result_string = (char*)calloc(bytes_needed, sizeof(char)); JSStringGetUTF8CString(js_return_string, c_result_string, bytes_needed); SDL_Log("c_result_string: %s\n", c_result_string); JSStringRelease(js_return_string); strncat(return_error_string, c_result_string, return_error_string_max_length-1); //SDL_Log("c_result_string: %s\n", c_result_string); free(c_result_string); } } To use: if(js_exception) { char return_error_string[256]; script_exception_to_string(js_context, js_exception, return_error_string, 256); SDL_Log("Compile error is %s", return_error_string); } --- Lib/javascript/jsc/javascriptrun.swg | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index ae1567e87..1fde8855b 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -9,8 +9,29 @@ SWIGRUNTIME void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* type) { JSStringRef message = JSStringCreateWithUTF8CString(type); - *exception = JSValueMakeString(context, message); - JSStringRelease(message); + JSStringRef message_property_key; + JSObjectRef exception_object; + JSValueRef exception_value; + JSValueRef message_value; + exception_value = JSValueMakeString(context, message); + /* Converting the result to an object will let JavascriptCore add "sourceURL" (file) and "line" (number) to the exception, + instead of just returning a raw string. This is extremely important for debugging your errors. + */ + exception_object = JSValueToObject(context, exception_value, NULL); + + /* Additionally, JSCore uses "message" which contains the error description. + But it seems that unlike "sourceURL" and "line", converting to an object is not automatically doing this. + So we can add it ourselves. + */ + message_property_key = JSStringCreateWithUTF8CString("message"); + message_value = JSValueMakeString(context, message); + JSObjectSetProperty(context, exception_object, message_property_key, message_value, kJSClassAttributeNone, NULL); + + /* Return the exception_object */ + *exception = exception_object; + + JSStringRelease(message_property_key); + JSStringRelease(message); } SWIGRUNTIME void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { From f1c331f2c5b5df607edb581cf7711b7f40d2fb09 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Mon, 19 May 2014 17:42:00 -0700 Subject: [PATCH 087/152] JavaScriptCore: Returning NULL for wrapper functions that expect JSValueRef may crash program. According to this: http://parmanoir.com/Taming_JavascriptCore_within_and_without_WebView Returning NULL instead of an actual JSValueRef for a return value of a function could lead to crashes. I think I have seen related weirdness in the past when I failed to return a proper type to JSCore which resulted in very hard to understand behavior. So this patch changes those return NULLs to return JSValueMakeUndefined(). I thought about JSObjectMakeError, but I don't fully understand the intent of the Error object and can't find any relevant real world examples of it being used. However, everybody seems to be using JSValueMakeUndefined(). This patch should be low impact since this is only triggered on an error condition. --- Lib/javascript/jsc/javascriptcode.swg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/javascript/jsc/javascriptcode.swg b/Lib/javascript/jsc/javascriptcode.swg index 3fe9d49e9..f8c5a200f 100644 --- a/Lib/javascript/jsc/javascriptcode.swg +++ b/Lib/javascript/jsc/javascriptcode.swg @@ -17,7 +17,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); goto fail; fail: - return NULL; + return JSValueMakeUndefined(context); } %} @@ -78,7 +78,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size goto fail; fail: - return NULL; + return JSValueMakeUndefined(context); } %} @@ -159,7 +159,7 @@ static JSValueRef $jswrapper(JSContextRef context, JSObjectRef thisObject, JSStr goto fail; fail: - return NULL; + return JSValueMakeUndefined(context); } %} @@ -204,7 +204,7 @@ static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjec goto fail; fail: - return NULL; + return JSValueMakeUndefined(context); } %} @@ -229,7 +229,7 @@ static JSValueRef $jswrapper(JSContextRef context, JSObjectRef function, JSObjec goto fail; fail: - return NULL; + return JSValueMakeUndefined(context); } %} From e7b20624cc32d1220d5ad53370bfc1d92c8657c4 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Mon, 19 May 2014 19:00:43 -0700 Subject: [PATCH 088/152] JavaScriptCore: Reverted 2 of the JSValueMakeUndefined replacements because those functions are tied to JSObjectRef instead of JSValueRef. The C compiler will allow this, but C++ will reject the conversion. It is unclear what the correct handling is for JavaScriptCore. (Nobody bothers to document this in JSCore.) Unlike our other problem where we incorrectly assume JSObjectRef when the functions want JSValueRef, this time Apple is demanding the JSObjectRef. Like our other problem, I assume it is unsafe to try to convert Undefined into a JSObjectRef. So reverting to NULL seems like the safer bet for this specific case. Perhaps the other alternative is to return an exception object or an error object. But I would like to see JSCore document this before trying. --- Lib/javascript/jsc/javascriptcode.swg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/javascript/jsc/javascriptcode.swg b/Lib/javascript/jsc/javascriptcode.swg index f8c5a200f..c18902fce 100644 --- a/Lib/javascript/jsc/javascriptcode.swg +++ b/Lib/javascript/jsc/javascriptcode.swg @@ -17,7 +17,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_$jsmangledtype, SWIG_POINTER_OWN); goto fail; fail: - return JSValueMakeUndefined(context); + return NULL; } %} @@ -78,7 +78,7 @@ static JSObjectRef $jswrapper(JSContextRef context, JSObjectRef thisObject, size goto fail; fail: - return JSValueMakeUndefined(context); + return NULL; } %} From 1766e67a1af127f42c908090e8d46b49de30ce19 Mon Sep 17 00:00:00 2001 From: Eric Wing Date: Wed, 21 May 2014 03:43:52 -0700 Subject: [PATCH 089/152] JavaScriptCore: Improved code that uses JSObjectMakeError instead of JSValueToObject to create the exception object. JSObjectMakeError automatically populates the "message" field, and possibly other fields I don't know about. This seems to be the most robust way to create an exception object. Thanks to Brian Barnes again for the tip on JSObjectMakeError. --- Lib/javascript/jsc/javascriptrun.swg | 40 ++++++++++++---------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/Lib/javascript/jsc/javascriptrun.swg b/Lib/javascript/jsc/javascriptrun.swg index 1fde8855b..676a45833 100644 --- a/Lib/javascript/jsc/javascriptrun.swg +++ b/Lib/javascript/jsc/javascriptrun.swg @@ -8,30 +8,24 @@ #define SWIG_fail goto fail SWIGRUNTIME void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* type) { - JSStringRef message = JSStringCreateWithUTF8CString(type); - JSStringRef message_property_key; - JSObjectRef exception_object; - JSValueRef exception_value; - JSValueRef message_value; - exception_value = JSValueMakeString(context, message); - /* Converting the result to an object will let JavascriptCore add "sourceURL" (file) and "line" (number) to the exception, - instead of just returning a raw string. This is extremely important for debugging your errors. - */ - exception_object = JSValueToObject(context, exception_value, NULL); - - /* Additionally, JSCore uses "message" which contains the error description. - But it seems that unlike "sourceURL" and "line", converting to an object is not automatically doing this. - So we can add it ourselves. + JSStringRef message = JSStringCreateWithUTF8CString(type); + JSValueRef error_arguments[1]; + JSObjectRef exception_object; + JSValueRef exception_value; + exception_value = JSValueMakeString(context, message); + /* Converting the result to an object will let JavascriptCore add + "sourceURL" (file) and "line" (number) and "message" to the exception, + instead of just returning a raw string. This is extremely important for debugging your errors. + Using JSObjectMakeError is better than JSValueToObject because the latter only populates + "sourceURL" and "line", but not "message" or any others I don't know about. */ - message_property_key = JSStringCreateWithUTF8CString("message"); - message_value = JSValueMakeString(context, message); - JSObjectSetProperty(context, exception_object, message_property_key, message_value, kJSClassAttributeNone, NULL); - - /* Return the exception_object */ - *exception = exception_object; - - JSStringRelease(message_property_key); - JSStringRelease(message); + error_arguments[0] = exception_value; + exception_object = JSObjectMakeError(context, 1, error_arguments, NULL); + + /* Return the exception_object */ + *exception = exception_object; + + JSStringRelease(message); } SWIGRUNTIME void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { From 1df7ca77a061b961e054689bc8b61e60ed9ad93d Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Tue, 27 May 2014 10:40:16 +0200 Subject: [PATCH 090/152] JavascriptCore: added documentation about how to extract details from JSC errors. This code is necessary for embedding applications to present details about JS exceptions. --- Doc/Manual/Javascript.html | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index e6f422bd8..246669a22 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -41,6 +41,7 @@
  • Code Templates
  • Emitter
  • Emitter states +
  • Handling Exceptions in JavascriptCore
  • @@ -870,5 +871,87 @@ state.clazz(RESET); state.clazz(NAME, Getattr(n, "sym:name"));

    State information can be retrieved using state.clazz(NAME) or with Getattr on state.clazz() which actually returns a Hash instance.

    + + +

    26.5.5. Handling Exceptions in JavascriptCore

    + + +

    Applications with an embedded JavascriptCore should be able to present detailed exception messages that occur in the Javascript engine. Below is an example derived from code provided by Brian Barnes on how these exception details can be extracted.

    +
    +
    +void script_exception_to_string(JSContextRef js_context,JSValueRef exception_value_ref,char* return_error_string, int return_error_string_max_length)
    +{
    +  JSObjectRef exception_object;
    +  JSValueRef value_ref;
    +  JSStringRef jsstring_property_name = NULL;
    +  JSValueRef temporary_exception = NULL;
    +  JSStringRef js_return_string = NULL;
    +  size_t bytes_needed;
    +  char* c_result_string = NULL;
    +  exception_object = JSValueToObject(js_context, exception_value_ref, NULL);
    +
    +  /* source url */
    +  strcpy(return_error_string,"[");
    +  jsstring_property_name = JSStringCreateWithUTF8CString("sourceURL");
    +  value_ref = JSObjectGetProperty(js_context, exception_object, jsstring_property_name, &temporary_exception);
    +  JSStringRelease(jsstring_property_name);
    +  js_return_string = JSValueToStringCopy(js_context, value_ref, NULL);
    +  bytes_needed = JSStringGetMaximumUTF8CStringSize(js_return_string);
    +  c_result_string = (char*)calloc(bytes_needed, sizeof(char));
    +  JSStringGetUTF8CString(js_return_string, c_result_string, bytes_needed);
    +  JSStringRelease(js_return_string);
    +  strncat(return_error_string, c_result_string, return_error_string_max_length-1);
    +  free(c_result_string);
    +
    +  strncat(return_error_string, ":", return_error_string_max_length-1);
    +
    +  /* line number */
    +
    +  jsstring_property_name = JSStringCreateWithUTF8CString("line");
    +  value_ref = JSObjectGetProperty(js_context, exception_object, jsstring_property_name, &temporary_exception);
    +  JSStringRelease(jsstring_property_name);
    +  js_return_string = JSValueToStringCopy(js_context, value_ref, NULL);
    +  bytes_needed = JSStringGetMaximumUTF8CStringSize(js_return_string);
    +  c_result_string = (char*)calloc(bytes_needed, sizeof(char));
    +  JSStringGetUTF8CString(js_return_string, c_result_string, bytes_needed);
    +  JSStringRelease(js_return_string);
    +  strncat(return_error_string, c_result_string, return_error_string_max_length-1);
    +  free(c_result_string);
    +
    +  strncat(return_error_string, "]", return_error_string_max_length-1);
    +
    +  /* error message */
    +
    +  jsstring_property_name = JSStringCreateWithUTF8CString("message");
    +  value_ref = JSObjectGetProperty(js_context, exception_object, jsstring_property_name, &temporary_exception);
    +  JSStringRelease(jsstring_property_name);
    +  if(NULL == value_ref)
    +  {
    +    strncat(return_error_string, "Unknown Error", return_error_string_max_length-1);
    +  }
    +  else
    +  {
    +    js_return_string = JSValueToStringCopy(js_context, value_ref, NULL);
    +    bytes_needed = JSStringGetMaximumUTF8CStringSize(js_return_string);
    +    c_result_string = (char*)calloc(bytes_needed, sizeof(char));
    +    JSStringGetUTF8CString(js_return_string, c_result_string, bytes_needed);
    +    JSStringRelease(js_return_string);
    +    strncat(return_error_string, c_result_string, return_error_string_max_length-1);
    +    free(c_result_string);
    +  }
    +}
    +
    + +

    It would be used in the following way:

    +
    +
    +if(js_exception)
    +{
    +  char return_error_string[256];
    +  script_exception_to_string(js_context, js_exception, return_error_string, 256);
    +  printf("Compile error is %s", return_error_string);
    +}
    +
    + From 5d307b2cbfc9e2caa06805df425161617868bea8 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Tue, 27 May 2014 10:41:39 +0200 Subject: [PATCH 091/152] JavascriptCore: updated documentation about how to register an initialized module. --- Doc/Manual/Javascript.html | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index 246669a22..97197b670 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -223,13 +223,21 @@ $ sudo apt-get remove gyp
     #import "appDelegate.h"
     
    -extern bool example_initialize(JSGlobalContextRef context);
    +extern bool example_initialize(JSGlobalContextRef context, JSObjectRef* exports);
     
     
     @implementation ExampleAppDelegate
     
     @synthesize webView;
     
    +- (void)addGlobalObject:(JSContextRef) context:(NSString *)objectName:(JSObjectRef) theObject {
    +  JSObjectRef global = JSContextGetGlobalObject(context);
    +  JSStringRef objectJSName = JSStringCreateWithCFString( (CFStringRef) objectName )
    +  if ( objectJSName != NULL ) {
    +    JSObjectSetProperty(context, global, objectJSName, theObject, kJSPropertyAttributeReadOnly, NULL);
    +    JSStringRelease( objectJSName );
    +  }
    +}
     
     - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
     
    @@ -240,7 +248,11 @@ extern bool example_initialize(JSGlobalContextRef context);
       WebFrame *webframe = [webView mainFrame];
       JSGlobalContextRef context = [webframe globalContext];
     
    -  example_initialize(context);
    +  JSObjectRef example;
    +  example_initialize(context, &example);
    +  [self addGlobalObject:context:@"example":example]
    +
    +  JSObjectSetProperty(context, global, JSStringRef propertyName, example, JSPropertyAttributes attributes, NULL);
     
       [ [webView mainFrame] loadRequest:
         [NSURLRequest requestWithURL: [NSURL URLWithString:url] ]
    @@ -273,7 +285,13 @@ int main(int argc, char* argv[])
         WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
         WebFrame *webframe = webkit_web_view_get_main_frame(webView);
         JSGlobalContextRef context = webkit_web_frame_get_global_context(webFrame);
    -    example_initialize(context);
    +    JSObjectRef global = JSContextGetGlobalObject(context);
    +
    +    JSObjectRef exampleModule;
    +    example_initialize(context, &exampleModule);
    +    JSStringRef jsName = JSStringCreateWithUTF8CString("example");
    +    JSObjectSetProperty(context, global, jsName, exampleModule, kJSPropertyAttributeReadOnly, NULL);
    +    JSStringRelease(jsName);
     
         ...
     
    
    From a22f97eb3337bdd0b58d6ec764aeb23395c31d70 Mon Sep 17 00:00:00 2001
    From: Oliver Buchtala 
    Date: Tue, 27 May 2014 10:44:13 +0200
    Subject: [PATCH 092/152] Javascript: updated documentation about known issues.
    
    [skip ci]
    ---
     Doc/Manual/Javascript.html | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html
    index 97197b670..a4cc02d02 100644
    --- a/Doc/Manual/Javascript.html
    +++ b/Doc/Manual/Javascript.html
    @@ -15,7 +15,7 @@
     
     
  • Integration
      @@ -137,9 +137,9 @@ $ make check-javascript-test-suite ENGINE=jsc
    • Default optional arguments do not work for all targeted interpreters

    • Mutliple output arguments do not work for JSC

    • -
    • Memory leaks have been observed for all generators

    • C89 incompatibily: the JSC generator might still generate C89 violating code

    • -
    • long long is not supported q

    • +
    • long long is not supported

    • +
    • %native is not supported

    • Javascript callbacks are not supported

    • instanceOf does not work under JSC

    From c342bc1b281d9da9a73d88bfe3fca617cc5dab2d Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Tue, 27 May 2014 21:37:18 +0200 Subject: [PATCH 093/152] Javascript: added a link to the v8 web-site to the documentation. --- Doc/Manual/Javascript.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index a4cc02d02..bfe91aa09 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -57,7 +57,7 @@

    Javascript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. Its arguably the most popular language for web development. Javascript has gone beyond being a browser-based scripting language and with node.js, it is also used as a backend development language.

    Native Javascript extensions can be used for applications that embed a web-browser view or that embed a Javascript engine (such as node.js). Extending a general purpose web-browser is not possible as this would be a severe security issue.

    -

    SWIG Javascript currently supports JavascriptCore, the Javascript engine used by Safari/Webkit, and v8, which is used by Chromium and node.js.

    +

    SWIG Javascript currently supports JavascriptCore, the Javascript engine used by Safari/Webkit, and v8, which is used by Chromium and node.js.

    WebKit is a modern browser implementation available as open-source which can be embedded into an application. With node-webkit there is a platform which uses Google's Chromium as Web-Browser widget and node.js for javascript extensions.

    From b531956467f7e0e064cd9928c044be64fa0a3a0a Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 27 May 2014 21:55:17 +0100 Subject: [PATCH 094/152] Warning fixes compiling with Visual Studio --- Source/Modules/javascript.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx index e535bc179..8b7a74037 100644 --- a/Source/Modules/javascript.cxx +++ b/Source/Modules/javascript.cxx @@ -724,19 +724,19 @@ int JSEmitter::emitWrapperFunction(Node *n) { // detected via the 'view' attribute. || (Equal(kind, "variable") && Equal(Getattr(n, "view"), "globalfunctionHandler")) ) { - bool is_member = GetFlag(n, "ismember") | GetFlag(n, "feature:extend"); - bool is_static = GetFlag(state.function(), IS_STATIC); + bool is_member = GetFlag(n, "ismember") != 0 || GetFlag(n, "feature:extend") != 0; + bool is_static = GetFlag(state.function(), IS_STATIC) != 0; ret = emitFunction(n, is_member, is_static); } else if (Cmp(kind, "variable") == 0) { - bool is_static = GetFlag(state.variable(), IS_STATIC); + bool is_static = GetFlag(state.variable(), IS_STATIC) != 0; // HACK: smartpointeraccessed static variables are not treated as statics if (GetFlag(n, "allocate:smartpointeraccess")) { is_static = false; } - bool is_member = GetFlag(n, "ismember"); - bool is_setter = GetFlag(n, "memberset") || GetFlag(n, "varset"); - bool is_getter = GetFlag(n, "memberget") || GetFlag(n, "varget"); + bool is_member = GetFlag(n, "ismember") != 0; + bool is_setter = GetFlag(n, "memberset") != 0 || GetFlag(n, "varset") != 0; + bool is_getter = GetFlag(n, "memberget") != 0 || GetFlag(n, "varget") != 0; if (is_setter) { ret = emitSetter(n, is_member, is_static); } else if (is_getter) { @@ -840,7 +840,7 @@ int JSEmitter::emitCtor(Node *n) { Wrapper *wrapper = NewWrapper(); - bool is_overloaded = GetFlag(n, "sym:overloaded"); + bool is_overloaded = GetFlag(n, "sym:overloaded") != 0; Template t_ctor(getTemplate("js_ctor")); @@ -1160,7 +1160,7 @@ int JSEmitter::emitFunction(Node *n, bool is_member, bool is_static) { Wrapper *wrapper = NewWrapper(); Template t_function(getTemplate("js_function")); - bool is_overloaded = GetFlag(n, "sym:overloaded"); + bool is_overloaded = GetFlag(n, "sym:overloaded") != 0; // prepare the function wrapper name String *iname = Getattr(n, "sym:name"); @@ -1288,7 +1288,7 @@ void JSEmitter::marshalOutput(Node *n, ParmList *params, Wrapper *wrapper, Strin cresult = defaultResultName; tm = Swig_typemap_lookup_out("out", n, cresult, wrapper, actioncode); - bool should_own = GetFlag(n, "feature:new"); + bool should_own = GetFlag(n, "feature:new") != 0; if (tm) { Replaceall(tm, "$objecttype", Swig_scopename_last(SwigType_str(SwigType_strip_qualifiers(type), 0))); @@ -1628,8 +1628,8 @@ int JSCEmitter::enterFunction(Node *n) { int JSCEmitter::exitFunction(Node *n) { Template t_function = getTemplate("jsc_function_declaration"); - bool is_member = GetFlag(n, "ismember") | GetFlag(n, "feature:extend"); - bool is_overloaded = GetFlag(n, "sym:overloaded"); + bool is_member = GetFlag(n, "ismember") != 0 || GetFlag(n, "feature:extend") != 0; + bool is_overloaded = GetFlag(n, "sym:overloaded") != 0; // handle overloaded functions if (is_overloaded) { @@ -2077,10 +2077,10 @@ int V8Emitter::exitVariable(Node *n) { } int V8Emitter::exitFunction(Node *n) { - bool is_member = GetFlag(n, "ismember") | GetFlag(n, "feature:extend"); + bool is_member = GetFlag(n, "ismember") != 0 || GetFlag(n, "feature:extend") != 0; // create a dispatcher for overloaded functions - bool is_overloaded = GetFlag(n, "sym:overloaded"); + bool is_overloaded = GetFlag(n, "sym:overloaded") != 0; if (is_overloaded) { if (!Getattr(n, "sym:nextSibling")) { //state.function(WRAPPER_NAME, Swig_name_wrapper(Getattr(n, "name"))); From f03bff152c44203ece2084aac03f14ac55a33b5c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 27 May 2014 07:22:46 +0100 Subject: [PATCH 095/152] Python 3 byte string output: use errors="surrogateescape" change note --- CHANGES.current | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES.current b/CHANGES.current index e73a91c3f..399a05415 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,15 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.1 (in progress) =========================== +2014-05-25: hfalcic + [Python] Python 3 byte string output: use errors="surrogateescape" + if available on the version of Python that's in use. This allows + obtaining the original byte string (and potentially trying a fallback + encoding) if the bytes can't be decoded as UTF-8. + + Previously, a UnicodeDecodeError would be raised with no way to treat + the data as bytes or try another codec. + 2014-05-18: vkalinin Bug #175 - Restore %extend to work for unnamed nested structures by using a C symbol comprising the outer structure name and unnamed variable instance name. From eeb113360633fdd69c4d81a3a508853f3cafe9e3 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 27 May 2014 07:27:33 +0100 Subject: [PATCH 096/152] Javascript html links and typo fixes --- Doc/Manual/Contents.html | 4 +++- Doc/Manual/Javascript.html | 9 +++++---- Doc/Manual/Python.html | 2 +- Doc/Manual/Sections.html | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html index 37a5aacff..4dd454352 100644 --- a/Doc/Manual/Contents.html +++ b/Doc/Manual/Contents.html @@ -1056,7 +1056,7 @@
  • Integration
  • @@ -1566,6 +1567,7 @@
  • Function annotation
  • Buffer interface
  • Abstract base classes +
  • Byte string output conversion
  • diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index bfe91aa09..fc2c45126 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -6,7 +6,7 @@ -

    26 SWIG and Javascript

    +

    26 SWIG and Javascript

      @@ -130,13 +130,14 @@ $ make check-javascript-examples ENGINE=jsc
    $ make check-javascript-test-suite ENGINE=jsc
    -

    26.2.1 Known Issues

    +

    26.2.3 Known Issues

    +

    At the moment, the Javascript generators pass all tests syntactically, i.e., the generated source code compiles. However, there are still remaining runtime issues.

    • Default optional arguments do not work for all targeted interpreters

    • -
    • Mutliple output arguments do not work for JSC

    • +
    • Multiple output arguments do not work for JSC

    • C89 incompatibily: the JSC generator might still generate C89 violating code

    • long long is not supported

    • %native is not supported

    • @@ -891,7 +892,7 @@ state.clazz(NAME, Getattr(n, "sym:name"));

      State information can be retrieved using state.clazz(NAME) or with Getattr on state.clazz() which actually returns a Hash instance.

      -

      26.5.5. Handling Exceptions in JavascriptCore

      +

      26.5.5 Handling Exceptions in JavascriptCore

      Applications with an embedded JavascriptCore should be able to present detailed exception messages that occur in the Javascript engine. Below is an example derived from code provided by Brian Barnes on how these exception details can be extracted.

      diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index 6dc0ff9ba..8b4f42a43 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -5929,7 +5929,7 @@ For details of abstract base class, please see PEP 3119.

      -

      35.12.4 Byte string output conversion

      +

      36.12.4 Byte string output conversion

      diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html index 99d1dfe0d..b616371df 100644 --- a/Doc/Manual/Sections.html +++ b/Doc/Manual/Sections.html @@ -42,7 +42,7 @@ Last update : SWIG-3.0.1 (in progress)

    • Go support
    • Guile support
    • Java support
    • -
    • Javascript support
    • +
    • Javascript support
    • Common Lisp support
    • Lua support
    • Modula3 support
    • From 85413bc84dd1207baf7f1aca08ce0a3771115430 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 27 May 2014 18:37:05 +0100 Subject: [PATCH 097/152] Add 3.0.1 release date --- ANNOUNCE | 2 +- CHANGES.current | 2 +- Doc/Manual/Sections.html | 2 +- README | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 6229edc4a..7c521e77b 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -*** ANNOUNCE: SWIG 3.0.1 (in progress) *** +*** ANNOUNCE: SWIG 3.0.1 (27 May 2014) *** http://www.swig.org diff --git a/CHANGES.current b/CHANGES.current index 399a05415..4b95adfa8 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -2,7 +2,7 @@ Below are the changes for the current release. See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. -Version 3.0.1 (in progress) +Version 3.0.1 (27 May 2014) =========================== 2014-05-25: hfalcic diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html index b616371df..0a61f074e 100644 --- a/Doc/Manual/Sections.html +++ b/Doc/Manual/Sections.html @@ -6,7 +6,7 @@

      SWIG-3.0 Documentation

      -Last update : SWIG-3.0.1 (in progress) +Last update : SWIG-3.0.1 (27 May 2014)

      Sections

      diff --git a/README b/README index 46497c148..e30441be7 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ SWIG (Simplified Wrapper and Interface Generator) -Version: 3.0.1 (in progress) +Version: 3.0.1 (27 May 2014) Tagline: SWIG is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua, From 18c9eca1827e009c66e5651145aff17745b76140 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 27 May 2014 19:58:36 +0100 Subject: [PATCH 098/152] Add Javascript to announcements --- ANNOUNCE | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 7c521e77b..2ec56266b 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -10,11 +10,11 @@ What is SWIG? SWIG is a software development tool that reads C/C++ header files and generates the wrapper code needed to make C and C++ code accessible from other programming languages including Perl, Python, Tcl, Ruby, -PHP, C#, Go, Java, Lua, Scheme (Guile, MzScheme, CHICKEN), D, Ocaml, -Pike, Modula-3, Octave, R, Common Lisp (CLISP, Allegro CL, CFFI, UFFI). -SWIG can also export its parse tree in the form of XML and Lisp -s-expressions. Major applications of SWIG include generation of -scripting language extension modules, rapid prototyping, testing, +PHP, C#, Go, Java, Javascript, Lua, Scheme (Guile, MzScheme, CHICKEN), +D, Ocaml, Pike, Modula-3, Octave, R, Common Lisp (CLISP, Allegro CL, +CFFI, UFFI). SWIG can also export its parse tree in the form of XML +and Lisp s-expressions. Major applications of SWIG include generation +of scripting language extension modules, rapid prototyping, testing, and user interface development for large C/C++ systems. Availability From 686d98672d97962e6ebeaf0e445ba069a8b999cd Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Wed, 28 May 2014 04:27:23 +0200 Subject: [PATCH 099/152] Javascript: fixed a missing link in documentation. --- Doc/Manual/Javascript.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index bfe91aa09..ef29ac63e 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -332,7 +332,7 @@ A simple example would have the following structure:

      The configuration file essentially conforms to node.js syntax. -It has some extras to configure node-webkit. See the Manifest specification for more details. +It has some extras to configure node-webkit. See the Manifest specification for more details.

      From 703862dc3a1ed01ad705e8884ef8963f8030cacb Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 28 May 2014 23:04:06 +1200 Subject: [PATCH 100/152] Fix unused variable warning in Lua bindings --- Lib/lua/luarun.swg | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index 6f2068e7a..0728a0528 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -1514,7 +1514,6 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *cls */ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) { - int new_metatable_index; const int SWIGUNUSED begin = lua_gettop(L); int i; /* if name already there (class is already registered) then do nothing */ @@ -1541,14 +1540,16 @@ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *c * It would get us all special methods: __getitem, __add etc. * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away */ - new_metatable_index = lua_absindex(L,-1); - for(i=0;clss->bases[i];i++) { - int base_metatable; - SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); - base_metatable = lua_absindex(L,-1); - SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); - lua_pop(L,1); + int new_metatable_index = lua_absindex(L,-1); + for(i=0;clss->bases[i];i++) + { + int base_metatable; + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + base_metatable = lua_absindex(L,-1); + SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); + lua_pop(L,1); + } } /* And now we will overwrite all incorrectly set data */ #endif From 68347cb723afde8b7bbbbb4d0d8be0f5abae359d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 28 May 2014 18:51:46 +0100 Subject: [PATCH 101/152] Bump version to 3.0.2 --- ANNOUNCE | 8 ++-- CHANGES | 84 ++++++++++++++++++++++++++++++++++++++++ CHANGES.current | 82 +-------------------------------------- Doc/Manual/Sections.html | 2 +- README | 2 +- configure.ac | 2 +- 6 files changed, 92 insertions(+), 88 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 2ec56266b..fc1160007 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,8 +1,8 @@ -*** ANNOUNCE: SWIG 3.0.1 (27 May 2014) *** +*** ANNOUNCE: SWIG 3.0.2 (in progress) *** http://www.swig.org -We're pleased to announce SWIG-3.0.1, the latest SWIG release. +We're pleased to announce SWIG-3.0.2, the latest SWIG release. What is SWIG? ============= @@ -21,11 +21,11 @@ Availability ============ The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-3.0.1.tar.gz + http://prdownloads.sourceforge.net/swig/swig-3.0.2.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-3.0.1.zip + http://prdownloads.sourceforge.net/swig/swigwin-3.0.2.zip Please report problems with this release to the swig-devel mailing list, details at http://www.swig.org/mail.html. diff --git a/CHANGES b/CHANGES index 821d76b2c..1cfedc31e 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,90 @@ SWIG (Simplified Wrapper and Interface Generator) See the CHANGES.current file for changes in the current version. See the RELEASENOTES file for a summary of changes in each release. +Version 3.0.1 (27 May 2014) +=========================== + +2014-05-25: hfalcic + [Python] Python 3 byte string output: use errors="surrogateescape" + if available on the version of Python that's in use. This allows + obtaining the original byte string (and potentially trying a fallback + encoding) if the bytes can't be decoded as UTF-8. + + Previously, a UnicodeDecodeError would be raised with no way to treat + the data as bytes or try another codec. + +2014-05-18: vkalinin + Bug #175 - Restore %extend to work for unnamed nested structures by using a C + symbol comprising the outer structure name and unnamed variable instance name. + +2014-05-15: kwwette + Add #166 - 'make check' now works out of source. This required te examples to build + out of source. The main languages have been tested - C#, Go, Guile, Java, Javascript, + Lua, Octave, Perl, PHP, Python, Ruby and Tcl. + +2014-05-01: Oliver Buchtala + Javascript support added, see Javascript chapter in the documentation. + +2014-05-01: olly + [PHP] The generated __isset() method now returns true for read-only properties. + +2014-04-24: kwwette + [Go] Fix go ./configure parsing of gccgo --version, and + goruntime.swg typo in __GNUC_PATCHLEVEL__ (SF Bug #1298) + +2014-04-24: kwwette + Fix {python|perl5|ruby|tcl}/java examples + + In Lib/gcj/cni.i, for compatibility with newer gcj versions: + + - remove JvAllocObject() which gcj no longer defines, from gcj Changelog: + 2004-04-16 Bryce McKinlay + * gcj/cni.h (JvAllocObject): Remove these obsolete, + undocumented CNI calls. + + - change JvCreateJavaVM() argument from void* to JvVMInitArgs*, from gcj Changelog: + 2005-02-23 Thomas Fitzsimmons + PR libgcj/16923 + ... + (JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*. + + *** POTENTIAL INCOMPATIBILITY *** + +2014-04-08: wsfulton + SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i + +2014-04-08: wsfulton + [Java C#] Enums which have been ignored via %ignore and are subsequently + used are handled slightly differently. Type wrapper classes are now generated + which are effectively a wrapper of an empty enum. Previously in Java uncompilable + code was generated and in C# an int was used. + +2014-04-04: wsfulton + Fix regression in 3.0.0 where legal code following an operator<< definition might + give a syntax error. SF Bug #1365. + +2014-04-03: olly + [PHP] Fix wrapping director constructors with default parameters + with a ZTS-enabled build of PHP. + +2014-04-02: olly + [PHP] Pass the ZTS context we already have to avoid needing to + call TSRMLS_FETCH, which is relatively expensive. + +2014-04-02: olly + [PHP] Pass ZTS context through to t_output_helper() so it works + with a ZTS-enabled build of PHP. Reported by Pierre Labastie in + github PR#155. + +2014-03-28: wsfulton + [Java C# D Go] Fixes for C enums used in an API and the definition of the enum + has not been parsed. For D, this fixes a segfault in SWIG. The other languages + now produce code that compiles, although the definition of the enum is needed + in order to use the enum properly from the target language. + +2014-03-23: v-for-vandal + [Lua] Fix for usage of snprintf in Lua runtime which Visual Studio does not have. + Version 3.0.0 (16 Mar 2014) =========================== diff --git a/CHANGES.current b/CHANGES.current index 4b95adfa8..8d715e730 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -2,86 +2,6 @@ Below are the changes for the current release. See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. -Version 3.0.1 (27 May 2014) +Version 3.0.2 (in progress) =========================== -2014-05-25: hfalcic - [Python] Python 3 byte string output: use errors="surrogateescape" - if available on the version of Python that's in use. This allows - obtaining the original byte string (and potentially trying a fallback - encoding) if the bytes can't be decoded as UTF-8. - - Previously, a UnicodeDecodeError would be raised with no way to treat - the data as bytes or try another codec. - -2014-05-18: vkalinin - Bug #175 - Restore %extend to work for unnamed nested structures by using a C - symbol comprising the outer structure name and unnamed variable instance name. - -2014-05-15: kwwette - Add #166 - 'make check' now works out of source. This required te examples to build - out of source. The main languages have been tested - C#, Go, Guile, Java, Javascript, - Lua, Octave, Perl, PHP, Python, Ruby and Tcl. - -2014-05-01: Oliver Buchtala - Javascript support added, see Javascript chapter in the documentation. - -2014-05-01: olly - [PHP] The generated __isset() method now returns true for read-only properties. - -2014-04-24: kwwette - [Go] Fix go ./configure parsing of gccgo --version, and - goruntime.swg typo in __GNUC_PATCHLEVEL__ (SF Bug #1298) - -2014-04-24: kwwette - Fix {python|perl5|ruby|tcl}/java examples - - In Lib/gcj/cni.i, for compatibility with newer gcj versions: - - - remove JvAllocObject() which gcj no longer defines, from gcj Changelog: - 2004-04-16 Bryce McKinlay - * gcj/cni.h (JvAllocObject): Remove these obsolete, - undocumented CNI calls. - - - change JvCreateJavaVM() argument from void* to JvVMInitArgs*, from gcj Changelog: - 2005-02-23 Thomas Fitzsimmons - PR libgcj/16923 - ... - (JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*. - - *** POTENTIAL INCOMPATIBILITY *** - -2014-04-08: wsfulton - SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i - -2014-04-08: wsfulton - [Java C#] Enums which have been ignored via %ignore and are subsequently - used are handled slightly differently. Type wrapper classes are now generated - which are effectively a wrapper of an empty enum. Previously in Java uncompilable - code was generated and in C# an int was used. - -2014-04-04: wsfulton - Fix regression in 3.0.0 where legal code following an operator<< definition might - give a syntax error. SF Bug #1365. - -2014-04-03: olly - [PHP] Fix wrapping director constructors with default parameters - with a ZTS-enabled build of PHP. - -2014-04-02: olly - [PHP] Pass the ZTS context we already have to avoid needing to - call TSRMLS_FETCH, which is relatively expensive. - -2014-04-02: olly - [PHP] Pass ZTS context through to t_output_helper() so it works - with a ZTS-enabled build of PHP. Reported by Pierre Labastie in - github PR#155. - -2014-03-28: wsfulton - [Java C# D Go] Fixes for C enums used in an API and the definition of the enum - has not been parsed. For D, this fixes a segfault in SWIG. The other languages - now produce code that compiles, although the definition of the enum is needed - in order to use the enum properly from the target language. - -2014-03-23: v-for-vandal - [Lua] Fix for usage of snprintf in Lua runtime which Visual Studio does not have. diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html index 0a61f074e..33d76c239 100644 --- a/Doc/Manual/Sections.html +++ b/Doc/Manual/Sections.html @@ -6,7 +6,7 @@

      SWIG-3.0 Documentation

      -Last update : SWIG-3.0.1 (27 May 2014) +Last update : SWIG-3.0.2 (in progress)

      Sections

      diff --git a/README b/README index e30441be7..e4010bd80 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ SWIG (Simplified Wrapper and Interface Generator) -Version: 3.0.1 (27 May 2014) +Version: 3.0.2 (27 May 2014) Tagline: SWIG is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua, diff --git a/configure.ac b/configure.ac index 2ff5dc8db..8af45b69f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl The macros which aren't shipped with the autotools are stored in the dnl Tools/config directory in .m4 files. -AC_INIT([swig],[3.0.1],[http://www.swig.org]) +AC_INIT([swig],[3.0.2],[http://www.swig.org]) dnl NB: When this requirement is increased to 2.60 or later, AC_PROG_SED dnl definition below can be removed From 2b4c49d017f526f6622cd54547ab9fab31941176 Mon Sep 17 00:00:00 2001 From: Artem Serebriyskiy Date: Fri, 16 May 2014 13:00:14 +0400 Subject: [PATCH 102/152] Add default __eq implementation * Renamed SWIG_Lua_equal to SWIG_Lua_class_equal * If class has no __eq implemented, then default __eq is provided. Default __eq compares actual pointers stored inside Lua userdata --- Examples/test-suite/lua/cpp_basic_runme.lua | 11 +++++ Lib/lua/luarun.swg | 46 +++++++++++++-------- Lib/lua/luaruntime.swg | 2 +- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/Examples/test-suite/lua/cpp_basic_runme.lua b/Examples/test-suite/lua/cpp_basic_runme.lua index c7e0325c5..5a0e1c699 100644 --- a/Examples/test-suite/lua/cpp_basic_runme.lua +++ b/Examples/test-suite/lua/cpp_basic_runme.lua @@ -86,3 +86,14 @@ f4_name = tostring(f4) assert( f2_name == "Foo" ) assert( f3_name == "Foo" ) assert( f4_name == "FooSubSub" ) + +-- Test __eq implementation supplied by default + +-- eq_f1 and eq_f2 must be different userdata with same Foo* pointer. If eq_f1 and eq_f2 are the same userdata (e.g.) +-- > eq_f1 = smth +-- > eq_f2 = eq_f1 +-- then default Lua equality comparison kicks in and considers them equal. Access to global_fptr is actually a +-- function call (internally) and it returns new userdata each time. +eq_f1 = cb.Bar.global_fptr +eq_f2 = cb.Bar.global_fptr +assert( eq_f1 == eq_f2 ) diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index 0728a0528..756c38d01 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -1037,6 +1037,23 @@ SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) return 0; } +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) +{ + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + /* populate table at the top of the stack with metamethods that ought to be inherited */ SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) { @@ -1471,6 +1488,18 @@ SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class lua_pop(L,1); /* remove copy of the key */ } + /* Special handling for __eq method */ + lua_pushstring(L, "__eq"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + const int eq_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( eq_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_equal); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] * a __getitem/__setitem method should be defined */ @@ -1788,23 +1817,6 @@ SWIGRUNTIME int SWIG_Lua_type(lua_State *L) return 1; } -/* lua callable function to compare userdata's value -the issue is that two userdata may point to the same thing -but to lua, they are different objects */ -SWIGRUNTIME int SWIG_Lua_equal(lua_State *L) -{ - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ - result=(usr1->ptr==usr2->ptr); - lua_pushboolean(L,result); - return 1; -} - /* ----------------------------------------------------------------------------- * global variable support code: class/struct typemap functions * ----------------------------------------------------------------------------- */ diff --git a/Lib/lua/luaruntime.swg b/Lib/lua/luaruntime.swg index 89908044b..8df46e8cb 100644 --- a/Lib/lua/luaruntime.swg +++ b/Lib/lua/luaruntime.swg @@ -40,7 +40,7 @@ SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) /* add a global fn */ SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); #endif #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) From 4457d96e54b7dea20b4c7b43e5182fa564d5c0c9 Mon Sep 17 00:00:00 2001 From: Artem Serebriyskiy Date: Fri, 23 May 2014 15:13:41 +0400 Subject: [PATCH 103/152] Moving variable declaration to the beginning of the block --- Lib/lua/luarun.swg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg index 756c38d01..8803c66f6 100644 --- a/Lib/lua/luarun.swg +++ b/Lib/lua/luarun.swg @@ -1456,6 +1456,7 @@ SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class int metatable_index; int metamethods_info_index; int tostring_undefined; + int eq_undefined = 0; SWIG_Lua_get_class_metatable(L, clss->fqname); metatable_index = lua_gettop(L); @@ -1492,7 +1493,7 @@ SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class lua_pushstring(L, "__eq"); lua_pushvalue(L,-1); lua_rawget(L,metatable_index); - const int eq_undefined = lua_isnil(L,-1); + eq_undefined = lua_isnil(L,-1); lua_pop(L,1); if( eq_undefined ) { lua_pushcfunction(L, SWIG_Lua_class_equal); From 46d7645c9ae1ecafd5447cb1f287c5f8d1dc5b4f Mon Sep 17 00:00:00 2001 From: Artem Serebriyskiy Date: Mon, 26 May 2014 23:27:29 +0400 Subject: [PATCH 104/152] More tests for equality operator overloading --- Examples/test-suite/common.mk | 1 + Examples/test-suite/equality.i | 67 ++++++++++++++++++++++ Examples/test-suite/lua/equality_runme.lua | 47 +++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 Examples/test-suite/equality.i create mode 100644 Examples/test-suite/lua/equality_runme.lua diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index bc1ca5cb8..485453b5a 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -210,6 +210,7 @@ CPP_TEST_CASES += \ enum_template \ enum_thorough \ enum_var \ + equality \ evil_diamond \ evil_diamond_ns \ evil_diamond_prop \ diff --git a/Examples/test-suite/equality.i b/Examples/test-suite/equality.i new file mode 100644 index 000000000..a1b70c299 --- /dev/null +++ b/Examples/test-suite/equality.i @@ -0,0 +1,67 @@ +/* File : equality.i */ +/* + Specific test for operator== overload. Partially overlaps with + operator_overload.i +*/ + +%module equality + +%inline %{ + +/* Point has no equality operator */ +typedef struct Point +{ + double x; + double y; +} Point; + +static const Point s_zeroPoint = { 0.0, 0.0 }; +/* stack version */ +Point MakePoint(double x, double y) + { Point new_point = {x, y}; return new_point; } + +const Point* GetZeroPointPtr() { return &s_zeroPoint; } +Point GetZeroPointCopy() { return s_zeroPoint; } + +/* EqualOpDefined has correct equality operator */ +class EqualOpDefined { +public: + EqualOpDefined(): + x(5) {} + EqualOpDefined(int val): + x(val) {} + + int x; +}; + +/* EqualOpWrong has logically incorrect equality operator */ +class EqualOpWrong { +public: + inline static const EqualOpWrong* GetStaticObject(); +}; + +static const EqualOpWrong s_wrongEqOp; + +const EqualOpWrong* EqualOpWrong::GetStaticObject() + { return &s_wrongEqOp; } + + +inline bool operator==( const EqualOpDefined& first, const EqualOpDefined& second ) + { return first.x == second.x; } + +inline bool operator==( const EqualOpWrong& first, const EqualOpWrong& second ) + { return false; } + +%} + +/* + in order to wrapper this correctly + we need to extend the class + to make the friends & non members part of the class +*/ +%extend EqualOpDefined { + bool operator==(const EqualOpDefined& b){return (*$self) == b;} +} +%extend EqualOpWrong { + bool operator==(const EqualOpWrong& b){return (*$self) == b;} +} diff --git a/Examples/test-suite/lua/equality_runme.lua b/Examples/test-suite/lua/equality_runme.lua new file mode 100644 index 000000000..cadbede0a --- /dev/null +++ b/Examples/test-suite/lua/equality_runme.lua @@ -0,0 +1,47 @@ +require("import") -- the import fn +import("equality") -- import code +eq=equality -- renaming import + +-- catch "undefined" global variables +local env = _ENV -- Lua 5.2 +if not env then env = getfenv () end -- Lua 5.1 +setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end}) + +-- === No equality operator === + +-- logically same data without equality operator are not equal +p1 = eq.MakePoint(10,9); +p2 = eq.MakePoint(10,9); + +assert( p1 ~= p2 ); + +-- different wrappers for same Point* are equal +p3 = eq.GetZeroPointPtr() +p4 = eq.GetZeroPointPtr() + +assert( p3 == p4 ) + + +-- === Logically correct equality operator === + +ed1 = eq.EqualOpDefined(10) +ed2 = eq.EqualOpDefined(10) +ed3 = eq.EqualOpDefined(15) + +assert( ed1 == ed2 ) +assert( ed1 ~= ed3 ) + + +-- === Logically incorrect equality operator === + +ew1 = eq.EqualOpWrong() +ew2 = eq.EqualOpWrong() + +assert( ew1 ~= ew2 ); + +ew3 = eq.EqualOpWrong.GetStaticObject() +ew4 = eq.EqualOpWrong.GetStaticObject() + +-- Even though these are pointers to same object, operator== overload should +-- state that they are not equal +assert( ew3 ~= ew4 ) From 665c4f581be7aef1e37c40dee3fde00b2d1cdcfd Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Wed, 28 May 2014 22:15:50 +0400 Subject: [PATCH 105/152] %extend symbols for nested structs get into a wrong C symbol table --- Examples/test-suite/nested_extend_c.i | 7 +++++++ Source/Modules/nested.cxx | 14 ++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Examples/test-suite/nested_extend_c.i b/Examples/test-suite/nested_extend_c.i index 0e1495f86..fb3c053c4 100644 --- a/Examples/test-suite/nested_extend_c.i +++ b/Examples/test-suite/nested_extend_c.i @@ -10,6 +10,7 @@ char hi_extend() { return $self->c; } + static const long swig_size = sizeof(hiA); } %extend lowA { lowA() { @@ -21,6 +22,7 @@ int low_extend() { return $self->num; } + static const long swig_size = sizeof(lowA); } %extend hiB { @@ -32,6 +34,7 @@ char hi_extend() { return $self->c; } + static const long swig_size = sizeof(hiB); } %extend lowB { lowB() { @@ -43,6 +46,7 @@ int low_extend() { return $self->num; } + static const long swig_size = sizeof(lowB); } %extend FOO_bar { @@ -50,6 +54,9 @@ $self->d = 1; } }; +%extend NestedA { + static const long swig_size = sizeof(NestedA); +} #endif diff --git a/Source/Modules/nested.cxx b/Source/Modules/nested.cxx index 9ec52ead1..c4ab6a8ea 100644 --- a/Source/Modules/nested.cxx +++ b/Source/Modules/nested.cxx @@ -362,7 +362,15 @@ void Swig_nested_name_unnamed_c_structs(Node *n) { Delete(bases); } Setattr(classhash, name, c); + + // Merge the extension into the symbol table + if (Node *am = Getattr(Swig_extend_hash(), name)) { + Swig_extend_merge(c, am); + Swig_extend_append_previous(c, am); + Delattr(Swig_extend_hash(), name); + } Swig_symbol_popscope(); + // process declarations following this type (assign correct new type) SwigType *ty = Copy(name); Node *decl = nextSibling(c); @@ -376,12 +384,6 @@ void Swig_nested_name_unnamed_c_structs(Node *n) { decl = nextSibling(decl); } Delete(ty); - if (Node *am = Getattr(Swig_extend_hash(), name)) { - // Merge the extension into the symbol table - Swig_extend_merge(c, am); - Swig_extend_append_previous(c, am); - Delattr(Swig_extend_hash(), name); - } Swig_symbol_setscope(Swig_symbol_global_scope()); add_symbols_c(c); From 78719759d5572b6c80c6a7061e71f78bee49a5ea Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 28 May 2014 23:44:55 +0100 Subject: [PATCH 106/152] Test-suite makefile fixes for Windows Remove $(realpath ) which is no good for Windows executables running under Cygwin's make --- Examples/Makefile.in | 6 +++--- .../test-suite/java/preproc_line_file_runme.java | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index caf848596..1f3b07205 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -576,7 +576,7 @@ JAVAC = @JAVAC@ -d . # ---------------------------------------------------------------- java: $(SRCDIR_SRCS) - $(SWIG) -java $(SWIGOPT) -o $(ISRCS) $(realpath $(INTERFACEPATH)) + $(SWIG) -java $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH) $(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES) $(JAVA_INCLUDE) $(JAVALDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) @@ -585,7 +585,7 @@ java: $(SRCDIR_SRCS) # ---------------------------------------------------------------- java_cpp: $(SRCDIR_SRCS) - $(SWIG) -java -c++ $(SWIGOPT) -o $(ICXXSRCS) $(realpath $(INTERFACEPATH)) + $(SWIG) -java -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH) $(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(JAVACFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(JAVA_INCLUDE) $(JAVACXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(JAVA_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(JAVA_LIBPREFIX)$(TARGET)$(JAVASO) @@ -1373,7 +1373,7 @@ csharp_cpp: $(SRCDIR_SRCS) # ---------------------------------------------------------------- ifneq (,$(SRCDIR)) -SRCDIR_CSHARPSRCS = $(wildcard $(addprefix $(SRCDIR),$(CSHARPSRCS))) +SRCDIR_CSHARPSRCS = $(addprefix $(SRCDIR),$(CSHARPSRCS)) else SRCDIR_CSHARPSRCS = endif diff --git a/Examples/test-suite/java/preproc_line_file_runme.java b/Examples/test-suite/java/preproc_line_file_runme.java index 123753fd9..7726b613b 100644 --- a/Examples/test-suite/java/preproc_line_file_runme.java +++ b/Examples/test-suite/java/preproc_line_file_runme.java @@ -13,13 +13,21 @@ public class preproc_line_file_runme { private static void test_file(String file, String suffix) throws Throwable { - String FILENAME_WINDOWS = "Examples\\test-suite\\preproc_line_file.i"; - String FILENAME_UNIX = "Examples/test-suite/preproc_line_file.i"; +// For swig-3.0.1 and earlier +// String FILENAME_WINDOWS = "Examples\\test-suite\\preproc_line_file.i"; +// String FILENAME_UNIX = "Examples/test-suite/preproc_line_file.i"; + + String FILENAME_WINDOWS2 = "Examples\\test-suite\\java\\..\\preproc_line_file.i"; + String FILENAME_UNIX2 = "Examples/test-suite/java/../preproc_line_file.i"; + + String FILENAME_WINDOWS3 = "..\\.\\..\\preproc_line_file.i"; + String FILENAME_UNIX3 = ".././../preproc_line_file.i"; // We don't test for exact equality here because the file names are relative to the build directory, which can be different from the source directory, // under Unix. But they do need to end with the same path components. - if (!file.endsWith(FILENAME_UNIX + suffix) && !file.endsWith(FILENAME_WINDOWS + suffix)) - throw new RuntimeException("file \"" + file + "\" doesn't end with " + FILENAME_UNIX + suffix); + if (!file.endsWith(FILENAME_UNIX2 + suffix) && !file.endsWith(FILENAME_WINDOWS2 + suffix) && + !file.endsWith(FILENAME_UNIX3 + suffix) && !file.endsWith(FILENAME_WINDOWS3 + suffix)) + throw new RuntimeException("file \"" + file + "\" doesn't end with " + FILENAME_UNIX2 + suffix + " or " + FILENAME_UNIX3 + suffix); } public static void main(String argv[]) throws Throwable From cc1ff55be458fba978cfb7f31f6966630f6b380e Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 28 May 2014 20:46:44 +0200 Subject: [PATCH 107/152] CCache: always generate docs in source directory --- .gitignore | 1 + CCache/Makefile.in | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c7961efd7..e6c73c463 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ swig.spec .dirstamp CCache/ccache-swig CCache/ccache-swig.1 +CCache/web/ccache-man.html Lib/swigwarn.swg Source/CParse/parser.c Source/CParse/parser.h diff --git a/CCache/Makefile.in b/CCache/Makefile.in index 6703e2ac0..6cded08d4 100644 --- a/CCache/Makefile.in +++ b/CCache/Makefile.in @@ -32,27 +32,27 @@ Makefile: $(srcdir)/Makefile.in ./config.status $(SHELL) ./config.status # Note that HTML documentation is actually generated and used from the main SWIG documentation Makefile -docs: $(PACKAGE_NAME).1 web/ccache-man.html +docs: $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html $(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -$(PACKAGE_NAME).1: ccache.yo - -yodl2man -o $(PACKAGE_NAME).1 $(srcdir)/ccache.yo +$(srcdir)/$(PACKAGE_NAME).1: $(srcdir)/ccache.yo + -yodl2man -o $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/ccache.yo -web/ccache-man.html: ccache.yo - yodl2html -o web/ccache-man.html ccache.yo +$(srcdir)/web/ccache-man.html: $(srcdir)/ccache.yo + yodl2html -o $(srcdir)/web/ccache-man.html $(srcdir)/ccache.yo -install: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1 +install: $(PACKAGE_NAME)$(EXEEXT) $(srcdir)/$(PACKAGE_NAME).1 @echo "Installing $(PACKAGE_NAME)" @echo "Installing $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)" ${INSTALLCMD} -d $(DESTDIR)${bindir} ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT) @echo "Installing $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1" ${INSTALLCMD} -d $(DESTDIR)${mandir}/man1 - ${INSTALLCMD} -m 644 $(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1 + ${INSTALLCMD} -m 644 $(srcdir)/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1 -uninstall: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1 +uninstall: $(PACKAGE_NAME)$(EXEEXT) $(srcdir)/$(PACKAGE_NAME).1 rm -f $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT) rm -f $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1 @@ -69,7 +69,7 @@ distclean: clean /bin/rm -rf autom4te.cache maintainer-clean: distclean - /bin/rm -f $(PACKAGE_NAME).1 web/ccache-man.html + /bin/rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html # FIXME: To fix this, test.sh needs to be able to take ccache from the From 46ce4d3ba9a1ae50706e828ab17c8bc6c2e50fe0 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 28 May 2014 21:19:06 +0200 Subject: [PATCH 108/152] Distclean Tools/javascript --- Makefile.in | 6 +++++- Tools/javascript/Makefile.in | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index a040d41a1..2b9cf3b32 100644 --- a/Makefile.in +++ b/Makefile.in @@ -403,7 +403,7 @@ clean-ccache: DISTCLEAN-DEAD = config.status config.log config.cache swig.spec Makefile mkmf.log libtool preinst-swig -distclean-helper: distclean-test-suite distclean-examples distclean-dead +distclean-helper: distclean-test-suite distclean-examples distclean-tools distclean-dead distclean: distclean-source distclean-ccache distclean-helper @@ -429,6 +429,10 @@ distclean-examples: distclean-ccache: @test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) $(FLAGS) distclean) +distclean-tools: + @echo distcleaning Tools + @cd Tools/javascript && $(MAKE) $(FLAGS) distclean + distclean-dead: rm -f $(DISTCLEAN-DEAD) rm -rf autom4te.cache diff --git a/Tools/javascript/Makefile.in b/Tools/javascript/Makefile.in index 960c661b2..f65be2826 100644 --- a/Tools/javascript/Makefile.in +++ b/Tools/javascript/Makefile.in @@ -64,3 +64,6 @@ javascript: $(JS_INTERPRETER_OBJS) clean: rm -f *.o rm -f javascript + +distclean: clean + rm -f Makefile From 32212d5cc08d312f15e5f6d102610752b86e3f3c Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 28 May 2014 22:40:36 +0200 Subject: [PATCH 109/152] Fully clean Go test-suite --- Examples/test-suite/go/Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Examples/test-suite/go/Makefile.in b/Examples/test-suite/go/Makefile.in index 204cf8a12..5d8343be1 100644 --- a/Examples/test-suite/go/Makefile.in +++ b/Examples/test-suite/go/Makefile.in @@ -100,11 +100,12 @@ run_multi_testcase = \ @rm -f $*.go $*_gc.c $*_wrap.* $*_runme clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile go_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" go_clean rm -f mod_a.go mod_b.go imports_a.go imports_b.go rm -f clientdata_prop_a.go clientdata_prop_b.go rm -f multi_import_a.go multi_import_b.go rm -f packageoption_a.go packageoption_b.go packageoption_c.go + rm -f import_stl_a.go import_stl_b.go cvsignore: @echo '*_gc.c *_wrap.* *.so *.dll *.exp *.lib' From 74e17fdbf662d04f21b484616174ca7abdf1d30f Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 28 May 2014 23:39:10 +0200 Subject: [PATCH 110/152] Fix Javascript examples so that "make clean" works properly with node - Need to copy example.cxx to build directory so that build products end up in the right place; use a gyp command expansion to do so --- .gitignore | 1 + Examples/Makefile.in | 2 +- Examples/javascript/class/binding.gyp.in | 2 +- Examples/javascript/enum/binding.gyp.in | 2 +- Examples/javascript/exception/binding.gyp.in | 2 +- Examples/javascript/pointer/binding.gyp.in | 2 +- Examples/javascript/reference/binding.gyp.in | 2 +- Examples/javascript/simple/binding.gyp.in | 2 +- Examples/javascript/variables/binding.gyp.in | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e6c73c463..bce0812b7 100644 --- a/.gitignore +++ b/.gitignore @@ -124,6 +124,7 @@ Examples/test-suite/tcl/*/ Examples/test-suite/uffi/*/ *_wrap.c *_wrap.cxx +*-gypcopy.cxx # C# generated files *_runme.exe.mdb diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 1f3b07205..123a634d7 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -730,7 +730,7 @@ javascript_clean: rm -f *_wrap* $(RUNME) rm -f core @EXTRA_CLEAN@ rm -f *.@OBJEXT@ *@JSSO@ *.$(SO) - rm -f binding.gyp + rm -f binding.gyp example-gypcopy.cxx cd $(ROOT_DIR)/Tools/javascript && $(MAKE) -s clean ################################################################## diff --git a/Examples/javascript/class/binding.gyp.in b/Examples/javascript/class/binding.gyp.in index c56a650e9..cb2b45e8f 100644 --- a/Examples/javascript/class/binding.gyp.in +++ b/Examples/javascript/class/binding.gyp.in @@ -2,7 +2,7 @@ "targets": [ { "target_name": "example", - "sources": [ "$srcdir/example.cxx", "example_wrap.cxx" ], + "sources": [ " Date: Wed, 28 May 2014 23:55:08 +0200 Subject: [PATCH 111/152] Fully clean Javascript test-suite with jsc and v8 --- Examples/test-suite/javascript/Makefile.in | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index a54fcd7e7..b6e946de2 100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -107,7 +107,15 @@ endif %.clean: - rm -rf $* - rm -f $*_wrap.* - rm -f $*.so - rm -f $*.o + @rm -rf $* + @rm -f $*_wrap.* $*.so $*.o + +clean: + for ext in _wrap.cxx _wrap.o .so; do \ + rm -f clientdata_prop_a$${ext} clientdata_prop_b$${ext}; \ + rm -f imports_a$${ext} imports_b$${ext}; \ + rm -f import_stl_a$${ext} import_stl_b$${ext}; \ + rm -f mod_a$${ext} mod_b$${ext}; \ + rm -f multi_import_a$${ext} multi_import_b$${ext}; \ + rm -f packageoption_a$${ext} packageoption_b$${ext} packageoption_c$${ext}; \ + done From 7f48b2774b32d40c898d2a78d2fe4085aeb4dce9 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 28 May 2014 23:55:19 +0200 Subject: [PATCH 112/152] Fully clean PHP test-suite --- Examples/test-suite/php/Makefile.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/php/Makefile.in b/Examples/test-suite/php/Makefile.in index 5f56760ea..00ccac325 100644 --- a/Examples/test-suite/php/Makefile.in +++ b/Examples/test-suite/php/Makefile.in @@ -65,7 +65,13 @@ run_testcase = \ # Clean: remove the generated .php file %.clean: - @rm -f $*.php; + @rm -f $*.php php_$*.h clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile php_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" php_clean + rm -f clientdata_prop_a.php clientdata_prop_b.php php_clientdata_prop_a.h php_clientdata_prop_b.h + rm -f import_stl_a.php import_stl_b.php php_import_stl_a.h php_import_stl_b.h + rm -f imports_a.php imports_b.php php_imports_a.h php_imports_b.h + rm -f mod_a.php mod_b.php php_mod_a.h php_mod_b.h + rm -f multi_import_a.php multi_import_b.php php_multi_import_a.h php_multi_import_b.h + rm -f packageoption_a.php packageoption_b.php packageoption_c.php php_packageoption_a.h php_packageoption_b.h php_packageoption_c.h From cc0738bbda7d962b3d72479ac866bca4ab8867e9 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 28 May 2014 23:59:46 +0200 Subject: [PATCH 113/152] Fully clean Python examples and test-suite --- Examples/Makefile.in | 3 ++- Examples/python/import_packages/Makefile | 5 +++++ Examples/test-suite/python/Makefile.in | 7 +++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 123a634d7..b1b460c56 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -401,7 +401,8 @@ python_clean: rm -f core @EXTRA_CLEAN@ rm -f *.@OBJEXT@ *@SO@ *@PYTHON_SO@ rm -f $(TARGET).py - if [ -f $(RUNME).py ]; then rm -f $(RUNME)3.py $(RUNME)3.py.bak; fi + if test -f $(SRCDIR)$(RUNME).py; then rm -f $(RUNME)3.py $(RUNME)3.py.bak; fi + if test "x$(SRCDIR)" != x; then rm -f $(RUNME).py; fi ################################################################## diff --git a/Examples/python/import_packages/Makefile b/Examples/python/import_packages/Makefile index 2df2be101..d5054fd22 100644 --- a/Examples/python/import_packages/Makefile +++ b/Examples/python/import_packages/Makefile @@ -35,6 +35,11 @@ static: clean: $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_clean + if test "x$(SRCDIR)" != x; then \ + for file in `cd $(SRCDIR) && find . -type f -name __init__.py`; do \ + rm -f "$$file" || exit 1; \ + done; \ + fi; \ for s in $(import_packages_subdirs); do \ (cd $$s && $(MAKE) clean); \ done diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 492396d15..87443cb57 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -160,12 +160,11 @@ endif # We only remove the _runme3.py if it is generated by 2to3 from a _runme.py. %.clean: @rm -f $*.py - @if [ -f $(srcdir)/$(py2_runme) ]; then \ - rm -f $(SCRIPTDIR)/$(py3_runme) $(SCRIPTDIR)/$(py3_runme).bak; \ - fi + @if test -f $(srcdir)/$(py2_runme); then rm -f $(SCRIPTDIR)/$(py3_runme) $(SCRIPTDIR)/$(py3_runme).bak; fi + @if test "x$(SRCDIR)" != x; then rm -f $(SCRIPTDIR)/$(py2_runme); fi clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile python_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" python_clean rm -f hugemod.h hugemod_a.i hugemod_b.i hugemod_a.py hugemod_b.py hugemod_runme.py rm -f clientdata_prop_a.py clientdata_prop_b.py import_stl_a.py import_stl_b.py rm -f imports_a.py imports_b.py mod_a.py mod_b.py multi_import_a.py From 3fe1eb705617c621f8f99d2f657cfe72a1049cce Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Thu, 29 May 2014 01:13:42 +0200 Subject: [PATCH 114/152] Set SRCDIR when calling test-suite clean targets, in case it's needed --- Examples/test-suite/allegrocl/Makefile.in | 2 +- Examples/test-suite/cffi/Makefile.in | 2 +- Examples/test-suite/chicken/Makefile.in | 2 +- Examples/test-suite/clisp/Makefile.in | 2 +- Examples/test-suite/errors/Makefile.in | 2 +- Examples/test-suite/guile/Makefile.in | 2 +- Examples/test-suite/lua/Makefile.in | 2 +- Examples/test-suite/mzscheme/Makefile.in | 2 +- Examples/test-suite/ocaml/Makefile.in | 2 +- Examples/test-suite/octave/Makefile.in | 2 +- Examples/test-suite/perl5/Makefile.in | 2 +- Examples/test-suite/pike/Makefile.in | 2 +- Examples/test-suite/r/Makefile.in | 2 +- Examples/test-suite/ruby/Makefile.in | 2 +- Examples/test-suite/tcl/Makefile.in | 2 +- Examples/test-suite/uffi/Makefile.in | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Examples/test-suite/allegrocl/Makefile.in b/Examples/test-suite/allegrocl/Makefile.in index 8c253a7f2..02ef8e302 100644 --- a/Examples/test-suite/allegrocl/Makefile.in +++ b/Examples/test-suite/allegrocl/Makefile.in @@ -123,4 +123,4 @@ run_testcase = \ @rm -f $*.cl clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile allegrocl_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" allegrocl_clean diff --git a/Examples/test-suite/cffi/Makefile.in b/Examples/test-suite/cffi/Makefile.in index 6e657ba46..ee7e3f61e 100644 --- a/Examples/test-suite/cffi/Makefile.in +++ b/Examples/test-suite/cffi/Makefile.in @@ -48,4 +48,4 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile cffi_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" cffi_clean diff --git a/Examples/test-suite/chicken/Makefile.in b/Examples/test-suite/chicken/Makefile.in index 5a2ef3d8a..31ab311bb 100644 --- a/Examples/test-suite/chicken/Makefile.in +++ b/Examples/test-suite/chicken/Makefile.in @@ -97,5 +97,5 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile chicken_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" chicken_clean rm -f *.scm diff --git a/Examples/test-suite/clisp/Makefile.in b/Examples/test-suite/clisp/Makefile.in index 43f7159ff..6837ed60b 100644 --- a/Examples/test-suite/clisp/Makefile.in +++ b/Examples/test-suite/clisp/Makefile.in @@ -48,4 +48,4 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile clisp_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" clisp_clean diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in index da67db8bd..3b165f9cd 100644 --- a/Examples/test-suite/errors/Makefile.in +++ b/Examples/test-suite/errors/Makefile.in @@ -53,5 +53,5 @@ include $(srcdir)/../common.mk @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile python_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" python_clean @rm -f *.$(ERROR_EXT) *.py diff --git a/Examples/test-suite/guile/Makefile.in b/Examples/test-suite/guile/Makefile.in index 6cbf3b9b1..9050d76f5 100644 --- a/Examples/test-suite/guile/Makefile.in +++ b/Examples/test-suite/guile/Makefile.in @@ -62,4 +62,4 @@ run_testcase = \ @rm -f $*-guile clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile guile_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" guile_clean diff --git a/Examples/test-suite/lua/Makefile.in b/Examples/test-suite/lua/Makefile.in index 00f940825..c562f09df 100644 --- a/Examples/test-suite/lua/Makefile.in +++ b/Examples/test-suite/lua/Makefile.in @@ -56,7 +56,7 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile lua_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" lua_clean cvsignore: @echo '*wrap* *.so *.dll *.exp *.lib' diff --git a/Examples/test-suite/mzscheme/Makefile.in b/Examples/test-suite/mzscheme/Makefile.in index 034e52131..da92f76fd 100644 --- a/Examples/test-suite/mzscheme/Makefile.in +++ b/Examples/test-suite/mzscheme/Makefile.in @@ -46,4 +46,4 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile mzscheme_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" mzscheme_clean diff --git a/Examples/test-suite/ocaml/Makefile.in b/Examples/test-suite/ocaml/Makefile.in index ee93d534c..9a4e008b9 100644 --- a/Examples/test-suite/ocaml/Makefile.in +++ b/Examples/test-suite/ocaml/Makefile.in @@ -81,4 +81,4 @@ include $(srcdir)/../common.mk @rm -f $*.ml $*.mli; clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile ocaml_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" ocaml_clean diff --git a/Examples/test-suite/octave/Makefile.in b/Examples/test-suite/octave/Makefile.in index 4f78371f4..fbffd240c 100644 --- a/Examples/test-suite/octave/Makefile.in +++ b/Examples/test-suite/octave/Makefile.in @@ -68,7 +68,7 @@ run_testcase = \ @rm -f $*.m; clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile octave_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" octave_clean cvsignore: @echo '*wrap* *.mc *.so *.dll *.exp *.lib' diff --git a/Examples/test-suite/perl5/Makefile.in b/Examples/test-suite/perl5/Makefile.in index 9d9d460d8..a4628ddcb 100644 --- a/Examples/test-suite/perl5/Makefile.in +++ b/Examples/test-suite/perl5/Makefile.in @@ -59,4 +59,4 @@ run_testcase = \ @rm -f $*.pm; clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile perl5_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" perl5_clean diff --git a/Examples/test-suite/pike/Makefile.in b/Examples/test-suite/pike/Makefile.in index 579c7e28f..92054dd9d 100644 --- a/Examples/test-suite/pike/Makefile.in +++ b/Examples/test-suite/pike/Makefile.in @@ -46,4 +46,4 @@ run_testcase = \ @rm -f $*.pike; clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile pike_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" pike_clean diff --git a/Examples/test-suite/r/Makefile.in b/Examples/test-suite/r/Makefile.in index 8ee73b279..d0489531f 100644 --- a/Examples/test-suite/r/Makefile.in +++ b/Examples/test-suite/r/Makefile.in @@ -66,7 +66,7 @@ run_multitestcase = \ done # Clean clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile r_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" r_clean %.clean: @rm -f $*.R $*_wrap.so $*_wrap.cpp $*_wrap.c $*_wrap.o $*_runme.Rout $*.Rout diff --git a/Examples/test-suite/ruby/Makefile.in b/Examples/test-suite/ruby/Makefile.in index 206617ecd..1a6875360 100644 --- a/Examples/test-suite/ruby/Makefile.in +++ b/Examples/test-suite/ruby/Makefile.in @@ -70,4 +70,4 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile ruby_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" ruby_clean diff --git a/Examples/test-suite/tcl/Makefile.in b/Examples/test-suite/tcl/Makefile.in index 32454b09c..82c59dee4 100644 --- a/Examples/test-suite/tcl/Makefile.in +++ b/Examples/test-suite/tcl/Makefile.in @@ -55,4 +55,4 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile tcl_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" tcl_clean diff --git a/Examples/test-suite/uffi/Makefile.in b/Examples/test-suite/uffi/Makefile.in index 59aa33c6a..275778c87 100644 --- a/Examples/test-suite/uffi/Makefile.in +++ b/Examples/test-suite/uffi/Makefile.in @@ -48,4 +48,4 @@ run_testcase = \ @exit 0 clean: - $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile uffi_clean + $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" uffi_clean From b51bc39cf7ad2eb9c037f735a2839283c19d1f03 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 28 May 2014 21:18:41 +0200 Subject: [PATCH 115/152] Add check-maintainer-clean target: fails if files are missed by maintainer-clean --- .travis.yml | 2 +- Makefile.in | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89bed90a1..08731ca62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,7 +113,7 @@ script: - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples CFLAGS="${CFLAGS_EXAMPLES[$SWIGLANG]}" CXXFLAGS="${CXXFLAGS_EXAMPLES[$SWIGLANG]}"; fi - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi - echo 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r' - - make maintainer-clean && find . -type f | sed 's/^/File left after maintainer-clean - /' && ../../configure $CONFIGOPTS + - make check-maintainer-clean && ../../configure $CONFIGOPTS - echo -en 'travis_fold:end:script.3\\r' branches: only: diff --git a/Makefile.in b/Makefile.in index 2b9cf3b32..05c506559 100644 --- a/Makefile.in +++ b/Makefile.in @@ -455,6 +455,14 @@ maintainer-clean: @echo distcleaning @$(MAKE) $(FLAGS) distclean-helper +check-maintainer-clean: maintainer-clean + @if test "x$(srcdir)" != "x."; then \ + for file in `find . -type f`; do \ + echo "file missed by maintainer-clean: $$file"; \ + done; \ + fi; \ + test "x$$file" = x && echo "all files cleaned by maintainer-clean" + ##################################################################### # Update the Lib/swigwarn.swg file # Note: Generated into the source tree rather than build tree From 664c6cc81e88b300e21206623ae0053eec43e627 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 29 May 2014 07:50:21 +0100 Subject: [PATCH 116/152] Fix infinity testcase on windows --- Examples/test-suite/infinity.i | 27 ++++++++++++++----- .../test-suite/javascript/infinity_runme.js | 1 + 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Examples/test-suite/infinity.i b/Examples/test-suite/infinity.i index 726150f02..4aa987c11 100644 --- a/Examples/test-suite/infinity.i +++ b/Examples/test-suite/infinity.i @@ -10,15 +10,16 @@ #include /* C99 math.h defines INFINITY. If not available, this is the fallback. */ -#ifndef INFINITY - #ifdef _MSC_VER +#if !defined(INFINITY) + #if defined(_MSC_VER) union MSVC_EVIL_FLOAT_HACK { unsigned __int8 Bytes[4]; float Value; }; - static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}}; + const union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}}; #define INFINITY (INFINITY_HACK.Value) + #define INFINITY_NO_CONST #endif #ifdef __GNUC__ @@ -33,15 +34,27 @@ #define INFINITY (1e1000) #endif #endif -%} -%inline %{ -/* This will allow us to bind the real INFINITY value through SWIG via MYINFINITY. Use %rename to fix the name. */ +#ifdef INFINITY_NO_CONST +/* To void: error C2099: initializer is not a constant */ +double MYINFINITY = 0.0; +void initialise_MYINFINITY(void) { + MYINFINITY = INFINITY; +} +#else const double MYINFINITY = INFINITY; +void initialise_MYINFINITY(void) { +} +#endif -/* Use of float is intentional because the original bug was in the float conversion due to overflow checking. */ float use_infinity(float inf_val) { return inf_val; } %} + +/* This will allow us to bind the real INFINITY value through SWIG via MYINFINITY. Use %rename to fix the name. */ +const double MYINFINITY = INFINITY; +/* Use of float is intentional because the original bug was in the float conversion due to overflow checking. */ +float use_infinity(float inf_val); + diff --git a/Examples/test-suite/javascript/infinity_runme.js b/Examples/test-suite/javascript/infinity_runme.js index 050c391a7..8ebe496a6 100644 --- a/Examples/test-suite/javascript/infinity_runme.js +++ b/Examples/test-suite/javascript/infinity_runme.js @@ -1,4 +1,5 @@ var infinity = require("infinity"); +infinity.initialise_MYINFINITY(); var my_infinity = infinity.INFINITY; var ret_val = infinity.use_infinity(my_infinity); From 42938dc520d0c13c5d7e463298a2bd77f5ea9c82 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 29 May 2014 08:42:38 +0100 Subject: [PATCH 117/152] Correct infinity testcase --- Examples/test-suite/infinity.i | 1 + 1 file changed, 1 insertion(+) diff --git a/Examples/test-suite/infinity.i b/Examples/test-suite/infinity.i index 4aa987c11..e95bdf9cf 100644 --- a/Examples/test-suite/infinity.i +++ b/Examples/test-suite/infinity.i @@ -55,6 +55,7 @@ float use_infinity(float inf_val) /* This will allow us to bind the real INFINITY value through SWIG via MYINFINITY. Use %rename to fix the name. */ const double MYINFINITY = INFINITY; +void initialise_MYINFINITY(void); /* Use of float is intentional because the original bug was in the float conversion due to overflow checking. */ float use_infinity(float inf_val); From b71eb53baeb26f5052ed6da5064af6b10d0e6844 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 29 May 2014 08:44:19 +0100 Subject: [PATCH 118/152] Fix errors test-suite on windows --- Examples/test-suite/errors/Makefile.in | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in index 3b165f9cd..4c61001e7 100644 --- a/Examples/test-suite/errors/Makefile.in +++ b/Examples/test-suite/errors/Makefile.in @@ -15,18 +15,11 @@ LANGUAGE = errors ERROR_EXT = newerr -# Portable dos2unix / todos for stripping CR -TODOS = tr -d '\r' -#TODOS = sed -e 's/\r$$//' # On OSX behaves as if written 's/r$$//' srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -# strip source directory from output, so that diffs compare -srcdir_regexp = $(shell echo $(srcdir)/ | sed 's/\./[.]/g') -STRIP_SRCDIR = sed 's|^$(srcdir_regexp)||' - # All .i files with prefix 'cpp_' will be treated as C++ input and remaining .i files as C input ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i))) CPP_ERROR_TEST_CASES := $(filter cpp_%, $(ALL_ERROR_TEST_CASES)) @@ -37,17 +30,23 @@ ERROR_TEST_CASES := $(CPP_ERROR_TEST_CASES:=.cpptest) \ include $(srcdir)/../common.mk +# Portable dos2unix / todos for stripping CR +TODOS = tr -d '\r' +#TODOS = sed -e 's/\r$$//' # On OSX behaves as if written 's/r$$//' + +# strip source directory from output, so that diffs compare +STRIP_SRCDIR = sed -e 's|\\|/|g' -e 's|^$(SRCDIR)||' # Rules for the different types of tests %.cpptest: echo "$(ACTION)ing errors testcase $*" - -$(SWIG) -c++ -python -Wall -Fstandard $(SWIGOPT) $(srcdir)/$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) - $(COMPILETOOL) diff -c $(srcdir)/$*.stderr $*.$(ERROR_EXT) + -$(SWIG) -c++ -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) + $(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT) %.ctest: echo "$(ACTION)ing errors testcase $*" - -$(SWIG) -python -Wall -Fstandard $(SWIGOPT) $(srcdir)/$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) - $(COMPILETOOL) diff -c $(srcdir)/$*.stderr $*.$(ERROR_EXT) + -$(SWIG) -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT) + $(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT) %.clean: @exit 0 From eb61c85e5f4c5a79dd8e01a36bddae9271612da2 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Thu, 29 May 2014 14:26:02 +0200 Subject: [PATCH 119/152] check-maintainer-clean: print skipping message for in-source-tree builds --- Makefile.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 05c506559..bb0845f37 100644 --- a/Makefile.in +++ b/Makefile.in @@ -456,11 +456,13 @@ maintainer-clean: @$(MAKE) $(FLAGS) distclean-helper check-maintainer-clean: maintainer-clean - @if test "x$(srcdir)" != "x."; then \ - for file in `find . -type f`; do \ - echo "file missed by maintainer-clean: $$file"; \ - done; \ + @if test "x$(srcdir)" = "x."; then \ + echo "skipping maintainer-clean check (in-source-tree build)"; \ + exit 0; \ fi; \ + for file in `find . -type f`; do \ + echo "file missed by maintainer-clean: $$file"; \ + done; \ test "x$$file" = x && echo "all files cleaned by maintainer-clean" ##################################################################### From b8026cc02f6b7639afd83cbd4e0419963d8c9428 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Thu, 29 May 2014 14:35:23 +0200 Subject: [PATCH 120/152] Fix cleaning of Python runme.py scripts for in-source-tree builds --- Examples/Makefile.in | 2 +- Examples/test-suite/python/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index b1b460c56..521df3a70 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -402,7 +402,7 @@ python_clean: rm -f *.@OBJEXT@ *@SO@ *@PYTHON_SO@ rm -f $(TARGET).py if test -f $(SRCDIR)$(RUNME).py; then rm -f $(RUNME)3.py $(RUNME)3.py.bak; fi - if test "x$(SRCDIR)" != x; then rm -f $(RUNME).py; fi + case "x$(SRCDIR)" in x|x./);; *) rm -f $(RUNME).py;; esac ################################################################## diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 87443cb57..9673d7da1 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -161,7 +161,7 @@ endif %.clean: @rm -f $*.py @if test -f $(srcdir)/$(py2_runme); then rm -f $(SCRIPTDIR)/$(py3_runme) $(SCRIPTDIR)/$(py3_runme).bak; fi - @if test "x$(SRCDIR)" != x; then rm -f $(SCRIPTDIR)/$(py2_runme); fi + @if test "x$(SCRIPTDIR)" != "x$(srcdir)"; then rm -f $(SCRIPTDIR)/$(py2_runme); fi clean: $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" python_clean From 79c91607369510a02788fb9e992f9de48118b835 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 29 May 2014 16:54:08 +0100 Subject: [PATCH 121/152] Search for 64bit webkit during configure For some Linux distributions (SUSE) --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8af45b69f..77b804ddd 100644 --- a/configure.ac +++ b/configure.ac @@ -1191,7 +1191,7 @@ else if test -z "$JSCORELIB"; then case $host in *-*-linux*) - dirs="/usr/lib/ /usr/local/lib/" + dirs="/usr/lib64/ /usr/local/lib64/ /usr/lib/ /usr/local/lib/" for i in $dirs ; do if test -r $i/libjavascriptcoregtk-1.0.so; then AC_MSG_RESULT($i) @@ -1259,7 +1259,7 @@ else AC_MSG_CHECKING(for V8 Javascript library) AC_ARG_WITH(jsv8lib,[ --with-v8lib=path Set location of V8 Javascript library directory],[JSV8LIBDIR="$withval"], [JSV8LIB=]) - v8libdirs="$JSV8LIBDIR /usr/lib*/ /usr/local/lib*/" + v8libdirs="$JSV8LIBDIR /usr/lib64/ /usr/local/lib64/ /usr/lib/ /usr/local/lib/" for d in $v8libdirs ; do if test -r $d/libv8.so; then JSV8LIBDIR=$d From 36a6a0cbe0654693f667fffc349dcb28d1549839 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 29 May 2014 19:54:13 +0100 Subject: [PATCH 122/152] Update AX_BOOST_BASE autoconf macro to serial 23 --- Tools/config/ax_boost_base.m4 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Tools/config/ax_boost_base.m4 b/Tools/config/ax_boost_base.m4 index 54a2a1bee..550b64138 100644 --- a/Tools/config/ax_boost_base.m4 +++ b/Tools/config/ax_boost_base.m4 @@ -33,7 +33,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 20 +#serial 23 AC_DEFUN([AX_BOOST_BASE], [ @@ -91,9 +91,23 @@ if test "x$want_boost" = "xyes"; then dnl are found, e.g. when only header-only libraries are installed! libsubdirs="lib" ax_arch=`uname -m` - if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then + case $ax_arch in + x86_64|ppc64|s390x|sparc64|aarch64) libsubdirs="lib64 lib lib64" - fi + ;; + esac + + dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give + dnl them priority over the other paths since, if libs are found there, they + dnl are almost assuredly the ones desired. + AC_REQUIRE([AC_CANONICAL_HOST]) + libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs" + + case ${host_cpu} in + i?86) + libsubdirs="lib/i386-${host_os} $libsubdirs" + ;; + esac dnl first we check the system location for boost libraries dnl this location ist chosen if boost libraries are installed with the --layout=system option @@ -256,3 +270,4 @@ if test "x$want_boost" = "xyes"; then fi ]) + From cdd894d2af8eb2454006bf1a866b9bc59b70d3b5 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Tue, 27 May 2014 01:15:10 +0200 Subject: [PATCH 123/152] .gitignore: add Source/TAGS --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index bce0812b7..b67e1d219 100644 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,7 @@ Lib/swigwarn.swg Source/CParse/parser.c Source/CParse/parser.h Source/eswig +Source/TAGS swig Tools/javascript/javascript From 603a73142ad9e97bc0435261f8f3067ad6653bbb Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Mon, 26 May 2014 20:39:04 +0200 Subject: [PATCH 124/152] Octave: ignore generated files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b67e1d219..28b44271f 100644 --- a/.gitignore +++ b/.gitignore @@ -134,6 +134,9 @@ Examples/test-suite/uffi/*/ # Javascript generated files *.gyp +# Octave generated files +swigexample*.oct + # Python generated files, based on: # https://github.com/github/gitignore/blob/master/Python.gitignore *.py[cod] From 5c5510842b5c443db0294ca924f13bd1f7ec7fa0 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Mon, 26 May 2014 21:35:02 +0200 Subject: [PATCH 125/152] Octave: remove Python code from std_carray.i --- Lib/octave/std_carray.i | 56 ----------------------------------------- 1 file changed, 56 deletions(-) diff --git a/Lib/octave/std_carray.i b/Lib/octave/std_carray.i index 9e2338a61..e69de29bb 100644 --- a/Lib/octave/std_carray.i +++ b/Lib/octave/std_carray.i @@ -1,56 +0,0 @@ -%include - -/* -%fragment("StdCarrayTraits","header",fragment="StdSequenceTraits") -{ -namespace swig { - template - struct traits_asptr > { - static int asptr(PyObject *obj, std::carray **array) { - return traits_asptr_stdseq >::asptr(obj, array); - } - }; -} -} - -%warnfilter(SWIGWARN_IGNORE_OPERATOR_INDEX) std::carray::operator[]; - -%extend std::carray { - %fragment(SWIG_Traits_frag(std::carray<_Type, _Size >), "header", - fragment="SwigPyIterator_T", - fragment=SWIG_Traits_frag(_Type), - fragment="StdCarrayTraits") { - namespace swig { - template <> struct traits > { - typedef pointer_category category; - static const char* type_name() { - return "std::carray<" #_Type "," #_Size " >"; - } - }; - } - } - - %typemaps_asptr(SWIG_TYPECHECK_VECTOR, swig::asptr, - SWIG_Traits_frag(std::carray<_Type, _Size >), - std::carray<_Type, _Size >); - - %typemap(out,noblock=1) iterator, const_iterator { - $result = SWIG_NewPointerObj(swig::make_output_iterator((const $type &)$1), - swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); - } - - inline size_t __len__() const { return self->size(); } - - inline const _Type& __getitem__(size_t i) const { return (*self)[i]; } - - inline void __setitem__(size_t i, const _Type& v) { (*self)[i] = v; } - - - swig::SwigPyIterator* __iter__(PyObject **PYTHON_SELF) { - return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); - } -} - -%include -*/ - From ebe13380158ad5f552405463287d3cb4cdecc8bd Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Wed, 21 May 2014 22:31:36 +0200 Subject: [PATCH 126/152] Octave: whitespace/indentation cleanup of octave.cxx --- Source/Modules/octave.cxx | 658 +++++++++++++++++++------------------- 1 file changed, 329 insertions(+), 329 deletions(-) diff --git a/Source/Modules/octave.cxx b/Source/Modules/octave.cxx index 103b59194..1c8b639bb 100644 --- a/Source/Modules/octave.cxx +++ b/Source/Modules/octave.cxx @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * This file is part of SWIG, which is licensed as a whole under version 3 + * This file is part of SWIG, which is licensed as a whole under version 3 * (or any later version) of the GNU General Public License. Some additional * terms also apply to certain portions of SWIG. The full details of the SWIG * license and copyrights can be found in the LICENSE and COPYRIGHT files @@ -75,51 +75,51 @@ public: constructor_name(0), docs(0) { - /* Add code to manage protected constructors and directors */ - director_prot_ctor_code = NewString(""); - Printv(director_prot_ctor_code, - "if ( $comparison ) { /* subclassed */\n", - " $director_new \n", - "} else {\n", " error(\"accessing abstract class or protected constructor\"); \n", " SWIG_fail;\n", "}\n", NIL); + /* Add code to manage protected constructors and directors */ + director_prot_ctor_code = NewString(""); + Printv(director_prot_ctor_code, + "if ( $comparison ) { /* subclassed */\n", + " $director_new \n", + "} else {\n", " error(\"accessing abstract class or protected constructor\"); \n", " SWIG_fail;\n", "}\n", NIL); - enable_cplus_runtime_mode(); - allow_overloading(); - director_multiple_inheritance = 1; - director_language = 1; - docs = NewHash(); - } + enable_cplus_runtime_mode(); + allow_overloading(); + director_multiple_inheritance = 1; + director_language = 1; + docs = NewHash(); + } virtual void main(int argc, char *argv[]) { for (int i = 1; i < argc; i++) { if (argv[i]) { - if (strcmp(argv[i], "-help") == 0) { - fputs(usage, stdout); - } else if (strcmp(argv[i], "-global") == 0 || + if (strcmp(argv[i], "-help") == 0) { + fputs(usage, stdout); + } else if (strcmp(argv[i], "-global") == 0 || strcmp(argv[i], "-noglobal") == 0) { - Printv(stderr, + Printv(stderr, "*** -global/-noglobal are no longer supported\n" "*** global load behaviour is now determined at module load\n" "*** see the Perl section in the manual for details.\n", NIL); - SWIG_exit(EXIT_FAILURE); - } else if (strcmp(argv[i], "-globals") == 0) { - if (argv[i + 1]) { - global_name = NewString(argv[i + 1]); - Swig_mark_arg(i); - Swig_mark_arg(i + 1); - i++; - } else { - Swig_arg_error(); - } - } else if (strcmp(argv[i], "-opprefix") == 0) { - if (argv[i + 1]) { - op_prefix = NewString(argv[i + 1]); - Swig_mark_arg(i); - Swig_mark_arg(i + 1); - i++; - } else { - Swig_arg_error(); - } - } + SWIG_exit(EXIT_FAILURE); + } else if (strcmp(argv[i], "-globals") == 0) { + if (argv[i + 1]) { + global_name = NewString(argv[i + 1]); + Swig_mark_arg(i); + Swig_mark_arg(i + 1); + i++; + } else { + Swig_arg_error(); + } + } else if (strcmp(argv[i], "-opprefix") == 0) { + if (argv[i + 1]) { + op_prefix = NewString(argv[i + 1]); + Swig_mark_arg(i); + Swig_mark_arg(i + 1); + i++; + } else { + Swig_arg_error(); + } + } } } @@ -143,21 +143,21 @@ public: { Node *mod = Getattr(n, "module"); if (mod) { - Node *options = Getattr(mod, "options"); - if (options) { - int dirprot = 0; - if (Getattr(options, "dirprot")) { - dirprot = 1; - } - if (Getattr(options, "nodirprot")) { - dirprot = 0; - } - if (Getattr(options, "directors")) { - allow_directors(); - if (dirprot) - allow_dirprot(); - } - } + Node *options = Getattr(mod, "options"); + if (options) { + int dirprot = 0; + if (Getattr(options, "dirprot")) { + dirprot = 1; + } + if (Getattr(options, "nodirprot")) { + dirprot = 0; + } + if (Getattr(options, "directors")) { + allow_directors(); + if (dirprot) + allow_dirprot(); + } + } } } @@ -202,8 +202,8 @@ public: Printf(f_runtime, "#define SWIG_DIRECTORS\n"); Swig_banner(f_directors_h); if (dirprot_mode()) { - // Printf(f_directors_h, "#include \n"); - // Printf(f_directors_h, "#include \n\n"); + // Printf(f_directors_h, "#include \n"); + // Printf(f_directors_h, "#include \n\n"); } } @@ -263,19 +263,19 @@ public: String *r = NewString(""); for (int j=0;s[j];++j) { if (s[j] == '\n') { - Append(r, "\\n\\\n"); + Append(r, "\\n\\\n"); } else if (s[j] == '\r') { - Append(r, "\\r"); + Append(r, "\\r"); } else if (s[j] == '\t') { - Append(r, "\\t"); + Append(r, "\\t"); } else if (s[j] == '\\') { - Append(r, "\\\\"); + Append(r, "\\\\"); } else if (s[j] == '\'') { - Append(r, "\\\'"); + Append(r, "\\\'"); } else if (s[j] == '\"') { - Append(r, "\\\""); + Append(r, "\\\""); } else - Putc(s[j], r); + Putc(s[j], r); } return r; } @@ -293,11 +293,11 @@ public: String *escaped_doc_str = texinfo_escape(doc_str); if (Len(doc_str)>0) { - Printf(f_doc,"static const char* %s_texinfo = ",wrap_name); - Printf(f_doc,"\"-*- texinfo -*-\\n\\\n%s", escaped_doc_str); - if (Len(decl_info)) - Printf(f_doc,"\\n\\\n@end deftypefn"); - Printf(f_doc,"\";\n"); + Printf(f_doc,"static const char* %s_texinfo = ",wrap_name); + Printf(f_doc,"\"-*- texinfo -*-\\n\\\n%s", escaped_doc_str); + if (Len(decl_info)) + Printf(f_doc,"\\n\\\n@end deftypefn"); + Printf(f_doc,"\";\n"); } Delete(escaped_doc_str); @@ -313,7 +313,7 @@ public: String *decl_info = Getattr(n, "decl_info"); String *cdecl_info = Getattr(n, "cdecl_info"); String *args_info = Getattr(n, "args_info"); - return !Len(synopsis) && !Len(decl_info) && + return !Len(synopsis) && !Len(decl_info) && !Len(cdecl_info) && !Len(args_info); } String *texinfo_name(Node* n, const char* defval = "0") { @@ -360,11 +360,11 @@ public: SwigType *type = Getattr(n, "type"); if (type && Strcmp(type, "void")) { - Node *nn = classLookup(Getattr(n, "type")); - String *type_str = nn ? Copy(Getattr(nn, "sym:name")) : SwigType_str(type, 0); - Append(decl_info, "@var{retval} = "); - Printf(args_str, "%s@var{retval} is of type %s. ", args_str, type_str); - Delete(type_str); + Node *nn = classLookup(Getattr(n, "type")); + String *type_str = nn ? Copy(Getattr(nn, "sym:name")) : SwigType_str(type, 0); + Append(decl_info, "@var{retval} = "); + Printf(args_str, "%s@var{retval} is of type %s. ", args_str, type_str); + Delete(type_str); } Append(decl_info, name); @@ -380,8 +380,8 @@ public: // strip off {} if necessary char *t = Char(str); if (*t == '{') { - Delitem(str, 0); - Delitem(str, DOH_END); + Delitem(str, 0); + Delitem(str, DOH_END); } // emit into synopsis section @@ -408,7 +408,7 @@ public: * addMissingParameterNames() * For functions that have not had nameless parameters set in the Language class. * - * Inputs: + * Inputs: * plist - entire parameter list * arg_offset - argument number for first parameter * Side effects: @@ -420,8 +420,8 @@ public: int i = arg_offset; while (p) { if (!Getattr(p, "lname")) { - String *pname = Swig_cparm_name(p, i); - Delete(pname); + String *pname = Swig_cparm_name(p, i); + Delete(pname); } i++; p = nextSibling(p); @@ -444,12 +444,12 @@ public: String *tm = Getattr(p, "tmap:in"); if (tm) { - pnext = Getattr(p, "tmap:in:next"); - if (checkAttribute(p, "tmap:in:numinputs", "0")) { - continue; - } + pnext = Getattr(p, "tmap:in:next"); + if (checkAttribute(p, "tmap:in:numinputs", "0")) { + continue; + } } else { - pnext = nextSibling(p); + pnext = nextSibling(p); } String *name = 0; @@ -457,9 +457,9 @@ public: String *value = 0; String *pdoc = Getattr(p, "tmap:doc"); if (pdoc) { - name = Getattr(p, "tmap:doc:name"); - type = Getattr(p, "tmap:doc:type"); - value = Getattr(p, "tmap:doc:value"); + name = Getattr(p, "tmap:doc:name"); + type = Getattr(p, "tmap:doc:type"); + value = Getattr(p, "tmap:doc:value"); } // Note: the generated name should be consistent with that in kwnames[] @@ -471,28 +471,28 @@ public: value = value ? value : Getattr(p, "value"); if (SwigType_isvarargs(type)) - break; + break; String *tex_name = NewString(""); if (name) - Printf(tex_name, "@var{%s}", name); + Printf(tex_name, "@var{%s}", name); else - Printf(tex_name, "@var{?}"); + Printf(tex_name, "@var{?}"); if (Len(decl_str)) - Append(decl_str, ", "); + Append(decl_str, ", "); Append(decl_str, tex_name); if (value) { - String *new_value = convertValue(value, Getattr(p, "type")); - if (new_value) { - value = new_value; - } else { - Node *lookup = Swig_symbol_clookup(value, 0); - if (lookup) - value = Getattr(lookup, "sym:name"); - } - Printf(decl_str, " = %s", value); + String *new_value = convertValue(value, Getattr(p, "type")); + if (new_value) { + value = new_value; + } else { + Node *lookup = Swig_symbol_clookup(value, 0); + if (lookup) + value = Getattr(lookup, "sym:name"); + } + Printf(decl_str, " = %s", value); } Node *nn = classLookup(Getattr(p, "type")); @@ -517,18 +517,18 @@ public: if (v && Len(v) > 0) { char fc = (Char(v))[0]; if (('0' <= fc && fc <= '9') || '\'' == fc || '"' == fc) { - /* number or string (or maybe NULL pointer) */ - if (SwigType_ispointer(t) && Strcmp(v, "0") == 0) - return NewString("None"); - else - return v; + /* number or string (or maybe NULL pointer) */ + if (SwigType_ispointer(t) && Strcmp(v, "0") == 0) + return NewString("None"); + else + return v; } if (Strcmp(v, "NULL") == 0 || Strcmp(v, "nullptr") == 0) - return SwigType_ispointer(t) ? NewString("nil") : NewString("0"); + return SwigType_ispointer(t) ? NewString("nil") : NewString("0"); if (Strcmp(v, "true") == 0 || Strcmp(v, "TRUE") == 0) - return NewString("true"); + return NewString("true"); if (Strcmp(v, "false") == 0 || Strcmp(v, "FALSE") == 0) - return NewString("false"); + return NewString("false"); } return 0; } @@ -572,89 +572,89 @@ public: int varargs = emit_isvarargs(l); char source[64]; - Printf(f->code, "if (!SWIG_check_num_args(\"%s\",args.length(),%i,%i,%i)) " - "{\n SWIG_fail;\n }\n", iname, num_arguments, num_required, varargs); + Printf(f->code, "if (!SWIG_check_num_args(\"%s\",args.length(),%i,%i,%i)) " + "{\n SWIG_fail;\n }\n", iname, num_arguments, num_required, varargs); if (constructor && num_arguments == 1 && num_required == 1) { if (Cmp(storage, "explicit") == 0) { - Node *parent = Swig_methodclass(n); - if (GetFlag(parent, "feature:implicitconv")) { - String *desc = NewStringf("SWIGTYPE%s", SwigType_manglestr(Getattr(n, "type"))); - Printf(f->code, "if (SWIG_CheckImplicit(%s)) SWIG_fail;\n", desc); - Delete(desc); - } + Node *parent = Swig_methodclass(n); + if (GetFlag(parent, "feature:implicitconv")) { + String *desc = NewStringf("SWIGTYPE%s", SwigType_manglestr(Getattr(n, "type"))); + Printf(f->code, "if (SWIG_CheckImplicit(%s)) SWIG_fail;\n", desc); + Delete(desc); + } } } for (j = 0, p = l; j < num_arguments; ++j) { while (checkAttribute(p, "tmap:in:numinputs", "0")) { - p = Getattr(p, "tmap:in:next"); + p = Getattr(p, "tmap:in:next"); } SwigType *pt = Getattr(p, "type"); String *tm = Getattr(p, "tmap:in"); if (tm) { - if (!tm || checkAttribute(p, "tmap:in:numinputs", "0")) { - p = nextSibling(p); - continue; - } + if (!tm || checkAttribute(p, "tmap:in:numinputs", "0")) { + p = nextSibling(p); + continue; + } - sprintf(source, "args(%d)", j); - Setattr(p, "emit:input", source); + sprintf(source, "args(%d)", j); + Setattr(p, "emit:input", source); - Replaceall(tm, "$source", Getattr(p, "emit:input")); - Replaceall(tm, "$input", Getattr(p, "emit:input")); - Replaceall(tm, "$target", Getattr(p, "lname")); + Replaceall(tm, "$source", Getattr(p, "emit:input")); + Replaceall(tm, "$input", Getattr(p, "emit:input")); + Replaceall(tm, "$target", Getattr(p, "lname")); - if (Getattr(p, "wrap:disown") || (Getattr(p, "tmap:in:disown"))) { - Replaceall(tm, "$disown", "SWIG_POINTER_DISOWN"); - } else { - Replaceall(tm, "$disown", "0"); - } + if (Getattr(p, "wrap:disown") || (Getattr(p, "tmap:in:disown"))) { + Replaceall(tm, "$disown", "SWIG_POINTER_DISOWN"); + } else { + Replaceall(tm, "$disown", "0"); + } - if (Getattr(p, "tmap:in:implicitconv")) { - const char *convflag = "0"; - if (!Getattr(p, "hidden")) { - SwigType *ptype = Getattr(p, "type"); - convflag = get_implicitconv_flag(classLookup(ptype)); - } - Replaceall(tm, "$implicitconv", convflag); - Setattr(p, "implicitconv", convflag); - } + if (Getattr(p, "tmap:in:implicitconv")) { + const char *convflag = "0"; + if (!Getattr(p, "hidden")) { + SwigType *ptype = Getattr(p, "type"); + convflag = get_implicitconv_flag(classLookup(ptype)); + } + Replaceall(tm, "$implicitconv", convflag); + Setattr(p, "implicitconv", convflag); + } - String *getargs = NewString(""); - if (j >= num_required) - Printf(getargs, "if (%dcode, getargs, "\n", NIL); - Delete(getargs); + String *getargs = NewString(""); + if (j >= num_required) + Printf(getargs, "if (%dcode, getargs, "\n", NIL); + Delete(getargs); - p = Getattr(p, "tmap:in:next"); - continue; + p = Getattr(p, "tmap:in:next"); + continue; } else { - Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); - break; + Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0)); + break; } } // Check for trailing varargs if (varargs) { if (p && (tm = Getattr(p, "tmap:in"))) { - Replaceall(tm, "$input", "varargs"); - Printv(f->code, tm, "\n", NIL); + Replaceall(tm, "$input", "varargs"); + Printv(f->code, tm, "\n", NIL); } } // Insert constraint checking code for (p = l; p;) { if ((tm = Getattr(p, "tmap:check"))) { - Replaceall(tm, "$target", Getattr(p, "lname")); - Printv(f->code, tm, "\n", NIL); - p = Getattr(p, "tmap:check:next"); + Replaceall(tm, "$target", Getattr(p, "lname")); + Printv(f->code, tm, "\n", NIL); + p = Getattr(p, "tmap:check:next"); } else { - p = nextSibling(p); + p = nextSibling(p); } } @@ -662,23 +662,23 @@ public: String *cleanup = NewString(""); for (p = l; p;) { if ((tm = Getattr(p, "tmap:freearg"))) { - if (Getattr(p, "tmap:freearg:implicitconv")) { - const char *convflag = "0"; - if (!Getattr(p, "hidden")) { - SwigType *ptype = Getattr(p, "type"); - convflag = get_implicitconv_flag(classLookup(ptype)); - } - if (strcmp(convflag, "0") == 0) { - tm = 0; - } - } - if (tm && (Len(tm) != 0)) { - Replaceall(tm, "$source", Getattr(p, "lname")); - Printv(cleanup, tm, "\n", NIL); - } - p = Getattr(p, "tmap:freearg:next"); + if (Getattr(p, "tmap:freearg:implicitconv")) { + const char *convflag = "0"; + if (!Getattr(p, "hidden")) { + SwigType *ptype = Getattr(p, "type"); + convflag = get_implicitconv_flag(classLookup(ptype)); + } + if (strcmp(convflag, "0") == 0) { + tm = 0; + } + } + if (tm && (Len(tm) != 0)) { + Replaceall(tm, "$source", Getattr(p, "lname")); + Printv(cleanup, tm, "\n", NIL); + } + p = Getattr(p, "tmap:freearg:next"); } else { - p = nextSibling(p); + p = nextSibling(p); } } @@ -686,15 +686,15 @@ public: String *outarg = NewString(""); for (p = l; p;) { if ((tm = Getattr(p, "tmap:argout"))) { - Replaceall(tm, "$source", Getattr(p, "lname")); - Replaceall(tm, "$target", "_outp"); - Replaceall(tm, "$result", "_outp"); - Replaceall(tm, "$arg", Getattr(p, "emit:input")); - Replaceall(tm, "$input", Getattr(p, "emit:input")); - Printv(outarg, tm, "\n", NIL); - p = Getattr(p, "tmap:argout:next"); + Replaceall(tm, "$source", Getattr(p, "lname")); + Replaceall(tm, "$target", "_outp"); + Replaceall(tm, "$result", "_outp"); + Replaceall(tm, "$arg", Getattr(p, "emit:input")); + Replaceall(tm, "$input", Getattr(p, "emit:input")); + Printv(outarg, tm, "\n", NIL); + p = Getattr(p, "tmap:argout:next"); } else { - p = nextSibling(p); + p = nextSibling(p); } } @@ -720,9 +720,9 @@ public: Replaceall(tm, "$result", "_outv"); if (GetFlag(n, "feature:new")) - Replaceall(tm, "$owner", "1"); + Replaceall(tm, "$owner", "1"); else - Replaceall(tm, "$owner", "0"); + Replaceall(tm, "$owner", "0"); Printf(f->code, "%s\n", tm); Printf(f->code, "if (_outv.is_defined()) _outp = " "SWIG_Octave_AppendOutput(_outp, _outv);\n"); @@ -737,8 +737,8 @@ public: if (GetFlag(n, "feature:new")) { if ((tm = Swig_typemap_lookup("newfree", n, Swig_cresult_name(), 0))) { - Replaceall(tm, "$source", Swig_cresult_name()); - Printf(f->code, "%s\n", tm); + Replaceall(tm, "$source", Swig_cresult_name()); + Printf(f->code, "%s\n", tm); } } @@ -830,16 +830,16 @@ public: if (is_assignable(n)) { Setattr(n, "wrap:name", setname); if ((tm = Swig_typemap_lookup("varin", n, name, 0))) { - Replaceall(tm, "$source", "args(0)"); - Replaceall(tm, "$target", name); - Replaceall(tm, "$input", "args(0)"); - if (Getattr(n, "tmap:varin:implicitconv")) { - Replaceall(tm, "$implicitconv", get_implicitconv_flag(n)); - } - emit_action_code(n, setf->code, tm); - Delete(tm); + Replaceall(tm, "$source", "args(0)"); + Replaceall(tm, "$target", name); + Replaceall(tm, "$input", "args(0)"); + if (Getattr(n, "tmap:varin:implicitconv")) { + Replaceall(tm, "$implicitconv", get_implicitconv_flag(n)); + } + emit_action_code(n, setf->code, tm); + Delete(tm); } else { - Swig_warning(WARN_TYPEMAP_VARIN_UNDEF, input_file, line_number, "Unable to set variable of type %s.\n", SwigType_str(t, 0)); + Swig_warning(WARN_TYPEMAP_VARIN_UNDEF, input_file, line_number, "Unable to set variable of type %s.\n", SwigType_str(t, 0)); } Append(setf->code, "fail:\n"); Printf(setf->code, "return octave_value_list();\n"); @@ -995,18 +995,18 @@ public: int index = 0; b = First(baselist); while (b.item) { - String *bname = Getattr(b.item, "name"); - if ((!bname) || GetFlag(b.item, "feature:ignore") || (!Getattr(b.item, "module"))) { - b = Next(b); - continue; - } + String *bname = Getattr(b.item, "name"); + if ((!bname) || GetFlag(b.item, "feature:ignore") || (!Getattr(b.item, "module"))) { + b = Next(b); + continue; + } - String *bname_mangled = SwigType_manglestr(SwigType_add_pointer(Copy(bname))); - Printf(base_class_names, "\"%s\",", bname_mangled); - Printf(base_class, "0,"); - b = Next(b); - index++; - Delete(bname_mangled); + String *bname_mangled = SwigType_manglestr(SwigType_add_pointer(Copy(bname))); + Printf(base_class_names, "\"%s\",", bname_mangled); + Printf(base_class, "0,"); + b = Next(b); + index++; + Delete(bname_mangled); } } @@ -1063,8 +1063,8 @@ public: bool overloaded = !!Getattr(n, "sym:overloaded"); if (overloaded) Delslice(rname, Len(rname) - Len(Getattr(n, "sym:overname")), DOH_END); - Printf(s_members_tab, "{\"%s\",%s,0,0,0,%s},\n", - realname, rname, tname); + Printf(s_members_tab, "{\"%s\",%s,0,0,0,%s},\n", + realname, rname, tname); Delete(rname); Delete(tname); } @@ -1112,7 +1112,7 @@ public: Delete(name); Setattr(self, "lname", "self_obj"); if (parms) - set_nextSibling(self, parms); + set_nextSibling(self, parms); Setattr(n, "parms", self); Setattr(n, "wrap:self", "1"); Setattr(n, "hidden", "1"); @@ -1144,12 +1144,12 @@ public: bool overloaded = !!Getattr(n, "sym:overloaded"); if (overloaded) Delslice(rname, Len(rname) - Len(Getattr(n, "sym:overname")), DOH_END); - Printf(s_members_tab, "{\"%s\",%s,0,0,1,%s},\n", - realname, rname, tname); + Printf(s_members_tab, "{\"%s\",%s,0,0,1,%s},\n", + realname, rname, tname); Delete(rname); Delete(tname); } - + return SWIG_OK; } @@ -1217,24 +1217,24 @@ public: if (!Getattr(n, "defaultargs")) { // constructor { - Wrapper *w = NewWrapper(); - String *call; - String *basetype = Getattr(parent, "classtype"); - String *target = Swig_method_decl(0, decl, classname, parms, 0, 0); - call = Swig_csuperclass_call(0, basetype, superparms); - Printf(w->def, "%s::%s: %s," "\nSwig::Director(static_cast<%s*>(this)) { \n", classname, target, call, basetype); - Append(w->def, "}\n"); - Delete(target); - Wrapper_print(w, f_directors); - Delete(call); - DelWrapper(w); + Wrapper *w = NewWrapper(); + String *call; + String *basetype = Getattr(parent, "classtype"); + String *target = Swig_method_decl(0, decl, classname, parms, 0, 0); + call = Swig_csuperclass_call(0, basetype, superparms); + Printf(w->def, "%s::%s: %s," "\nSwig::Director(static_cast<%s*>(this)) { \n", classname, target, call, basetype); + Append(w->def, "}\n"); + Delete(target); + Wrapper_print(w, f_directors); + Delete(call); + DelWrapper(w); } // constructor header { - String *target = Swig_method_decl(0, decl, classname, parms, 0, 1); - Printf(f_directors_h, " %s;\n", target); - Delete(target); + String *target = Swig_method_decl(0, decl, classname, parms, 0, 1); + Printf(f_directors_h, " %s;\n", target); + Delete(target); } } @@ -1250,7 +1250,7 @@ public: { Wrapper *w = NewWrapper(); Printf(w->def, "SwigDirector_%s::SwigDirector_%s(void* self) :" - "\nSwig::Director((octave_swig_type*)self,static_cast<%s*>(this)) { \n", classname, classname, classname); + "\nSwig::Director((octave_swig_type*)self,static_cast<%s*>(this)) { \n", classname, classname, classname); Append(w->def, "}\n"); Wrapper_print(w, f_directors); DelWrapper(w); @@ -1283,7 +1283,7 @@ public: if (Cmp(storage, "virtual") == 0) { if (Cmp(value, "0") == 0) { - pure_virtual = true; + pure_virtual = true; } } @@ -1317,18 +1317,18 @@ public: Append(declaration, " throw("); if (throw_parm_list) - Swig_typemap_attach_parms("throws", throw_parm_list, 0); + Swig_typemap_attach_parms("throws", throw_parm_list, 0); for (p = throw_parm_list; p; p = nextSibling(p)) { - if (Getattr(p, "tmap:throws")) { - if (gencomma++) { - Append(w->def, ", "); - Append(declaration, ", "); - } - String *str = SwigType_str(Getattr(p, "type"), 0); - Append(w->def, str); - Append(declaration, str); - Delete(str); - } + if (Getattr(p, "tmap:throws")) { + if (gencomma++) { + Append(w->def, ", "); + Append(declaration, ", "); + } + String *str = SwigType_str(Getattr(p, "type"), 0); + Append(w->def, str); + Append(declaration, str); + Delete(str); + } } Append(w->def, ")"); @@ -1338,27 +1338,27 @@ public: Append(w->def, " {"); Append(declaration, ";\n"); - // declare method return value + // declare method return value // if the return value is a reference or const reference, a specialized typemap must // handle it, including declaration of c_result ($result). if (!is_void) { if (!(ignored_method && !pure_virtual)) { - String *cres = SwigType_lstr(returntype, "c_result"); - Printf(w->code, "%s;\n", cres); - Delete(cres); + String *cres = SwigType_lstr(returntype, "c_result"); + Printf(w->code, "%s;\n", cres); + Delete(cres); } } if (ignored_method) { if (!pure_virtual) { - if (!is_void) - Printf(w->code, "return "); - String *super_call = Swig_method_call(super, l); - Printf(w->code, "%s;\n", super_call); - Delete(super_call); + if (!is_void) + Printf(w->code, "return "); + String *super_call = Swig_method_call(super, l); + Printf(w->code, "%s;\n", super_call); + Delete(super_call); } else { - Printf(w->code, "Swig::DirectorPureVirtualException::raise(\"Attempted to invoke pure virtual method %s::%s\");\n", SwigType_namestr(c_classname), - SwigType_namestr(name)); + Printf(w->code, "Swig::DirectorPureVirtualException::raise(\"Attempted to invoke pure virtual method %s::%s\");\n", SwigType_namestr(c_classname), + SwigType_namestr(name)); } } else { // attach typemaps to arguments (C/C++ -> Python) @@ -1374,50 +1374,50 @@ public: int outputs = 0; if (!is_void) - outputs++; + outputs++; // build argument list and type conversion string p = l; while (p) { - if (checkAttribute(p, "tmap:in:numinputs", "0")) { - p = Getattr(p, "tmap:in:next"); - continue; - } + if (checkAttribute(p, "tmap:in:numinputs", "0")) { + p = Getattr(p, "tmap:in:next"); + continue; + } - if (Getattr(p, "tmap:directorargout") != 0) - outputs++; + if (Getattr(p, "tmap:directorargout") != 0) + outputs++; - String *pname = Getattr(p, "name"); - String *ptype = Getattr(p, "type"); - Wrapper_add_local(w, "tmpv", "octave_value tmpv"); + String *pname = Getattr(p, "name"); + String *ptype = Getattr(p, "type"); + Wrapper_add_local(w, "tmpv", "octave_value tmpv"); - if ((tm = Getattr(p, "tmap:directorin")) != 0) { - String *parse = Getattr(p, "tmap:directorin:parse"); - if (!parse) { - Setattr(p, "emit:directorinput", "tmpv"); - Replaceall(tm, "$input", "tmpv"); - Replaceall(tm, "$owner", "0"); - Printv(wrap_args, tm, "\n", NIL); - Printf(wrap_args, "args.append(tmpv);\n"); - Putc('O', parse_args); - } else { - Append(parse_args, parse); - Setattr(p, "emit:directorinput", pname); - Replaceall(tm, "$input", pname); - Replaceall(tm, "$owner", "0"); - if (Len(tm) == 0) - Append(tm, pname); - } - p = Getattr(p, "tmap:directorin:next"); - continue; - } else if (Cmp(ptype, "void")) { - Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number, - "Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(ptype, 0), - SwigType_namestr(c_classname), SwigType_namestr(name)); - status = SWIG_NOWRAP; - break; - } - p = nextSibling(p); + if ((tm = Getattr(p, "tmap:directorin")) != 0) { + String *parse = Getattr(p, "tmap:directorin:parse"); + if (!parse) { + Setattr(p, "emit:directorinput", "tmpv"); + Replaceall(tm, "$input", "tmpv"); + Replaceall(tm, "$owner", "0"); + Printv(wrap_args, tm, "\n", NIL); + Printf(wrap_args, "args.append(tmpv);\n"); + Putc('O', parse_args); + } else { + Append(parse_args, parse); + Setattr(p, "emit:directorinput", pname); + Replaceall(tm, "$input", pname); + Replaceall(tm, "$owner", "0"); + if (Len(tm) == 0) + Append(tm, pname); + } + p = Getattr(p, "tmap:directorin:next"); + continue; + } else if (Cmp(ptype, "void")) { + Swig_warning(WARN_TYPEMAP_DIRECTORIN_UNDEF, input_file, line_number, + "Unable to use type %s as a function argument in director method %s::%s (skipping method).\n", SwigType_str(ptype, 0), + SwigType_namestr(c_classname), SwigType_namestr(name)); + status = SWIG_NOWRAP; + break; + } + p = nextSibling(p); } String *method_name = Getattr(n, "sym:name"); @@ -1438,45 +1438,45 @@ public: // marshal return value if (!is_void) { - Printf(w->code, "if (out.length()<%d) {\n", outputs); - Printf(w->code, "Swig::DirectorTypeMismatchException::raise(\"Octave " - "method %s.%s failed to return the required number " "of arguments.\");\n", classname, method_name); - Printf(w->code, "}\n"); + Printf(w->code, "if (out.length()<%d) {\n", outputs); + Printf(w->code, "Swig::DirectorTypeMismatchException::raise(\"Octave " + "method %s.%s failed to return the required number " "of arguments.\");\n", classname, method_name); + Printf(w->code, "}\n"); - tm = Swig_typemap_lookup("directorout", n, Swig_cresult_name(), w); - if (tm != 0) { - char temp[24]; - sprintf(temp, "out(%d)", idx); - Replaceall(tm, "$input", temp); - // Replaceall(tm, "$argnum", temp); - Replaceall(tm, "$disown", Getattr(n, "wrap:disown") ? "SWIG_POINTER_DISOWN" : "0"); - if (Getattr(n, "tmap:directorout:implicitconv")) { - Replaceall(tm, "$implicitconv", get_implicitconv_flag(n)); - } - Replaceall(tm, "$result", "c_result"); - Printv(w->code, tm, "\n", NIL); - Delete(tm); - } else { - Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number, - "Unable to use return type %s in director method %s::%s (skipping method).\n", - SwigType_str(returntype, 0), SwigType_namestr(c_classname), SwigType_namestr(name)); - status = SWIG_ERROR; - } + tm = Swig_typemap_lookup("directorout", n, Swig_cresult_name(), w); + if (tm != 0) { + char temp[24]; + sprintf(temp, "out(%d)", idx); + Replaceall(tm, "$input", temp); + // Replaceall(tm, "$argnum", temp); + Replaceall(tm, "$disown", Getattr(n, "wrap:disown") ? "SWIG_POINTER_DISOWN" : "0"); + if (Getattr(n, "tmap:directorout:implicitconv")) { + Replaceall(tm, "$implicitconv", get_implicitconv_flag(n)); + } + Replaceall(tm, "$result", "c_result"); + Printv(w->code, tm, "\n", NIL); + Delete(tm); + } else { + Swig_warning(WARN_TYPEMAP_DIRECTOROUT_UNDEF, input_file, line_number, + "Unable to use return type %s in director method %s::%s (skipping method).\n", + SwigType_str(returntype, 0), SwigType_namestr(c_classname), SwigType_namestr(name)); + status = SWIG_ERROR; + } } idx++; // marshal outputs for (p = l; p;) { - if ((tm = Getattr(p, "tmap:directorargout")) != 0) { - char temp[24]; - sprintf(temp, "out(%d)", idx); - Replaceall(tm, "$result", temp); - Replaceall(tm, "$input", Getattr(p, "emit:directorinput")); - Printv(w->code, tm, "\n", NIL); - p = Getattr(p, "tmap:directorargout:next"); - } else { - p = nextSibling(p); - } + if ((tm = Getattr(p, "tmap:directorargout")) != 0) { + char temp[24]; + sprintf(temp, "out(%d)", idx); + Replaceall(tm, "$result", temp); + Replaceall(tm, "$input", Getattr(p, "emit:directorinput")); + Printv(w->code, tm, "\n", NIL); + p = Getattr(p, "tmap:directorargout:next"); + } else { + p = nextSibling(p); + } } Delete(parse_args); @@ -1486,13 +1486,13 @@ public: if (!is_void) { if (!(ignored_method && !pure_virtual)) { - String *rettype = SwigType_str(returntype, 0); - if (!SwigType_isreference(returntype)) { - Printf(w->code, "return (%s) c_result;\n", rettype); - } else { - Printf(w->code, "return (%s) *c_result;\n", rettype); - } - Delete(rettype); + String *rettype = SwigType_str(returntype, 0); + if (!SwigType_isreference(returntype)) { + Printf(w->code, "return (%s) c_result;\n", rettype); + } else { + Printf(w->code, "return (%s) *c_result;\n", rettype); + } + Delete(rettype); } } @@ -1506,7 +1506,7 @@ public: Replaceall(inline_extra_method, name, extra_method_name); Replaceall(inline_extra_method, ";\n", " {\n "); if (!is_void) - Printf(inline_extra_method, "return "); + Printf(inline_extra_method, "return "); String *methodcall = Swig_method_call(super, l); Printv(inline_extra_method, methodcall, ";\n }\n", NIL); Delete(methodcall); @@ -1515,10 +1515,10 @@ public: // emit the director method if (status == SWIG_OK) { if (!Getattr(n, "defaultargs")) { - Replaceall(w->code, "$symname", symname); - Wrapper_print(w, f_directors); - Printv(f_directors_h, declaration, NIL); - Printv(f_directors_h, inline_extra_method, NIL); + Replaceall(w->code, "$symname", symname); + Wrapper_print(w, f_directors); + Printv(f_directors_h, declaration, NIL); + Printv(f_directors_h, inline_extra_method, NIL); } } // clean up From b2d492c15a0240d8954d3702a87f90eb34fd49fb Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Mon, 26 May 2014 20:38:36 +0200 Subject: [PATCH 127/152] Octave: use common example.mk for examples, patterned after javascript --- Examples/octave/callback/Makefile | 18 ++-------------- Examples/octave/class/Makefile | 18 ++-------------- Examples/octave/constants/Makefile | 18 ++-------------- Examples/octave/contract/Makefile | 16 ++------------ Examples/octave/enum/Makefile | 18 ++-------------- Examples/octave/example.mk | 32 ++++++++++++++++++++++++++++ Examples/octave/extend/Makefile | 18 ++-------------- Examples/octave/funcptr/Makefile | 16 ++------------ Examples/octave/funcptr2/Makefile | 16 ++------------ Examples/octave/functor/Makefile | 18 ++-------------- Examples/octave/module_load/Makefile | 23 ++++++-------------- Examples/octave/operator/Makefile | 18 ++-------------- Examples/octave/pointer/Makefile | 16 ++------------ Examples/octave/reference/Makefile | 18 ++-------------- Examples/octave/simple/Makefile | 16 ++------------ Examples/octave/template/Makefile | 18 ++-------------- Examples/octave/variables/Makefile | 16 ++------------ 17 files changed, 68 insertions(+), 245 deletions(-) create mode 100644 Examples/octave/example.mk diff --git a/Examples/octave/callback/Makefile b/Examples/octave/callback/Makefile index 7855d0617..3b746de2f 100644 --- a/Examples/octave/callback/Makefile +++ b/Examples/octave/callback/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = example.cxx -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = example.cxx -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/class/Makefile b/Examples/octave/class/Makefile index 7855d0617..3b746de2f 100644 --- a/Examples/octave/class/Makefile +++ b/Examples/octave/class/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = example.cxx -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = example.cxx -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/constants/Makefile b/Examples/octave/constants/Makefile index eb05d1e7e..acf4d0575 100644 --- a/Examples/octave/constants/Makefile +++ b/Examples/octave/constants/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/contract/Makefile b/Examples/octave/contract/Makefile index 2e0e82124..413b64bbd 100644 --- a/Examples/octave/contract/Makefile +++ b/Examples/octave/contract/Makefile @@ -1,15 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -SRCS = example.c -TARGET = swigexample -INTERFACE = example.i +SRCS = example.c -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/enum/Makefile b/Examples/octave/enum/Makefile index 7855d0617..3b746de2f 100644 --- a/Examples/octave/enum/Makefile +++ b/Examples/octave/enum/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = example.cxx -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = example.cxx -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/example.mk b/Examples/octave/example.mk new file mode 100644 index 000000000..e0b1e4efb --- /dev/null +++ b/Examples/octave/example.mk @@ -0,0 +1,32 @@ +# Note: as a convention an example must be in a child directory of this. +# These paths are relative to such an example directory + +TOP = ../.. +SWIG = $(TOP)/../preinst-swig +TARGET = swigexample +INTERFACE = example.i + +check: build + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run + +build: +ifneq (,$(SRCS)) + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ + SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave +else + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp +endif +ifneq (,$(TARGET2)$(SWIGOPT2)) +ifneq (,$(SRCS)) + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ + SWIGOPT='$(SWIGOPT2)' TARGET='$(TARGET2)' INTERFACE='$(INTERFACE)' octave +else + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + SWIGOPT='$(SWIGOPT2)' TARGET='$(TARGET2)' INTERFACE='$(INTERFACE)' octave_cpp +endif +endif + + +clean: + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean diff --git a/Examples/octave/extend/Makefile b/Examples/octave/extend/Makefile index 7855d0617..3b746de2f 100644 --- a/Examples/octave/extend/Makefile +++ b/Examples/octave/extend/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = example.cxx -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = example.cxx -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/funcptr/Makefile b/Examples/octave/funcptr/Makefile index 2e0e82124..413b64bbd 100644 --- a/Examples/octave/funcptr/Makefile +++ b/Examples/octave/funcptr/Makefile @@ -1,15 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -SRCS = example.c -TARGET = swigexample -INTERFACE = example.i +SRCS = example.c -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/funcptr2/Makefile b/Examples/octave/funcptr2/Makefile index 2e0e82124..413b64bbd 100644 --- a/Examples/octave/funcptr2/Makefile +++ b/Examples/octave/funcptr2/Makefile @@ -1,15 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -SRCS = example.c -TARGET = swigexample -INTERFACE = example.i +SRCS = example.c -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/functor/Makefile b/Examples/octave/functor/Makefile index 0fbc7586b..acf4d0575 100644 --- a/Examples/octave/functor/Makefile +++ b/Examples/octave/functor/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/module_load/Makefile b/Examples/octave/module_load/Makefile index 7b24a8530..d2cd66e70 100644 --- a/Examples/octave/module_load/Makefile +++ b/Examples/octave/module_load/Makefile @@ -1,18 +1,7 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -SRCS = example.c -TARGET = swigexample -INTERFACE = example.i +SRCS = example.c +TARGET = swigexample +SWIGOPT = -module swigexample +TARGET2 = swigexample2 +SWIGOPT2 = -module swigexample2 -globals . -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)' SWIGOPT='-module $$(TARGET)' INTERFACE='$(INTERFACE)' octave - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)2' SWIGOPT='-module $$(TARGET) -globals .' INTERFACE='$(INTERFACE)' octave - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean - rm -f $(TARGET).m +include $(SRCDIR)../example.mk diff --git a/Examples/octave/operator/Makefile b/Examples/octave/operator/Makefile index 0fbc7586b..acf4d0575 100644 --- a/Examples/octave/operator/Makefile +++ b/Examples/octave/operator/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/pointer/Makefile b/Examples/octave/pointer/Makefile index 2e0e82124..413b64bbd 100644 --- a/Examples/octave/pointer/Makefile +++ b/Examples/octave/pointer/Makefile @@ -1,15 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -SRCS = example.c -TARGET = swigexample -INTERFACE = example.i +SRCS = example.c -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/reference/Makefile b/Examples/octave/reference/Makefile index 7855d0617..3b746de2f 100644 --- a/Examples/octave/reference/Makefile +++ b/Examples/octave/reference/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = example.cxx -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = example.cxx -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/simple/Makefile b/Examples/octave/simple/Makefile index 2e0e82124..413b64bbd 100644 --- a/Examples/octave/simple/Makefile +++ b/Examples/octave/simple/Makefile @@ -1,15 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -SRCS = example.c -TARGET = swigexample -INTERFACE = example.i +SRCS = example.c -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/template/Makefile b/Examples/octave/template/Makefile index 0fbc7586b..acf4d0575 100644 --- a/Examples/octave/template/Makefile +++ b/Examples/octave/template/Makefile @@ -1,17 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -CXXSRCS = -TARGET = swigexample -INTERFACE = example.i -LIBS = -lm -SWIGOPT = +CXXSRCS = -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ - SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk diff --git a/Examples/octave/variables/Makefile b/Examples/octave/variables/Makefile index 2e0e82124..413b64bbd 100644 --- a/Examples/octave/variables/Makefile +++ b/Examples/octave/variables/Makefile @@ -1,15 +1,3 @@ -TOP = ../.. -SWIG = $(TOP)/../preinst-swig -SRCS = example.c -TARGET = swigexample -INTERFACE = example.i +SRCS = example.c -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_run - -build: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \ - TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' octave_clean +include $(SRCDIR)../example.mk From ecf28da5a9c66904e57995cbd6cae35321ccece4 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Thu, 29 May 2014 23:42:22 +0200 Subject: [PATCH 128/152] Octave: remove deprecated -global/-noglobal command-line arguments --- CHANGES.current | 4 ++++ Source/Modules/octave.cxx | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 8d715e730..8e106f4b1 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,3 +5,7 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.2 (in progress) =========================== +2014-04-24: kwwette + [Octave] Remove deprecated -global/-noglobal command-line arguments + + *** POTENTIAL INCOMPATIBILITY *** diff --git a/Source/Modules/octave.cxx b/Source/Modules/octave.cxx index 1c8b639bb..12903166c 100644 --- a/Source/Modules/octave.cxx +++ b/Source/Modules/octave.cxx @@ -94,13 +94,6 @@ public: if (argv[i]) { if (strcmp(argv[i], "-help") == 0) { fputs(usage, stdout); - } else if (strcmp(argv[i], "-global") == 0 || - strcmp(argv[i], "-noglobal") == 0) { - Printv(stderr, - "*** -global/-noglobal are no longer supported\n" - "*** global load behaviour is now determined at module load\n" - "*** see the Perl section in the manual for details.\n", NIL); - SWIG_exit(EXIT_FAILURE); } else if (strcmp(argv[i], "-globals") == 0) { if (argv[i + 1]) { global_name = NewString(argv[i + 1]); From 84e1b553c4544d1c9a847c993931c412748c8b51 Mon Sep 17 00:00:00 2001 From: Vladimir Kalinin Date: Sat, 31 May 2014 07:59:39 +0400 Subject: [PATCH 129/152] test fixed --- Examples/test-suite/nested_extend_c.i | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples/test-suite/nested_extend_c.i b/Examples/test-suite/nested_extend_c.i index fb3c053c4..64727b9ea 100644 --- a/Examples/test-suite/nested_extend_c.i +++ b/Examples/test-suite/nested_extend_c.i @@ -10,7 +10,7 @@ char hi_extend() { return $self->c; } - static const long swig_size = sizeof(hiA); + static const long swig_size = sizeof(union hiA); } %extend lowA { lowA() { @@ -22,7 +22,7 @@ int low_extend() { return $self->num; } - static const long swig_size = sizeof(lowA); + static const long swig_size = sizeof(struct lowA); } %extend hiB { @@ -34,7 +34,7 @@ char hi_extend() { return $self->c; } - static const long swig_size = sizeof(hiB); + static const long swig_size = sizeof(union hiB); } %extend lowB { lowB() { @@ -46,7 +46,7 @@ int low_extend() { return $self->num; } - static const long swig_size = sizeof(lowB); + static const long swig_size = sizeof(struct lowB); } %extend FOO_bar { @@ -55,7 +55,7 @@ } }; %extend NestedA { - static const long swig_size = sizeof(NestedA); + static const long swig_size = sizeof(struct NestedA); } #endif From 22be94d2070376237a2099788786b0cf7f8ab521 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 31 May 2014 19:58:42 +0100 Subject: [PATCH 130/152] Fix std::vector compile problems on OSX for Javascript --- Lib/javascript/jsc/std_vector.i | 2 +- Lib/javascript/v8/std_vector.i | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/javascript/jsc/std_vector.i b/Lib/javascript/jsc/std_vector.i index 3f29b19c7..971b426a1 100644 --- a/Lib/javascript/jsc/std_vector.i +++ b/Lib/javascript/jsc/std_vector.i @@ -61,7 +61,7 @@ namespace std { %rename(add) push_back; void push_back(const value_type& x); %extend { - const_reference get(int i) throw (std::out_of_range) { + bool get(int i) throw (std::out_of_range) { int size = int(self->size()); if (i>=0 && isize()); if (i>=0 && i Date: Sun, 1 Jun 2014 15:29:47 +0200 Subject: [PATCH 131/152] Fix bug in DohNewStringWithSize(): guarantee string is nul-terminated --- Source/DOH/string.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/DOH/string.c b/Source/DOH/string.c index 50676c7c3..3e02e05d1 100644 --- a/Source/DOH/string.c +++ b/Source/DOH/string.c @@ -1114,6 +1114,7 @@ DOHString *DohNewStringWithSize(const DOHString_or_char *so, int len) { str->maxsize = max; if (s) { strncpy(str->str, s, len); + str->str[l] = 0; str->len = l; str->sp = l; } else { From 5f3ee109c8dd49fe7c6021c595a4afd648a129e6 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 2 Jun 2014 07:09:35 +0100 Subject: [PATCH 132/152] Add runtime test for %extend and nested union --- Examples/test-suite/java/nested_extend_c_runme.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Examples/test-suite/java/nested_extend_c_runme.java b/Examples/test-suite/java/nested_extend_c_runme.java index 9da093a09..5d9d861da 100644 --- a/Examples/test-suite/java/nested_extend_c_runme.java +++ b/Examples/test-suite/java/nested_extend_c_runme.java @@ -34,5 +34,12 @@ public class nested_extend_c_runme { if (low.low_extend() != 99) throw new RuntimeException("test failed"); } + { + FOO_bar foobar = new FOO_bar(); + foobar.setD(1234); + if (foobar.getD() != 1234) + throw new RuntimeException("test failed"); + foobar.bar_extend(); + } } } From 6d5444e58709a9d17a6f3a8bc47b80ce8ef28704 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 2 Jun 2014 07:23:14 +0100 Subject: [PATCH 133/152] CHANGES update --- CHANGES.current | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.current b/CHANGES.current index 8e106f4b1..73c028efd 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,7 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.2 (in progress) =========================== -2014-04-24: kwwette +2014-06-02: vkalinin + Fix #183 - %extend and unnamed nested structs + +2014-05-24: kwwette [Octave] Remove deprecated -global/-noglobal command-line arguments *** POTENTIAL INCOMPATIBILITY *** From acd0ebc6605d42cfb931fe46a0aaab06e29fb847 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 2 Jun 2014 07:36:00 +0100 Subject: [PATCH 134/152] changes file updates --- CHANGES.current | 10 ++++++++++ README | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES.current b/CHANGES.current index 73c028efd..74730a89f 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,9 +5,19 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.2 (in progress) =========================== +2014-06-02: v-for-vandal + [Lua] Pull request #176: + If class has no __eq implemented, then default __eq is generated. + Default __eq compares actual pointers stored inside Lua userdata. + + 2014-06-02: vkalinin Fix #183 - %extend and unnamed nested structs +2014-05-28: kwwette + Fix install failure when using an 'out of source' build using the shipped + tarball - regression introduced in swig-3.0.1. + 2014-05-24: kwwette [Octave] Remove deprecated -global/-noglobal command-line arguments diff --git a/README b/README index e4010bd80..6cc847553 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ SWIG (Simplified Wrapper and Interface Generator) -Version: 3.0.2 (27 May 2014) +Version: 3.0.2 (in progress) Tagline: SWIG is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua, From 37c09b01040d55eb9936a214c031e032c7bf80eb Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 4 Jun 2014 08:48:04 +0100 Subject: [PATCH 135/152] Add 3.0.2 release date --- ANNOUNCE | 2 +- CHANGES.current | 3 +-- Doc/Manual/Sections.html | 2 +- README | 2 +- RELEASENOTES | 3 +++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index fc1160007..58de2fe10 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -*** ANNOUNCE: SWIG 3.0.2 (in progress) *** +*** ANNOUNCE: SWIG 3.0.2 (4 Jun 2014) *** http://www.swig.org diff --git a/CHANGES.current b/CHANGES.current index 74730a89f..bb8bbdc41 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -2,7 +2,7 @@ Below are the changes for the current release. See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. -Version 3.0.2 (in progress) +Version 3.0.2 (4 Jun 2014) =========================== 2014-06-02: v-for-vandal @@ -10,7 +10,6 @@ Version 3.0.2 (in progress) If class has no __eq implemented, then default __eq is generated. Default __eq compares actual pointers stored inside Lua userdata. - 2014-06-02: vkalinin Fix #183 - %extend and unnamed nested structs diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html index 33d76c239..bcae8139d 100644 --- a/Doc/Manual/Sections.html +++ b/Doc/Manual/Sections.html @@ -6,7 +6,7 @@

      SWIG-3.0 Documentation

      -Last update : SWIG-3.0.2 (in progress) +Last update : SWIG-3.0.2 (4 Jun 2014)

      Sections

      diff --git a/README b/README index 6cc847553..746bad7e1 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ SWIG (Simplified Wrapper and Interface Generator) -Version: 3.0.2 (in progress) +Version: 3.0.2 (4 Jun 2014) Tagline: SWIG is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua, diff --git a/RELEASENOTES b/RELEASENOTES index 542ff4b10..38fbe60e7 100644 --- a/RELEASENOTES +++ b/RELEASENOTES @@ -4,6 +4,9 @@ and CHANGES files. Release Notes ============= +SWIG-3.0.2 summary: +- Bug fix during install and a couple of other minor changes. + SWIG-3.0.1 summary: - Javascript module added. This supports JavascriptCore (Safari/Webkit), v8 (Chromium) and node.js currently. From 1949e2cc63abc3d8a361f37d2083774badd04bff Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 4 Jun 2014 12:21:09 +0100 Subject: [PATCH 136/152] Fix equality testcase --- Examples/test-suite/equality.i | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Examples/test-suite/equality.i b/Examples/test-suite/equality.i index a1b70c299..cdabc4892 100644 --- a/Examples/test-suite/equality.i +++ b/Examples/test-suite/equality.i @@ -6,6 +6,8 @@ %module equality +%warnfilter(SWIGWARN_LANG_IDENTIFIER) operator==; + %inline %{ /* Point has no equality operator */ @@ -40,7 +42,7 @@ public: inline static const EqualOpWrong* GetStaticObject(); }; -static const EqualOpWrong s_wrongEqOp; +static EqualOpWrong s_wrongEqOp; const EqualOpWrong* EqualOpWrong::GetStaticObject() { return &s_wrongEqOp; } From ef4cb2f57465025203961a484fd8f7a0a8c9faa7 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 4 Jun 2014 13:00:18 +0100 Subject: [PATCH 137/152] Fix example clean target in makefile for operating systems that don't use .so as shared library extension --- Examples/Makefile.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 521df3a70..50b7ead03 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -204,7 +204,7 @@ tcl_version: tcl_clean: rm -f *_wrap* *~ .~* mytclsh@EXEEXT@ rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@SO@ + rm -f *.@OBJEXT@ *$(TCL_SO) ################################################################## ##### PERL 5 ###### @@ -399,7 +399,7 @@ python_clean: rm -rf __pycache__ rm -f *_wrap* *~ .~* mypython@EXEEXT@ *.pyc rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@SO@ *@PYTHON_SO@ + rm -f *.@OBJEXT@ *@SO@ *$(PYTHON_SO) rm -f $(TARGET).py if test -f $(SRCDIR)$(RUNME).py; then rm -f $(RUNME)3.py $(RUNME)3.py.bak; fi case "x$(SRCDIR)" in x|x./);; *) rm -f $(RUNME).py;; esac @@ -461,7 +461,7 @@ octave_clean: rm -rf __pycache__ rm -f *_wrap* *~ .~* myoctave@EXEEXT@ *.pyc rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@SO@ *@OCTAVE_SO@ + rm -f *.@OBJEXT@ *@SO@ *$(OCTAVE_SO) ################################################################## ##### GUILE ###### @@ -551,7 +551,7 @@ guile_version: guile_clean: rm -f *_wrap* *~ .~* my-guile@EXEEXT@ $(TARGET)@EXEEXT@ rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@GUILE_SO@ + rm -f *.@OBJEXT@ *$(GUILE_SO) ################################################################## ##### JAVA ###### @@ -874,7 +874,7 @@ mzscheme_version: mzscheme_clean: rm -f *_wrap* *~ .~* rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@SO@ + rm -f *.@OBJEXT@ *$(MZSCHEME_SO) ################################################################## ##### Ocaml ##### @@ -1097,7 +1097,7 @@ ruby_version: ruby_clean: rm -f *_wrap* *~ .~* myruby@EXEEXT@ *.pm rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@SO@ + rm -f *.@OBJEXT@ *$(RUBY_SO) ################################################################## ##### PHP ###### @@ -1147,7 +1147,7 @@ php_version: php_clean: rm -f *_wrap* *~ .~* example.php php_example.h rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@SO@ + rm -f *.@OBJEXT@ *$(PHP_SO) ################################################################## ##### Pike ###### @@ -1480,7 +1480,7 @@ lua_version: lua_clean: rm -f *_wrap* *~ .~* mylua@EXEEXT@ rm -f core @EXTRA_CLEAN@ - rm -f *.@OBJEXT@ *@SO@ + rm -f *.@OBJEXT@ *$(LUA_SO) ################################################################## ##### ALLEGRO CL ###### From e0c432f70d38bdcc5828ed1c97e03a4475d42823 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Thu, 5 Jun 2014 16:51:23 +0200 Subject: [PATCH 138/152] Use 4 spaces in emitFunctionShadowHelper for python --- Source/Modules/python.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 06c1c4868..95dcbe09e 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -2029,15 +2029,15 @@ public: /* Make a wrapper function to insert the code into */ Printv(f_dest, "\ndef ", name, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) - Printv(f_dest, " ", docstring(n, AUTODOC_FUNC, tab4), "\n", NIL); + Printv(f_dest, tab4, docstring(n, AUTODOC_FUNC, tab4), "\n", NIL); if (have_pythonprepend(n)) - Printv(f_dest, pythoncode(pythonprepend(n), " "), "\n", NIL); + Printv(f_dest, pythoncode(pythonprepend(n), tab4), "\n", NIL); if (have_pythonappend(n)) { - Printv(f_dest, " val = ", funcCall(name, callParms), "\n", NIL); - Printv(f_dest, pythoncode(pythonappend(n), " "), "\n", NIL); - Printv(f_dest, " return val\n", NIL); + Printv(f_dest, tab4 "val = ", funcCall(name, callParms), "\n", NIL); + Printv(f_dest, pythoncode(pythonappend(n), tab4), "\n", NIL); + Printv(f_dest, tab4 "return val\n", NIL); } else { - Printv(f_dest, " return ", funcCall(name, callParms), "\n", NIL); + Printv(f_dest, tab4 "return ", funcCall(name, callParms), "\n", NIL); } if (Getattr(n, "feature:python:callback") || !have_addtofunc(n)) { From 0d589349a19aded355e2e1489e63c5b6ee126da5 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 6 Jun 2014 11:03:46 +0200 Subject: [PATCH 139/152] Fixed pep8 issues E701, E203, E231, E261 --- Lib/python/pyiterators.swg | 3 +- Source/Modules/python.cxx | 67 +++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Lib/python/pyiterators.swg b/Lib/python/pyiterators.swg index f93594c4c..110c431fe 100644 --- a/Lib/python/pyiterators.swg +++ b/Lib/python/pyiterators.swg @@ -344,7 +344,8 @@ namespace swig %feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__; #else %extend SwigPyIterator { - %pythoncode {def __iter__(self): return self} + %pythoncode {def __iter__(self): + return self} } #endif diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 95dcbe09e..bd3cc0779 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -807,7 +807,7 @@ public: Printv(f_shadow, "\nfrom sys import version_info\n", NULL); if (!builtin && fastproxy) { - Printv(f_shadow, "if version_info >= (3,0,0):\n", NULL); + Printv(f_shadow, "if version_info >= (3, 0, 0):\n", NULL); Printf(f_shadow, tab4 "new_instancemethod = lambda func, inst, cls: %s.SWIG_PyInstanceMethod_New(func)\n", module); Printv(f_shadow, "else:\n", NULL); Printv(f_shadow, tab4, "from new import instancemethod as new_instancemethod\n", NULL); @@ -822,7 +822,7 @@ public: * isn't available in python 2.4 or earlier, so we have to write some * code conditional on the python version. */ - Printv(f_shadow, "if version_info >= (2,6,0):\n", NULL); + Printv(f_shadow, "if version_info >= (2, 6, 0):\n", NULL); Printv(f_shadow, tab4, "def swig_import_helper():\n", NULL); Printv(f_shadow, tab8, "from os.path import dirname\n", NULL); Printv(f_shadow, tab8, "import imp\n", NULL); @@ -852,20 +852,20 @@ public: Printf(f_shadow, "from %s import *\n", module); } if (modern || !classic) { - Printv(f_shadow, "try:\n", tab4, "_swig_property = property\n", "except NameError:\n", tab4, "pass # Python < 2.2 doesn't have 'property'.\n", NULL); + Printv(f_shadow, "try:\n", tab4, "_swig_property = property\n", "except NameError:\n", tab4, "pass # Python < 2.2 doesn't have 'property'.\n", NULL); } /* if (!modern) */ /* always needed, a class can be forced to be no-modern, such as an exception */ { // Python-2.2 object hack Printv(f_shadow, - "def _swig_setattr_nondynamic(self,class_type,name,value,static=1):\n", - tab4, "if (name == \"thisown\"): return self.this.own(value)\n", + "def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n", + tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own(value)\n", tab4, "if (name == \"this\"):\n", tab4, tab4, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n", #ifdef USE_THISOWN tab4, tab8, "if hasattr(value,\"thisown\"): self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n", #endif - tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name,None)\n", tab4, "if method: return method(self,value)\n", + tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name, None)\n", tab4, "if method:\n", tab4, tab4, "return method(self, value)\n", #ifdef USE_THISOWN tab4, "if (not static) or (name == \"thisown\"):\n", #else @@ -874,18 +874,18 @@ public: tab4, tab4, "self.__dict__[name] = value\n", tab4, "else:\n", tab4, tab4, "raise AttributeError(\"You cannot add attributes to %s\" % self)\n\n", - "def _swig_setattr(self,class_type,name,value):\n", tab4, "return _swig_setattr_nondynamic(self,class_type,name,value,0)\n\n", NIL); + "def _swig_setattr(self, class_type, name, value):\n", tab4, "return _swig_setattr_nondynamic(self, class_type, name, value, 0)\n\n", NIL); Printv(f_shadow, - "def _swig_getattr(self,class_type,name):\n", - tab4, "if (name == \"thisown\"): return self.this.own()\n", - tab4, "method = class_type.__swig_getmethods__.get(name,None)\n", - tab4, "if method: return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL); + "def _swig_getattr(self, class_type, name):\n", + tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own()\n", + tab4, "method = class_type.__swig_getmethods__.get(name, None)\n", + tab4, "if method:\n", tab4, tab4, "return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL); Printv(f_shadow, "def _swig_repr(self):\n", - tab4, "try: strthis = \"proxy of \" + self.this.__repr__()\n", - tab4, "except: strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL); + tab4, "try:\n", tab4, tab4, "strthis = \"proxy of \" + self.this.__repr__()\n", + tab4, "except:\n", tab4, tab4, "strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL); if (!classic) { /* Usage of types.ObjectType is deprecated. @@ -895,19 +895,19 @@ public: // "import types\n", "try:\n", // " _object = types.ObjectType\n", - " _object = object\n", " _newclass = 1\n", "except AttributeError:\n", " class _object : pass\n", " _newclass = 0\n", + tab4, "_object = object\n", tab4, "_newclass = 1\n", "except AttributeError:\n", tab4, "class _object:\n", tab4, tab4, "pass\n", tab4, "_newclass = 0\n", // "del types\n", "\n\n", NIL); } } if (modern) { - Printv(f_shadow, "def _swig_setattr_nondynamic_method(set):\n", tab4, "def set_attr(self,name,value):\n", + Printv(f_shadow, "def _swig_setattr_nondynamic_method(set):\n", tab4, "def set_attr(self, name, value):\n", #ifdef USE_THISOWN - tab4, tab4, "if hasattr(self,name) or (name in (\"this\", \"thisown\")):\n", + tab4, tab4, "if hasattr(self, name) or (name in (\"this\", \"thisown\")):\n", #else - tab4, tab4, "if (name == \"thisown\"): return self.this.own(value)\n", tab4, tab4, "if hasattr(self,name) or (name == \"this\"):\n", + tab4, tab4, "if (name == \"thisown\"): return self.this.own(value)\n", tab4, tab4, "if hasattr(self, name) or (name == \"this\"):\n", #endif - tab4, tab4, tab4, "set(self,name,value)\n", + tab4, tab4, tab4, "set(self, name, value)\n", tab4, tab4, "else:\n", tab4, tab4, tab4, "raise AttributeError(\"You cannot add attributes to %s\" % self)\n", tab4, "return set_attr\n\n\n", NIL); } @@ -2154,7 +2154,7 @@ public: Append(f->code, "--argc;\n"); } - Replaceall(dispatch, "$args", "self,args"); + Replaceall(dispatch, "$args", "self, args"); Printv(f->code, dispatch, "\n", NIL); @@ -3957,7 +3957,7 @@ public: if (!modern) { Printv(f_shadow, tab4, "__swig_setmethods__ = {}\n", NIL); if (Len(base_class)) { - Printf(f_shadow, "%sfor _s in [%s]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))\n", tab4, base_class); + Printv(f_shadow, tab4, "for _s in [", base_class, "]:\n", tab8, "__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))\n", NIL); } if (!GetFlag(n, "feature:python:nondynamic")) { @@ -3968,7 +3968,7 @@ public: Printv(f_shadow, tab4, "__swig_getmethods__ = {}\n", NIL); if (Len(base_class)) { - Printf(f_shadow, "%sfor _s in [%s]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))\n", tab4, base_class); + Printv(f_shadow, tab4, "for _s in [", base_class, "]:\n", tab8, "__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))\n", NIL); } Printv(f_shadow, tab4, "__getattr__ = lambda self, name: _swig_getattr(self, ", class_name, ", name)\n", NIL); @@ -4056,7 +4056,7 @@ public: Delete(realct); if (!have_constructor) { if (!builtin) - Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs): raise AttributeError(\"", "No constructor defined", + Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs):\n", tab8, "raise AttributeError(\"", "No constructor defined", (Getattr(n, "abstracts") ? " - class is abstract" : ""), "\")\n", NIL); } else if (fastinit && !builtin) { @@ -4094,12 +4094,12 @@ public: Printv(f_shadow_file, "\nclass ", class_name, "Ptr(", class_name, "):\n", tab4, "def __init__(self, this):\n", NIL); if (!modern) { Printv(f_shadow_file, - tab8, "try: self.this.append(this)\n", - tab8, "except: self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL); + tab8, "try:\n", tab8, tab4, "self.this.append(this)\n", + tab8, "except:\n", tab8, tab4, "self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL); } else { Printv(f_shadow_file, - tab8, "try: self.this.append(this)\n", - tab8, "except: self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL); + tab8, "try:\n", tab8, tab4, "self.this.append(this)\n", + tab8, "except:\n", tab8, tab4, "self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL); } } @@ -4223,12 +4223,11 @@ public: String *callParms = make_pyParmList(n, true, true, allow_kwargs); if (!have_addtofunc(n)) { if (!fastproxy || olddefs) { - Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":", NIL); - Printv(f_shadow, " return ", funcCall(fullname, callParms), "\n", NIL); + Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); + Printv(f_shadow, tab8, "return ", funcCall(fullname, callParms), "\n", NIL); } } else { - Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":", NIL); - Printv(f_shadow, "\n", NIL); + Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL); if (have_pythonprepend(n)) { @@ -4427,7 +4426,7 @@ public: Printv(pass_self, tab8, tab4, "_self = None\n", tab8, "else:\n", tab8, tab4, "_self = self\n", NIL); } - Printv(f_shadow, tab4, "def __init__(", parms, ")", returnTypeAnnotation(n), ": \n", NIL); + Printv(f_shadow, tab4, "def __init__(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_CTOR, tab8), "\n", NIL); if (have_pythonprepend(n)) @@ -4438,7 +4437,7 @@ public: } else { Printv(f_shadow, tab8, "this = ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), "\n", - tab8, "try: self.this.append(this)\n", tab8, "except: self.this = this\n", NIL); + tab8, "try:\n", tab8, tab4, "self.this.append(this)\n", tab8, "except:\n", tab8, tab4, "self.this = this\n", NIL); } if (have_pythonappend(n)) Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n\n", NIL); @@ -4524,7 +4523,7 @@ public: Printv(f_shadow, tab4, "__swig_destroy__ = ", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "\n", NIL); if (!have_pythonprepend(n) && !have_pythonappend(n)) { if (proxydel) { - Printv(f_shadow, tab4, "__del__ = lambda self : None;\n", NIL); + Printv(f_shadow, tab4, "__del__ = lambda self: None\n", NIL); } return SWIG_OK; } @@ -4535,7 +4534,7 @@ public: Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL); #ifdef USE_THISOWN Printv(f_shadow, tab8, "try:\n", NIL); - Printv(f_shadow, tab8, tab4, "if self.thisown: ", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "(self)\n", NIL); + Printv(f_shadow, tab8, tab4, "if self.thisown:", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "(self)\n", NIL); Printv(f_shadow, tab8, "except: pass\n", NIL); #else #endif From 01a99464550b8d5747c6cef4aae9b694c9b202fa Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 6 Jun 2014 11:28:00 +0200 Subject: [PATCH 140/152] Fixed some pep8 issues E302 --- Source/Modules/python.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index bd3cc0779..0ee9570dc 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -852,14 +852,14 @@ public: Printf(f_shadow, "from %s import *\n", module); } if (modern || !classic) { - Printv(f_shadow, "try:\n", tab4, "_swig_property = property\n", "except NameError:\n", tab4, "pass # Python < 2.2 doesn't have 'property'.\n", NULL); + Printv(f_shadow, "try:\n", tab4, "_swig_property = property\n", "except NameError:\n", tab4, "pass # Python < 2.2 doesn't have 'property'.\n\n", NULL); } /* if (!modern) */ /* always needed, a class can be forced to be no-modern, such as an exception */ { // Python-2.2 object hack Printv(f_shadow, - "def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n", + "\n", "def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n", tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own(value)\n", tab4, "if (name == \"this\"):\n", tab4, tab4, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n", #ifdef USE_THISOWN @@ -874,16 +874,16 @@ public: tab4, tab4, "self.__dict__[name] = value\n", tab4, "else:\n", tab4, tab4, "raise AttributeError(\"You cannot add attributes to %s\" % self)\n\n", - "def _swig_setattr(self, class_type, name, value):\n", tab4, "return _swig_setattr_nondynamic(self, class_type, name, value, 0)\n\n", NIL); + "\n", "def _swig_setattr(self, class_type, name, value):\n", tab4, "return _swig_setattr_nondynamic(self, class_type, name, value, 0)\n\n", NIL); Printv(f_shadow, - "def _swig_getattr(self, class_type, name):\n", + "\n", "def _swig_getattr(self, class_type, name):\n", tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own()\n", tab4, "method = class_type.__swig_getmethods__.get(name, None)\n", tab4, "if method:\n", tab4, tab4, "return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL); Printv(f_shadow, - "def _swig_repr(self):\n", + "\n", "def _swig_repr(self):\n", tab4, "try:\n", tab4, tab4, "strthis = \"proxy of \" + self.this.__repr__()\n", tab4, "except:\n", tab4, tab4, "strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL); @@ -901,7 +901,7 @@ public: } } if (modern) { - Printv(f_shadow, "def _swig_setattr_nondynamic_method(set):\n", tab4, "def set_attr(self, name, value):\n", + Printv(f_shadow, "\n", "def _swig_setattr_nondynamic_method(set):\n", tab4, "def set_attr(self, name, value):\n", #ifdef USE_THISOWN tab4, tab4, "if hasattr(self, name) or (name in (\"this\", \"thisown\")):\n", #else @@ -4056,7 +4056,7 @@ public: Delete(realct); if (!have_constructor) { if (!builtin) - Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs):\n", tab8, "raise AttributeError(\"", "No constructor defined", + Printv(f_shadow_file, "\n", tab4, "def __init__(self, *args, **kwargs):\n", tab8, "raise AttributeError(\"", "No constructor defined", (Getattr(n, "abstracts") ? " - class is abstract" : ""), "\")\n", NIL); } else if (fastinit && !builtin) { @@ -4108,7 +4108,7 @@ public: List *shadow_list = Getattr(n, "shadow_methods"); for (int i = 0; i < Len(shadow_list); ++i) { String *symname = Getitem(shadow_list, i); - Printf(f_shadow_file, "%s.%s = new_instancemethod(%s.%s,None,%s)\n", class_name, symname, module, Swig_name_member(NSPACE_TODO, class_name, symname), + Printf(f_shadow_file, "%s.%s = new_instancemethod(%s.%s, None, %s)\n", class_name, symname, module, Swig_name_member(NSPACE_TODO, class_name, symname), class_name); } } @@ -4223,11 +4223,11 @@ public: String *callParms = make_pyParmList(n, true, true, allow_kwargs); if (!have_addtofunc(n)) { if (!fastproxy || olddefs) { - Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); + Printv(f_shadow, "\n", tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); Printv(f_shadow, tab8, "return ", funcCall(fullname, callParms), "\n", NIL); } } else { - Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); + Printv(f_shadow, "\n", tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL); if (have_pythonprepend(n)) { @@ -4313,7 +4313,7 @@ public: int kw = (check_kwargs(n) && !Getattr(n, "sym:overloaded")) ? 1 : 0; String *parms = make_pyParmList(n, false, false, kw); String *callParms = make_pyParmList(n, false, true, kw); - Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); + Printv(f_shadow, "\n", tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL); if (have_pythonprepend(n)) @@ -4426,7 +4426,7 @@ public: Printv(pass_self, tab8, tab4, "_self = None\n", tab8, "else:\n", tab8, tab4, "_self = self\n", NIL); } - Printv(f_shadow, tab4, "def __init__(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); + Printv(f_shadow, "\n", tab4, "def __init__(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_CTOR, tab8), "\n", NIL); if (have_pythonprepend(n)) From 36cac801660523b9f355f53f91cc0c658060155b Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 6 Jun 2014 14:27:17 +0200 Subject: [PATCH 141/152] Fixed some pep8 issues E701 --- Source/Modules/python.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 0ee9570dc..ab6cfd397 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -4325,7 +4325,7 @@ public: } else { Printv(f_shadow, tab8, "return ", funcCall(Swig_name_member(NSPACE_TODO, class_name, symname), callParms), "\n\n", NIL); } - Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = staticmethod(", symname, ")\n", NIL); + Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = staticmethod(", symname, ")\n", NIL); if (!modern) { Printv(f_shadow, tab4, "__swig_getmethods__[\"", symname, "\"] = lambda x: ", symname, "\n", NIL); @@ -4337,7 +4337,7 @@ public: NIL); } if (!classic) { - Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = staticmethod(", module, ".", Swig_name_member(NSPACE_TODO, class_name, symname), + Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = staticmethod(", module, ".", Swig_name_member(NSPACE_TODO, class_name, symname), ")\n", NIL); } } @@ -4573,9 +4573,9 @@ public: } if (!classic) { if (!assignable) { - Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ")\n", NIL); + Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ")\n", NIL); } else { - Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL); + Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL); } } Delete(mname); @@ -4646,9 +4646,9 @@ public: } if (!classic && !builtin) { if (!assignable) { - Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ")\n", NIL); + Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ")\n", NIL); } else { - Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL); + Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL); } } String *getter = Getattr(n, "pybuiltin:getter"); From 93e06c0e5867be8dec05e9ab58c2c9fcb2320b7c Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 6 Jun 2014 14:44:46 +0200 Subject: [PATCH 142/152] Fixed another E231 --- Source/Modules/python.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index ab6cfd397..0d38a19ed 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -3901,7 +3901,7 @@ public: Printv(base_class, bname, NIL); b = Next(b); if (b.item) { - Putc(',', base_class); + Printv(base_class, ", ", NIL); } } } @@ -3922,7 +3922,7 @@ public: String *abcs = Getattr(n, "feature:python:abc"); if (py3 && abcs) { if (Len(base_class)) { - Putc(',', base_class); + Printv(base_class, ", ", NIL); } Printv(base_class, abcs, NIL); } From f4fffbf668781f5308d1e944dc25238c93082b1c Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 6 Jun 2014 15:13:23 +0200 Subject: [PATCH 143/152] Fixed another E701 --- Lib/python/pycontainer.swg | 3 ++- Lib/python/std_map.i | 12 ++++++++---- Lib/python/std_unordered_map.i | 12 ++++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Lib/python/pycontainer.swg b/Lib/python/pycontainer.swg index dcada87c7..425cc45fc 100644 --- a/Lib/python/pycontainer.swg +++ b/Lib/python/pycontainer.swg @@ -710,7 +710,8 @@ namespace swig #if defined(SWIGPYTHON_BUILTIN) %feature("python:slot", "tp_iter", functype="getiterfunc") iterator; #else - %pythoncode {def __iter__(self): return self.iterator()} + %pythoncode {def __iter__(self): + return self.iterator()} #endif } diff --git a/Lib/python/std_map.i b/Lib/python/std_map.i index 66ed68da5..58902bca4 100644 --- a/Lib/python/std_map.i +++ b/Lib/python/std_map.i @@ -176,10 +176,14 @@ #else %extend { - %pythoncode {def __iter__(self): return self.key_iterator()} - %pythoncode {def iterkeys(self): return self.key_iterator()} - %pythoncode {def itervalues(self): return self.value_iterator()} - %pythoncode {def iteritems(self): return self.iterator()} + %pythoncode {def __iter__(self): + return self.key_iterator()} + %pythoncode {def iterkeys(self): + return self.key_iterator()} + %pythoncode {def itervalues(self): + return self.value_iterator()} + %pythoncode {def iteritems(self): + return self.iterator()} } #endif diff --git a/Lib/python/std_unordered_map.i b/Lib/python/std_unordered_map.i index b456035e2..737468234 100644 --- a/Lib/python/std_unordered_map.i +++ b/Lib/python/std_unordered_map.i @@ -231,10 +231,14 @@ return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); } - %pythoncode {def __iter__(self): return self.key_iterator()} - %pythoncode {def iterkeys(self): return self.key_iterator()} - %pythoncode {def itervalues(self): return self.value_iterator()} - %pythoncode {def iteritems(self): return self.iterator()} + %pythoncode {def __iter__(self): + return self.key_iterator()} + %pythoncode {def iterkeys(self): + return self.key_iterator()} + %pythoncode {def itervalues(self): + return self.value_iterator()} + %pythoncode {def iteritems(self): + return self.iterator()} } %enddef From fa36b6228e760e19928a9cccff71114ea46f932b Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 31 May 2014 14:35:10 -0600 Subject: [PATCH 144/152] Fix function naming conflict with class overloads. This fix takes into account the classname while generating overload handlers. Example: If you have two classes: class A { public: void doSomething(int); void doSomething(double); }; class B { public: void doSomething(int); void doSomething(double); }; Before this patch, the overload handlers for A::doSomething and B::doSomething create conflicting names and function redefinition errors are caused. After the patch, the overload handlers are named classname_doSomething and no longer conflict. This is might not the best way to implement this, but it solves a critical problem on large projects, and specifically can affect operator overloads that are being wrapped. --- Source/Modules/javascript.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx index 8b7a74037..0c3f02a75 100644 --- a/Source/Modules/javascript.cxx +++ b/Source/Modules/javascript.cxx @@ -1231,18 +1231,27 @@ int JSEmitter::emitFunctionDispatcher(Node *n, bool /*is_member */ ) { // substract the extension "sym:overname", String *wrap_name = NewString(Getattr(n, "wrap:name")); String *overname = Getattr(n, "sym:overname"); + + Node *methodclass = Swig_methodclass(n); + String *class_name = Getattr(methodclass, "sym:name"); + int l1 = Len(wrap_name); int l2 = Len(overname); Delslice(wrap_name, l1 - l2, l1); - Setattr(n, "wrap:name", wrap_name); - state.function(WRAPPER_NAME, wrap_name); + String *new_string = NewStringf("%s_%s", class_name, wrap_name); + String *final_wrap_name = Swig_name_wrapper(new_string); + + Setattr(n, "wrap:name", final_wrap_name); + state.function(WRAPPER_NAME, final_wrap_name); + + t_function.replace("$jslocals", wrapper->locals) .replace("$jscode", wrapper->code); // call this here, to replace all variables - t_function.replace("$jswrapper", wrap_name) + t_function.replace("$jswrapper", final_wrap_name) .replace("$jsname", state.function(NAME)) .pretty_print(f_wrappers); From 8728a97dc60417e4c5599349d06cd1c408f14a7d Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 6 Jun 2014 19:56:38 +0100 Subject: [PATCH 145/152] Bump version to 3.0.3 --- ANNOUNCE | 8 ++++---- CHANGES | 20 ++++++++++++++++++++ CHANGES.current | 18 +----------------- Doc/Manual/Sections.html | 2 +- README | 2 +- configure.ac | 2 +- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 58de2fe10..95261b2bd 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,8 +1,8 @@ -*** ANNOUNCE: SWIG 3.0.2 (4 Jun 2014) *** +*** ANNOUNCE: SWIG 3.0.3 (in progress) *** http://www.swig.org -We're pleased to announce SWIG-3.0.2, the latest SWIG release. +We're pleased to announce SWIG-3.0.3, the latest SWIG release. What is SWIG? ============= @@ -21,11 +21,11 @@ Availability ============ The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-3.0.2.tar.gz + http://prdownloads.sourceforge.net/swig/swig-3.0.3.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-3.0.2.zip + http://prdownloads.sourceforge.net/swig/swigwin-3.0.3.zip Please report problems with this release to the swig-devel mailing list, details at http://www.swig.org/mail.html. diff --git a/CHANGES b/CHANGES index 1cfedc31e..edcdbba3e 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,26 @@ SWIG (Simplified Wrapper and Interface Generator) See the CHANGES.current file for changes in the current version. See the RELEASENOTES file for a summary of changes in each release. +Version 3.0.2 (4 Jun 2014) +========================== + +2014-06-02: v-for-vandal + [Lua] Pull request #176: + If class has no __eq implemented, then default __eq is generated. + Default __eq compares actual pointers stored inside Lua userdata. + +2014-06-02: vkalinin + Fix #183 - %extend and unnamed nested structs + +2014-05-28: kwwette + Fix install failure when using an 'out of source' build using the shipped + tarball - regression introduced in swig-3.0.1. + +2014-05-24: kwwette + [Octave] Remove deprecated -global/-noglobal command-line arguments + + *** POTENTIAL INCOMPATIBILITY *** + Version 3.0.1 (27 May 2014) =========================== diff --git a/CHANGES.current b/CHANGES.current index bb8bbdc41..dce3757d7 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -2,22 +2,6 @@ Below are the changes for the current release. See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. -Version 3.0.2 (4 Jun 2014) +Version 3.0.3 (in progress) =========================== -2014-06-02: v-for-vandal - [Lua] Pull request #176: - If class has no __eq implemented, then default __eq is generated. - Default __eq compares actual pointers stored inside Lua userdata. - -2014-06-02: vkalinin - Fix #183 - %extend and unnamed nested structs - -2014-05-28: kwwette - Fix install failure when using an 'out of source' build using the shipped - tarball - regression introduced in swig-3.0.1. - -2014-05-24: kwwette - [Octave] Remove deprecated -global/-noglobal command-line arguments - - *** POTENTIAL INCOMPATIBILITY *** diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html index bcae8139d..0bda3e106 100644 --- a/Doc/Manual/Sections.html +++ b/Doc/Manual/Sections.html @@ -6,7 +6,7 @@

      SWIG-3.0 Documentation

      -Last update : SWIG-3.0.2 (4 Jun 2014) +Last update : SWIG-3.0.3 (in progress)

      Sections

      diff --git a/README b/README index 746bad7e1..7d0130b83 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ SWIG (Simplified Wrapper and Interface Generator) -Version: 3.0.2 (4 Jun 2014) +Version: 3.0.3 (in progress) Tagline: SWIG is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua, diff --git a/configure.ac b/configure.ac index 77b804ddd..993e0e28a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl The macros which aren't shipped with the autotools are stored in the dnl Tools/config directory in .m4 files. -AC_INIT([swig],[3.0.2],[http://www.swig.org]) +AC_INIT([swig],[3.0.3],[http://www.swig.org]) dnl NB: When this requirement is increased to 2.60 or later, AC_PROG_SED dnl definition below can be removed From 6fe71da9fa6ff525808a7076f96b0df2c522bef7 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Sat, 7 Jun 2014 13:09:15 +0200 Subject: [PATCH 146/152] Fixed remaining pep8 errors --- Lib/python/std_pair.i | 22 ++++++++++++---------- Source/Modules/python.cxx | 22 +++++++++++----------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Lib/python/std_pair.i b/Lib/python/std_pair.i index 782969574..73d47e198 100644 --- a/Lib/python/std_pair.i +++ b/Lib/python/std_pair.i @@ -176,18 +176,20 @@ SwigPython_std_pair_setitem (PyObject *a, Py_ssize_t b, PyObject *c) %define %swig_pair_methods(pair...) #if !defined(SWIGPYTHON_BUILTIN) %extend { -%pythoncode {def __len__(self): return 2 -def __repr__(self): return str((self.first, self.second)) +%pythoncode {def __len__(self): + return 2 +def __repr__(self): + return str((self.first, self.second)) def __getitem__(self, index): - if not (index % 2): - return self.first - else: - return self.second + if not (index % 2): + return self.first + else: + return self.second def __setitem__(self, index, val): - if not (index % 2): - self.first = val - else: - self.second = val} + if not (index % 2): + self.first = val + else: + self.second = val} } #endif %enddef diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 0d38a19ed..c327dbc1c 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -860,10 +860,10 @@ public: // Python-2.2 object hack Printv(f_shadow, "\n", "def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n", - tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own(value)\n", - tab4, "if (name == \"this\"):\n", tab4, tab4, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n", + tab4, "if (name == \"thisown\"):\n", tab8, "return self.this.own(value)\n", + tab4, "if (name == \"this\"):\n", tab8, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n", #ifdef USE_THISOWN - tab4, tab8, "if hasattr(value,\"thisown\"): self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n", + tab4, tab8, "if hasattr(value,\"thisown\"):\n", tab8, tab8, "self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n", #endif tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name, None)\n", tab4, "if method:\n", tab4, tab4, "return method(self, value)\n", #ifdef USE_THISOWN @@ -878,14 +878,14 @@ public: Printv(f_shadow, "\n", "def _swig_getattr(self, class_type, name):\n", - tab4, "if (name == \"thisown\"):\n", tab4, tab4, "return self.this.own()\n", + tab4, "if (name == \"thisown\"):\n", tab8, "return self.this.own()\n", tab4, "method = class_type.__swig_getmethods__.get(name, None)\n", - tab4, "if method:\n", tab4, tab4, "return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL); + tab4, "if method:\n", tab8, "return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL); Printv(f_shadow, "\n", "def _swig_repr(self):\n", - tab4, "try:\n", tab4, tab4, "strthis = \"proxy of \" + self.this.__repr__()\n", - tab4, "except:\n", tab4, tab4, "strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL); + tab4, "try:\n", tab8, "strthis = \"proxy of \" + self.this.__repr__()\n", + tab4, "except:\n", tab8, "strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL); if (!classic) { /* Usage of types.ObjectType is deprecated. @@ -895,7 +895,7 @@ public: // "import types\n", "try:\n", // " _object = types.ObjectType\n", - tab4, "_object = object\n", tab4, "_newclass = 1\n", "except AttributeError:\n", tab4, "class _object:\n", tab4, tab4, "pass\n", tab4, "_newclass = 0\n", + tab4, "_object = object\n", tab4, "_newclass = 1\n", "except AttributeError:\n", tab4, "class _object:\n", tab8, "pass\n", tab4, "_newclass = 0\n", // "del types\n", "\n\n", NIL); } @@ -905,7 +905,7 @@ public: #ifdef USE_THISOWN tab4, tab4, "if hasattr(self, name) or (name in (\"this\", \"thisown\")):\n", #else - tab4, tab4, "if (name == \"thisown\"): return self.this.own(value)\n", tab4, tab4, "if hasattr(self, name) or (name == \"this\"):\n", + tab4, tab4, "if (name == \"thisown\"):\n", tab8, tab4, "return self.this.own(value)\n", tab4, tab4, "if hasattr(self, name) or (name == \"this\"):\n", #endif tab4, tab4, tab4, "set(self, name, value)\n", tab4, tab4, "else:\n", @@ -1637,7 +1637,7 @@ public: } // Write the function annotation if (func_annotation) - Printf(doc, " : '%s'", type_str); + Printf(doc, ": '%s'", type_str); // Write default value if (value && !calling) { @@ -2012,7 +2012,7 @@ public: if (ret) ret = SwigType_str(ret, 0); } - return (ret && py3) ? NewStringf(" -> \"%s\" ", ret) + return (ret && py3) ? NewStringf(" -> \"%s\"", ret) : NewString(""); } From 7a4cef998c963bca49dd2403b024d6d69d87b80f Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Sat, 7 Jun 2014 13:10:27 +0200 Subject: [PATCH 147/152] Enable pep8 check --- .travis.yml | 1 + Examples/test-suite/python/Makefile.in | 9 +++++++++ Examples/test-suite/python_append.i | 22 +++++++++++----------- configure.ac | 2 +- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08731ca62..0db8730d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,6 +64,7 @@ before_install: - if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi - if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi - if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi + - if test "$SWIGLANG" = "python"; then sudo apt-get install -qq pep8; fi - if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 9673d7da1..1c35d2843 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -10,6 +10,7 @@ endif LANGUAGE = python PYTHON = $(PYBIN) +PEP8 = @PEP8@ #*_runme.py for Python 2.x, *_runme3.py for Python 3.x PY2SCRIPTSUFFIX = _runme.py @@ -111,12 +112,14 @@ VALGRIND_OPT += --suppressions=pythonswig.supp +$(convert_testcase) $(setup) +$(swig_and_compile_cpp) + $(check_pep8) $(run_testcase) %.ctest: +$(convert_testcase) $(setup) +$(swig_and_compile_c) + $(check_pep8) $(run_testcase) %.multicpptest: @@ -126,6 +129,7 @@ VALGRIND_OPT += --suppressions=pythonswig.supp $(run_testcase) + # Runs the testcase. A testcase is only run if # a file is found which has _runme.py (or _runme3.py for Python 3) appended after the testcase name. @@ -133,6 +137,11 @@ py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX) py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX) +check_pep8 = \ + if [ -n "$(PEP8)" ]; then \ + $(PEP8) --ignore=E501,E30,W291,W391 `echo $(py2_runme)|sed "s|_runme||g"`;\ + fi + run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(py_runme) run_testcase = \ diff --git a/Examples/test-suite/python_append.i b/Examples/test-suite/python_append.i index e263c392b..0ac54656f 100644 --- a/Examples/test-suite/python_append.i +++ b/Examples/test-suite/python_append.i @@ -5,22 +5,22 @@ Testcase to test %pythonprepend and %pythonappend %pythoncode %pythonbegin %module python_append %pythoncode %{ - mypath = os.path.dirname("/a/b/c/d.txt") - funcpath = None - staticfuncpath = None - def grabpath(): +mypath = os.path.dirname("/a/b/c/d.txt") +funcpath = None +staticfuncpath = None +def grabpath(): return funcpath - def grabstaticpath(): +def grabstaticpath(): return staticfuncpath %} %pythonappend Test::func %{ - funcpath = os.path.dirname(funcpath) +funcpath = os.path.dirname(funcpath) %} %pythonprepend Test::func %{ - global funcpath - funcpath = mypath +global funcpath +funcpath = mypath %} %pythonappend Test::static_func %{ @@ -29,9 +29,9 @@ pass %} %pythonprepend Test::static_func { - global staticfuncpath - staticfuncpath = mypath - pass +global staticfuncpath +staticfuncpath = mypath +pass } %pythonbegin %{ diff --git a/configure.ac b/configure.ac index 77b804ddd..2ec39600e 100644 --- a/configure.ac +++ b/configure.ac @@ -789,7 +789,7 @@ AC_SUBST(PY3INCLUDE) AC_SUBST(PY3LIB) AC_SUBST(PY3LINK) AC_SUBST(PYTHON3DYNAMICLINKING) - +AC_CHECK_PROGS(PEP8, pep8) #---------------------------------------------------------------- # Look for Perl5 From 48fcf61515f9b64e0629f9bab9945ea78c06769f Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Sat, 7 Jun 2014 14:33:38 +0200 Subject: [PATCH 148/152] Ubuntu's pep8 is too old, use 1.5.7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0db8730d8..6eee47cb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,7 @@ before_install: - if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi - if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi - if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi - - if test "$SWIGLANG" = "python"; then sudo apt-get install -qq pep8; fi + - if test "$SWIGLANG" = "python"; then pushd /tmp; git clone https://github.com/jcrocholl/pep8.git; pushd pep8; git checkout tags/1.5.7; python ./setup.py build; sudo python ./setup.py install; popd; popd; fi - if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi From b58caf6978126d56c8df56d6666c27f7428c13f7 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sun, 8 Jun 2014 22:04:55 +1200 Subject: [PATCH 149/152] Add more new PHP5.6 keywords --- Lib/php/phpkw.swg | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Lib/php/phpkw.swg b/Lib/php/phpkw.swg index 14f37d2ff..36e535f52 100644 --- a/Lib/php/phpkw.swg +++ b/Lib/php/phpkw.swg @@ -625,6 +625,28 @@ PHPBN2(MYSQLI_SERVER_PUBLIC_KEY); /* Added in PHP 5.6 */ PHPBN2(LDAP_ESCAPE_DN); PHPBN2(LDAP_ESCAPE_FILTER); +PHPBN2(OPENSSL_DEFAULT_STREAM_CIPHERS); +PHPBN2(STREAM_CRYPTO_METHOD_ANY_CLIENT); +PHPBN2(STREAM_CRYPTO_METHOD_ANY_SERVER); +PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT); +PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_0_SERVER); +PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT); +PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_1_SERVER); +PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT); +PHPBN2(STREAM_CRYPTO_METHOD_TLSv1_2_SERVER); +PHPBN2(PGSQL_CONNECT_ASYNC); +PHPBN2(PGSQL_CONNECTION_AUTH_OK); +PHPBN2(PGSQL_CONNECTION_AWAITING_RESPONSE); +PHPBN2(PGSQL_CONNECTION_MADE); +PHPBN2(PGSQL_CONNECTION_SETENV); +PHPBN2(PGSQL_CONNECTION_SSL_STARTUP); +PHPBN2(PGSQL_CONNECTION_STARTED); +PHPBN2(PGSQL_DML_ESCAPE); +PHPBN2(PGSQL_POLLING_ACTIVE); +PHPBN2(PGSQL_POLLING_FAILED); +PHPBN2(PGSQL_POLLING_OK); +PHPBN2(PGSQL_POLLING_READING); +PHPBN2(PGSQL_POLLING_WRITING); /* Class names reserved by PHP (case insensitive) */ PHPCN(directory); From 8a0a8529e5d2386b4f994c74445c005326b8ce7b Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Sun, 8 Jun 2014 15:43:02 +0200 Subject: [PATCH 150/152] Clone pep8 in source dir. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6eee47cb5..795a690ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,7 @@ before_install: - if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi - if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi - if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi - - if test "$SWIGLANG" = "python"; then pushd /tmp; git clone https://github.com/jcrocholl/pep8.git; pushd pep8; git checkout tags/1.5.7; python ./setup.py build; sudo python ./setup.py install; popd; popd; fi + - if test "$SWIGLANG" = "python"; git clone https://github.com/jcrocholl/pep8.git && pushd pep8 && git checkout tags/1.5.7 && python ./setup.py build && sudo python ./setup.py install && popd; fi - if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi From eb26847255679944f5126ced85c93f8978f474a7 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Sun, 8 Jun 2014 15:44:44 +0200 Subject: [PATCH 151/152] Typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 795a690ef..016f704ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,7 @@ before_install: - if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi - if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi - if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi - - if test "$SWIGLANG" = "python"; git clone https://github.com/jcrocholl/pep8.git && pushd pep8 && git checkout tags/1.5.7 && python ./setup.py build && sudo python ./setup.py install && popd; fi + - if test "$SWIGLANG" = "python"; then git clone https://github.com/jcrocholl/pep8.git && pushd pep8 && git checkout tags/1.5.7 && python ./setup.py build && sudo python ./setup.py install && popd; fi - if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi From 11b5a6187999c24ea6d887110749d12f3c2aa5eb Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Tue, 10 Jun 2014 08:59:55 +0200 Subject: [PATCH 152/152] Check multi-module examples. Dont use sed. --- Examples/test-suite/python/Makefile.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 1c35d2843..c00d8844c 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -126,6 +126,7 @@ VALGRIND_OPT += --suppressions=pythonswig.supp +$(convert_testcase) $(setup) +$(swig_and_compile_multi_cpp) + $(check_pep8_multi_cpp) $(run_testcase) @@ -139,7 +140,14 @@ py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX) check_pep8 = \ if [ -n "$(PEP8)" ]; then \ - $(PEP8) --ignore=E501,E30,W291,W391 `echo $(py2_runme)|sed "s|_runme||g"`;\ + $(PEP8) --ignore=E501,E30,W291,W391 $(SCRIPTPREFIX)$*.py;\ + fi + +check_pep8_multi_cpp = \ + if [ -n "$(PEP8)" ]; then \ + for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \ + $(PEP8) --ignore=E501,E30,W291,W391 $$f.py; \ + done \ fi run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(py_runme)