swig icon indicating copy to clipboard operation
swig copied to clipboard

Build on MinGW and CygWin

Open giumas opened this issue 8 years ago • 8 comments

I have an issue in building SWIG with MinGW:

$ ./autogen.sh
+ test -d Tools/config
+ aclocal -I Tools/config
+ autoheader
+ automake --add-missing --copy --force-missing
Useless use of /d modifier in transliteration operator at /usr/share/automake-1.8/Automake/Wrap.pm line 60.
+ autoconf
+ cd CCache
+ autoreconf
$ ./configure
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... none
checking dependency style of gcc... none
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking whether gcc and cc understand -c and -o together... yes
checking maximum warning verbosity option... -Wall -W -ansi -pedantic for C++ -Wall -W -ansi -pedantic for C
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for popen... yes
checking whether to enable PCRE support... yes
checking whether to use local PCRE... no
checking for a sed that does not truncate output... /usr/bin/sed
checking for pcre-config... /usr/bin/pcre-config
checking whether to enable ccache-swig... yes

Checking packages required for SWIG developers.
Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball

checking for bison... bison -y

Checking for installed target languages and other information in order to compile and run
the examples and test-suite invoked by 'make check'.
Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball

./configure: line 5795: syntax error near unexpected token `fi'
./configure: line 5795: `fi'
$ automake --version
automake (GNU automake) 1.8.5
$ autoconf --version
autoconf (GNU Autoconf) 2.59
$ sh -n configure && echo OK
configure: line 5795: syntax error near unexpected token `fi'
configure: line 5795: `fi'

It is similar to this: https://github.com/swig/swig/issues/815

Have you experienced something similar on Windows? Which automake & autoconf are you using?

giumas avatar Dec 06 '16 04:12 giumas

For our project, we cross compile for Windows.

jaeandersson avatar Dec 06 '16 04:12 jaeandersson

I see. Can you give me more info? Which OS? Which compiler?

giumas avatar Dec 06 '16 04:12 giumas

I see. Can you give me more info? Which OS? Which compiler?

@jgillis, can you help?

jaeandersson avatar Dec 07 '16 13:12 jaeandersson

We dont crosscompile swig itself. We crosscompile our siftware using a native linux compiled mingw

jgillis avatar Dec 07 '16 14:12 jgillis

@jgillis does it mean that you only compile the matlab-branch of swig on Linux? @jaeandersson what is the swig version that this branch is based on? and did you modify the configure for it?

giumas avatar Dec 07 '16 14:12 giumas

Correct. Perhaps its perfectly simple to do it, but we have no experience with it.

jgillis avatar Dec 07 '16 14:12 jgillis

Sadly, it does not seem to be deadly simple.. as I posted at the beginning of this ticket. And I cannot ask for help on the building on the official swig repo since this is an unsupported branch!

giumas avatar Dec 07 '16 14:12 giumas

Ah but this has nothing to do with the branch I would think. It's just the swig build system playing tricks. You should rephrase the question, possibly after verifying that you get indeed the same issue with the swig main branch.

jgillis avatar Dec 07 '16 14:12 jgillis