Commit graph

381 commits

Author SHA1 Message Date
Vadim Zeitlin
4d774887cc Only syntax check generated header when not using run test
There is no need to syntax check the header if it's going to be really used,
so this is a small optimization.

It also separates building of the wrappers from testing them better.
2016-04-21 01:37:40 +02:00
Vadim Zeitlin
87d4a0da71 Reuse c_compile rule in C unit test suite makefile
No real changes, just reuse the commands defined in the C section of the top
level Examples/Makefile instead of (imperfectly, i.e. CFLAGS was forgotten
here) duplicating them in Examples/test-suite/c/Makefile.
2016-04-21 01:37:40 +02:00
Vadim Zeitlin
668f2b4a85 Syntax check headers by C module when running the unit tests suite
Catch errors in the generated headers even when we don't have a run test.

Unfortunately this uncovered that almost no unit tests actually pass, so many,
many more of them had to be disabled.
2016-04-18 20:30:49 +02:00
Vadim Zeitlin
795e3adb0d Use CFLAGS when compiling test code for C module tests
This is useful to pass e.g. CFLAGS=-g on make command line.
2016-04-14 02:44:46 +02:00
Vadim Zeitlin
3d6880aad1 Start removing proxy layer, just use the wrapped functions directly
The proxy layer, and all the extra complexity associated with it, seemed to be
only necessary in order to try to allow using the same name for the wrapped
global functions as were used for them in the original C or C++ code being
wrapped. However this could simply never work in all cases, notably it didn't
work at all when using ELF shared libraries under Unix as the functions with
the same name defined in the main program were interposed and replaced the
functions defined in the shared library, meaning that the proxy function foo()
called wrapper function _wrap_foo() which called back into proxy function
foo() itself again, resulting in guaranteed stack overflow. The only possible
way to fix this would be to use "protected" ELF visibility for the original
functions, but this is not always possible (e.g. if the sources of the
original library are not available) and not simple even when it is and,
besides, protected visibility has its own problems -- notably by making it
impossible to hook the library functions when you actually want to do it.
Besides, proxy-based approach simply couldn't work at all when using static
linking as it resulted in two copies of the function with the same name

Most importantly, however, the main task of this module is to wrap C++
classes, not C functions, and renaming them in the wrapper is not necessary at
all in this case as there is no conflict with the original names in this case.
So simply drop the idea of generating a separate proxy header and generate a
header declaring the functions declared in the wrapper instead and, also, do
not give them "_wrap_" prefix whenever possible, i.e. only do it for the
global functions.

This simplifies SWIG code itself and makes it simpler to use its output as
it's not necessary to link both with the wrapper (dynamically) and with the
proxy (statically) and it's not enough to link with the wrapper only and it
can be done in any way (i.e. either statically or dynamically).

As a side effect of this change, Swig_name_proxy() is not necessary any more
and was removed, eliminating the only difference with the master branch in any
source file other than c.cxx itself.
2016-04-14 02:44:45 +02:00
Vadim Zeitlin
34431d72e6 Create output file with C++ extension for C++ C examples
This file contains C++ code when using "swig -c++", so create it with .cxx
extension.
2016-04-13 18:10:35 +02:00
Vadim Zeitlin
23d89c2cb4 Make "make check-c-version" work too
This is not very useful, but still add this target for consistency and to make
Travis CI script work with C too.
2016-04-13 18:10:35 +02:00
Vadim Zeitlin
19ed0b531d Fix and simplify C examples makefiles
Make "make check-c-examples" perform the correct build commands, e.g. not link
the proxy code into the shared library as this can't work because it defines
the same functions that are already present in it.

Also fix the c_xxx targets to work when SWIG is built in a separate build
directory.

Finally, simplify them by removing the unnecessary variables.

Notice that std_vector example still doesn't build, but at least now it is due
to a real problem in the C module and not makefile bugs.
2016-04-10 22:45:51 +02:00
Vadim Zeitlin
7c402ad148 Merge branch 'master' into C 2016-04-08 17:29:16 +02:00
William S Fulton
7aa5f07dfd Fix 'make partialcheck-test-suite'
Python pep8 should not be run as part of partialcheck
Javascript should also only invoke SWIG during partialcheck
2016-03-18 18:56:55 +00:00
William S Fulton
004ae163e5 Add RUBYFLAGS for Ruby testing
make check RUBYFLAGS=-v can be useful
2015-09-25 23:15:25 +01:00
William S Fulton
e00a8026a6 More remove SWIG_LIB variable 2015-08-21 22:48:34 +01:00
William S Fulton
8e2bc595c6 Remove use of preinst-swig script
Complete the prototype removal in ca1431.

The script prevents SWIGTOOL=gdb from working as gdb can't be used to
debug a shell script, it requires a binary.

Add support for SWIGTOOL in all the examples.

SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.

See issue #473.
2015-08-21 22:43:17 +01:00
William S Fulton
ca1431f4cf Prototype removal of swig-preinst in the test-suite and examples
Prototype for Java test-suite and Java class example.

SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.
SWIG_LIB is explicitly set where necessary.
Allows use of 'make SWIGTOOL="gdb --args"' to work as gdb can't be used
to debug a shell script, for both examples and test-suite.

See issue #473.
2015-08-18 08:00:01 +01:00
William S Fulton
023b0186f0 Fix R out-of-source build examples 2015-08-13 06:48:17 +01:00
Ian Lance Taylor
c6b3088e58 [Go] Add Makefile testing support for changes in upcoming Go 1.5 release.
No effect on the SWIG program itself.
2015-06-19 14:29:38 -07:00
William S Fulton
0f94ea9208 Example and test-suite makefile tidy up
Python output is less verbose if pep8 is not available (tweaks for patch #416)
2015-05-11 00:09:40 +01:00
Jon Schlueter
ae8554bb4c Add pep8 check for Examples/python
build step as part of build process for make check-python-examples

warnings from pep8 are not treated as failures.
using same initial ignore list as used for test-suite pep8
2015-05-08 08:46:06 -04:00
William S Fulton
3d61e84be6 Add CSHARPOPTIONS for users to customise C# compiler flags 2015-04-04 02:17:57 +01:00
Olly Betts
226b4dec5b Probe for camlp4 in configure
See issue #364.
2015-03-25 12:44:05 +13:00
Simon Marchetto
cfebdc36af scilab: compile examples & test-suite with debug infos 2015-03-24 16:52:18 +01:00
Ian Lance Taylor
4c399718d0 [Go] Add -I $(SRCDIR) to CGO_CPPFLAGS. 2015-03-09 10:06:04 -07:00
Ian Lance Taylor
b1311b0d88 [Go] Use -I ../../.. instead of -I $(pwd) to see if this helps with
Travis.  (Travis is reporting failures that I can not recreate.)
2015-03-08 20:30:47 -07:00
Ian Lance Taylor
9ad497c08e [Go] Add -cgo option, required for Go version 1.5 and later. 2015-03-02 14:03:33 -08:00
Ian Lance Taylor
40f5b1ecc6 [Go] Fixes so that the go_subdir_import test will work with gccgo. 2015-02-22 11:01:24 -08:00
Misha Seltzer
beed5f3479 Changed to using $() instead of ${} in the makefile for consistancy 2015-02-17 10:27:45 +02:00
Misha Seltzer
9e2c75c2a8 Fix running tests when the test build outputs are generated in a different folder. (Fixes Travis' test runs). 2015-02-17 10:27:45 +02:00
Misha Seltzer
8da4d20308 Fixed SWIG go for cases when SWIG %import-s another package which is located in a subdirectory. 2015-02-17 10:27:45 +02:00
William S Fulton
c84838fded Correct Examples makefile for guile
C++ testcases were not rebuilding
2015-02-11 19:49:21 +00:00
Simon Marchetto
0544765abd remove -nobuilder option 2015-01-26 12:29:40 +01:00
Simon Marchetto
adc4b788df Merge remote-tracking branch 'origin/master' into gsoc2012-scilab
Conflicts:
	.gitignore
	.travis.yml
	configure.ac
2015-01-26 10:50:20 +01:00
William S Fulton
253c6e1163 Scilab makefile tidyup 2015-01-19 07:52:38 +00:00
William S Fulton
fb94b312e0 Fix incorrect flags being passed to javac on cygwin/mingw 2015-01-17 23:17:57 +00:00
Simon Marchetto
78705a5175 gateway source is moved into wrapper source 2015-01-07 18:04:29 +01:00
William S Fulton
063aa9e3c5 Revert "Fix D examples clean"
This reverts commit c26010eb01.
2014-12-28 19:14:25 +00:00
William S Fulton
c26010eb01 Fix D examples clean 2014-12-28 17:35:18 +00:00
William S Fulton
2b04d37b94 Tidy up Javascript build system 2014-12-28 16:13:22 +00:00
William S Fulton
d79f11501d Don't delete checked in files with 'make distclean'
Occurs when ruby is not detected.
Fixes #290.
2014-12-28 15:26:27 +00:00
David Nadlinger
86276568df D: Fix out-of-source build for examples. 2014-11-06 23:04:36 +01:00
Simon Marchetto
784a901bc4 scilab: fix primitive types test compilation warnings 2014-10-20 17:44:24 +02:00
Simon Marchetto
c0741a7269 scilab: build now examples/tests with standard tools in (no more builder.sce) 2014-10-20 14:57:32 +02:00
William S Fulton
42da040a07 Show mono info in 'make check-csharp-version'
For diagnosing configuration of mono runtime
2014-10-14 19:22:25 +01:00
William S Fulton
8128b1e12f For Android examples, replace hard coded tool names with those detected at configure time. 2014-09-15 19:44:18 +01:00
Simon Marchetto
ef687d801e scilab: fix C++ examples cleaning 2014-09-15 10:22:42 +02:00
Simon Marchetto
d89f3bde90 scilab: fix Examples Makefile exit code 2014-09-12 12:04:40 +02:00
William S Fulton
2831d891cd Use CXXSRCS for testing for Scilab like other languages 2014-09-02 20:12:19 +01:00
William S Fulton
a022dc44cd Add RUNPIPE back in for Scilab examples 2014-09-01 19:46:56 +01:00
Simon Marchetto
f602d6209e scilab: fix comment typo 2014-07-24 17:14:42 +02:00
Simon Marchetto
e3856c1c87 scilab: fix Examples makefile missing separator 2014-07-10 12:19:07 +02:00
Simon Marchetto
71b838b777 scilab: fix exit code in Example makefile 2014-07-10 09:22:32 +02:00