| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | dir=`dirname "$0"` |
| 6 | |
| 7 | # Copy debian/changelog for ELF package metadata in dpkg-buildflags LDFLAGS |
| 8 | mkdir -p "${AUTOPKGTEST_TMP}/debian" |
| 9 | cp debian/changelog "${AUTOPKGTEST_TMP}/debian" |
| 10 | |
| 11 | cd "${AUTOPKGTEST_TMP}" |
| 12 | |
| 13 | cleanup() { |
| 14 | ex=$? |
| 15 | rm -f test.bin test.out |
| 16 | exit "${ex}" |
| 17 | } |
| 18 | trap "cleanup" EXIT TERM INT |
| 19 | |
| 20 | CC=cc |
| 21 | CFLAGS=`dpkg-buildflags --get CFLAGS` |
| 22 | CFLAGS="${CFLAGS} `dpkg-buildflags --get CPPFLAGS`" |
| 23 | CFLAGS="${CFLAGS} -I${dir}/../../cryptoint -I${dir}/../../include-build" |
| 24 | LDFLAGS=`dpkg-buildflags --get LDFLAGS` |
| 25 | LDFLAGS="${LDFLAGS} /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lib25519.a -lrandombytes" |
| 26 | |
| 27 | ${CC} ${CFLAGS} -o test.bin "${dir}/../../command/lib25519-test"*.c ${LDFLAGS} |
| 28 | |
| 29 | ./test.bin | tee test.out |
| 30 | |
| 31 | echo |
| 32 | echo "=== selected implementations ===" |
| 33 | grep 'selected implementation' test.out | cut -d ' ' -f1,4 | sort -u |