1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#!/bin/sh
set -e
exec 2>&1
set -u
set -x
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
CC="$DEB_HOST_GNU_TYPE-gcc"
PKG_CONFIG="$DEB_HOST_GNU_TYPE-pkg-config"
else
CC=gcc
PKG_CONFIG=pkg-config
fi
cd "$AUTOPKGTEST_TMP"
cat >example.c <<'EOF'
#include <sys/types.h>
#include <sys/acl.h>
#include <err.h>
#include <stddef.h>
int
main(void)
{
acl_t acl;
acl = acl_init(42);
if (acl == NULL)
err(1, "unable to allocate an ACL");
if (acl_free(acl) != 0)
err(1, "unable to free ACL %p", acl);
return 0;
}
EOF
$CC -o example example.c $($PKG_CONFIG --libs libacl)
test -x ./example
./example
$CC -static -o example-static example.c $($PKG_CONFIG --static --libs libacl)
test -x ./example-static
./example-static
|