Cross compiles for Win64 with travis

This commit is contained in:
Frank Morgner
2015-09-18 16:38:27 +02:00
parent 57d55c8776
commit b1b7616c24

View File

@@ -4,8 +4,8 @@ matrix:
include: include:
- compiler: clang - compiler: clang
- compiler: gcc - compiler: gcc
- compiler: gcc - compiler: i686-w64-mingw32-gcc
env: HOST=i686-w64-mingw32 - compiler: x86_64-w64-mingw32-gcc
env: env:
global: global:
@@ -22,12 +22,15 @@ before_install:
- sudo apt-get update - sudo apt-get update
install: install:
- if [ "$CC" == i686-w64-mingw32-gcc -o "$CC" == x86_64-w64-mingw32-gcc ]; then
export HOST=${CC%%-gcc};
fi
- if [ $TRAVIS_OS_NAME == linux ]; then - if [ $TRAVIS_OS_NAME == linux ]; then
if [ -z "$HOST" ]; then if [ -z "$HOST" ]; then
sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libgcc_s.so; sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libgcc_s.so;
sudo apt-get -qq install libpcsclite-dev libusb-dev xutils-dev gengetopt help2man swig python-dev; sudo apt-get -qq install libpcsclite-dev libusb-dev xutils-dev gengetopt help2man swig python-dev;
else else
sudo apt-get -qq install libpcsclite-dev libusb-dev xutils-dev gengetopt help2man mingw-w64 binutils-mingw-w64-i686 gcc-mingw-w64-i686; sudo apt-get -qq install libpcsclite-dev libusb-dev xutils-dev gengetopt help2man binutils-mingw-w64 gcc-mingw-w64;
fi fi
fi fi
@@ -36,11 +39,10 @@ before_script:
- git clone https://github.com/frankmorgner/openpace && cd openpace - git clone https://github.com/frankmorgner/openpace && cd openpace
- autoreconf -vis - autoreconf -vis
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
./configure --prefix=$PREFIX --enable-openssl-install --enable-python; ./configure --prefix=$PREFIX --enable-openssl-install --enable-python || cat config.log;
else else
export CROSS_COMPILE=$HOST-; export CROSS_COMPILE=$HOST-;
unset CC; ./configure --prefix=$PREFIX --enable-openssl-install --host=$HOST --enable-openssl-install || cat config.log;
./configure --prefix=$PREFIX --enable-openssl-install --host=$HOST --enable-openssl-install;
touch src/cvc-create.1 src/cvc-print.1; touch src/cvc-create.1 src/cvc-print.1;
fi fi
- make install - make install
@@ -53,43 +55,41 @@ before_script:
- grep sc_pkcs15_pincache_add src/libopensc/libopensc.exports || echo sc_pkcs15_pincache_add >> src/libopensc/libopensc.exports - grep sc_pkcs15_pincache_add src/libopensc/libopensc.exports || echo sc_pkcs15_pincache_add >> src/libopensc/libopensc.exports
- ./bootstrap - ./bootstrap
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
./configure --prefix=$PREFIX; ./configure --prefix=$PREFIX || cat config.log;
else else
unset CC; ./configure --prefix=$PREFIX --host=$HOST LDFLAGS="-I$PREFIX/include" CFLAGS="-I$PREFIX/include" CXXFLAGS="-I$PREFIX/include" LIBS="-I$PREFIX/include" || cat config.log;
unset CXX;
./configure --prefix=$PREFIX --host=$HOST LDFLAGS="-I$PREFIX/include" CFLAGS="-I$PREFIX/include" CXXFLAGS="-I$PREFIX/include" LIBS="-I$PREFIX/include";
fi fi
- make install - make install
# Configure libnpa # Configure libnpa
- cd $TRAVIS_BUILD_DIR/npa - cd $TRAVIS_BUILD_DIR/npa
- autoreconf -vsi - autoreconf -vsi
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
./configure OPENSC_LIBS="-L$PREFIX/lib -lopensc -lcrypto"; ./configure OPENSC_LIBS="-L$PREFIX/lib -lopensc -lcrypto" || cat config.log;
else else
./configure --host=$HOST OPENSC_LIBS="-L$PREFIX/lib -lopensc -lcrypto"; ./configure --host=$HOST OPENSC_LIBS="-L$PREFIX/lib -lopensc -lcrypto" || cat config.log;
touch src/npa-tool.1; touch src/npa-tool.1;
fi fi
# Configure virtualsmartcard # Configure virtualsmartcard
- cd $TRAVIS_BUILD_DIR/virtualsmartcard && autoreconf -vsi - cd $TRAVIS_BUILD_DIR/virtualsmartcard && autoreconf -vsi
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
./configure; ./configure || cat config.log;
else else
./configure --host=$HOST --enable-libpcsclite; ./configure --host=$HOST --enable-libpcsclite || cat config.log;
fi fi
# pcsc-relay requires libnfc # pcsc-relay requires libnfc
- git clone https://github.com/nfc-tools/libnfc.git && cd libnfc && autoreconf -vsi - git clone https://github.com/nfc-tools/libnfc.git && cd libnfc && autoreconf -vsi
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
./configure --prefix=$PREFIX; ./configure --prefix=$PREFIX || cat config.log;
make install; make install;
fi fi
# Configure pcsc-relay # Configure pcsc-relay
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
cd $TRAVIS_BUILD_DIR/pcsc-relay; cd $TRAVIS_BUILD_DIR/pcsc-relay;
autoreconf -vsi; autoreconf -vsi;
./configure --host=$HOST; ./configure --host=$HOST || cat config.log;
fi fi
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
cd $TRAVIS_BUILD_DIR/ccid && autoreconf -vsi && ./configure OPENSSL_CFLAGS="-I$PREFIX/include" OPENSSL_LIBS="-L$PREFIX/lib -lcrypto" OPENSC_LIBS="-L$PREFIX/lib -lopensc"; cd $TRAVIS_BUILD_DIR/ccid && autoreconf -vsi && ./configure OPENSSL_CFLAGS="-I$PREFIX/include" OPENSSL_LIBS="-L$PREFIX/lib -lcrypto" OPENSC_LIBS="-L$PREFIX/lib -lopensc" || cat config.log;
fi fi
addons: addons: