diff options
author | Piotr Kubaj <pkubaj@FreeBSD.org> | 2019-07-30 12:21:14 +0000 |
---|---|---|
committer | Piotr Kubaj <pkubaj@FreeBSD.org> | 2019-07-30 12:21:14 +0000 |
commit | f101adf3105169b1ab2b23a4b1fc323d6625e4bf (patch) | |
tree | 5fb4483d21718b66095931215ab50f708715e9fa /net-mgmt/aircrack-ng | |
parent | ddfde0b70640e64330098be8c40f38cb7fa248b4 (diff) | |
download | ports-f101adf3105169b1ab2b23a4b1fc323d6625e4bf.tar.gz ports-f101adf3105169b1ab2b23a4b1fc323d6625e4bf.zip |
net-mgmt/aircrack-ng: fix build on powerpc*
FreeBSD doesn't have bits/hwcap.h header and elf_aux_info needs to be used instead of getauxval.
On powerpc platforms there are libraries for Altivec installed and no libraries for AVX and SSE are installed.
PR: 239319
Approved by: lme (maintainer), linimon (mentor)
Differential Revision: https://reviews.freebsd.org/D21040
Notes
Notes:
svn path=/head/; revision=507637
Diffstat (limited to 'net-mgmt/aircrack-ng')
-rw-r--r-- | net-mgmt/aircrack-ng/Makefile | 13 | ||||
-rw-r--r-- | net-mgmt/aircrack-ng/files/patch-src_aircrack-util_trampoline__ppc.c | 26 | ||||
-rw-r--r-- | net-mgmt/aircrack-ng/pkg-plist | 16 |
3 files changed, 47 insertions, 8 deletions
diff --git a/net-mgmt/aircrack-ng/Makefile b/net-mgmt/aircrack-ng/Makefile index 3460a07c331c..94faff3f6a15 100644 --- a/net-mgmt/aircrack-ng/Makefile +++ b/net-mgmt/aircrack-ng/Makefile @@ -16,7 +16,6 @@ LICENSE_COMB= dual BROKEN_aarch64= fails to configure: _AX_COMPILER_VERSION_GNU unknown gcc major BROKEN_armv6= fails to configure: _AX_COMPILER_VERSION_GNU unknown gcc major BROKEN_armv7= fails to configure: _AX_COMPILER_VERSION_GNU unknown gcc major -BROKEN_powerpc64= fails to compile: sse-intrinsics.c: error: emmintrin.h: No such file or directory USES= autoreconf cpe dos2unix gmake libtool ssl USE_GCC= yes @@ -45,6 +44,16 @@ SQLITE_DESC= Use SQLite for storing pre-computed key tables SQLITE_USES= sqlite SQLITE_MAKE_ARGS= sqlite=true +.include <bsd.port.pre.mk> + +.if ${ARCH} == powerpc || ${ARCH} == powerpc64 +PLIST_SUB+= PPC="" \ + X86="@comment " +.elif ${ARCH} == amd64 || ${ARCH} == i386 +PLIST_SUB+= PPC="@comment " \ + X86="" +.endif + post-patch: @${REINPLACE_CMD} \ -e 's|%%ETCDIR%%|${ETCDIR}|' ${WRKSRC}/scripts/airodump-ng-oui-update @@ -52,4 +61,4 @@ post-patch: post-install: ${MKDIR} ${STAGEDIR}${ETCDIR} -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/net-mgmt/aircrack-ng/files/patch-src_aircrack-util_trampoline__ppc.c b/net-mgmt/aircrack-ng/files/patch-src_aircrack-util_trampoline__ppc.c new file mode 100644 index 000000000000..038f3065011d --- /dev/null +++ b/net-mgmt/aircrack-ng/files/patch-src_aircrack-util_trampoline__ppc.c @@ -0,0 +1,26 @@ +--- src/aircrack-util/trampoline_ppc.c.orig 2019-07-19 18:16:49 UTC ++++ src/aircrack-util/trampoline_ppc.c +@@ -19,8 +19,10 @@ + #if defined(__ppc__) || defined(__PPC__) + #ifdef HAS_AUXV + #include <sys/auxv.h> ++#ifndef __FreeBSD__ + #include <bits/hwcap.h> + #endif ++#endif + #else + #error "The wrong CPU architecture file has been included." + #endif +@@ -35,7 +37,12 @@ int simd_get_supported_features(void) + { + int result = 0; + #ifdef HAS_AUXV ++#ifndef __FreeBSD__ + long hwcaps = getauxval(AT_HWCAP2); ++#else ++ long hwcaps; ++ elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps)); ++#endif + + #if defined(PPC_FEATURE2_ARCH_2_07) + if (hwcaps & PPC_FEATURE2_ARCH_2_07) diff --git a/net-mgmt/aircrack-ng/pkg-plist b/net-mgmt/aircrack-ng/pkg-plist index 1abaff7dd091..8daf21d16fd5 100644 --- a/net-mgmt/aircrack-ng/pkg-plist +++ b/net-mgmt/aircrack-ng/pkg-plist @@ -10,12 +10,16 @@ bin/makeivs-ng bin/packetforge-ng bin/wpaclean lib/libaircrack-crypto-1.3.0.so -lib/libaircrack-crypto-x86-avx-1.3.0.so -lib/libaircrack-crypto-x86-avx.so -lib/libaircrack-crypto-x86-avx2-1.3.0.so -lib/libaircrack-crypto-x86-avx2.so -lib/libaircrack-crypto-x86-sse2-1.3.0.so -lib/libaircrack-crypto-x86-sse2.so +%%PPC%%lib/libaircrack-crypto-ppc-altivec-1.3.0.so +%%PPC%%lib/libaircrack-crypto-ppc-altivec.so +%%PPC%%lib/libaircrack-crypto-ppc-power8-1.3.0.so +%%PPC%%lib/libaircrack-crypto-ppc-power8.so +%%X86%%lib/libaircrack-crypto-x86-avx-1.3.0.so +%%X86%%lib/libaircrack-crypto-x86-avx.so +%%X86%%lib/libaircrack-crypto-x86-avx2-1.3.0.so +%%X86%%lib/libaircrack-crypto-x86-avx2.so +%%X86%%lib/libaircrack-crypto-x86-sse2-1.3.0.so +%%X86%%lib/libaircrack-crypto-x86-sse2.so lib/libaircrack-crypto.so lib/libaircrack-osdep-1.3.0.so lib/libaircrack-osdep.so |