Files
win32ada/workspace/run
Pascal Obry 5f3a038da4 Enhance support for checking types size on cross-environment.
Add some more checks for ACL related types.
2014-05-16 14:43:24 +02:00

47 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# This is the script to run the Win32Ada binding definitions check.
# See driver.adb for more information.
#
# It can be used with a cross-compiler. In this case the last step
# is to run the executable using either wine if 32bits executable, or
# a virtual machine otherwise.
#
# On native: ./run
# On cross: ./run i686-pc-mingw32
PREFIX=$(dirname $(which gcc))
HOST=$(gcc -dumpmachine)
if [ -z $1 ]; then
TARGET=$(gcc -dumpmachine)
else
TARGET=$1
export C_INCLUDE_PATH=$PREFIX/../$TARGET/include
export LIBRARY_PATH=$PREFIX/../$TARGET/lib
fi
if [ "$TARGET" = "i686-pc-mingw32" ]; then
PTARGET=Win32
else
PTARGET=Win64
fi
# Build the driver generator, will generate csupport.c and runcheck.adb
gnatmake driver
./driver -e types.lst
# Build the test driver
if [ $HOST = $TARGET ]; then
gcc -c csupport.c
gnatmake -j6 -XPRJ_TARGET=$PTARGET -gnateDTARGET=$PTARGET \
-P runcheck.gpr -largs csupport.o
./runcheck
else
$TARGET-gcc -c csupport.c
$TARGET-gnatmake -p -j0 -XTARGET=$TARGET -XPRJ_TARGET=$PTARGET \
-gnateDTARGET=$PTARGET -P runcheck.gpr -largs csupport.o
fi