Date: Mon, 25 Apr 2016 19:45:33 +0000 (UTC) From: Diane Bruce <db@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r414027 - in head/comms: . libfec libfec/files Message-ID: <201604251945.u3PJjXvo084627@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: db Date: Mon Apr 25 19:45:33 2016 New Revision: 414027 URL: https://svnweb.freebsd.org/changeset/ports/414027 Log: Add back libfec Remove support for obsolete FreeBSD versions Reassign maintainer to hamradio@ Cleanups to make sure it compiles cleanly on clang and gcc Cleanup to (hopefully) allow building on non x86 architectures (untested) Added: head/comms/libfec/ - copied from r413621, head/comms/libfec/ head/comms/libfec/files/cpu_mode.c (contents, props changed) head/comms/libfec/files/patch-configure.in (contents, props changed) head/comms/libfec/files/patch-makefile.in (contents, props changed) Deleted: head/comms/libfec/files/patch-fec.c Modified: head/comms/Makefile head/comms/libfec/Makefile head/comms/libfec/files/patch-dotprod.c (contents, props changed) head/comms/libfec/files/patch-fec.h (contents, props changed) Modified: head/comms/Makefile ============================================================================== --- head/comms/Makefile Mon Apr 25 18:04:07 2016 (r414026) +++ head/comms/Makefile Mon Apr 25 19:45:33 2016 (r414027) @@ -81,6 +81,7 @@ SUBDIR += libcodec2 SUBDIR += libconcord SUBDIR += libfap + SUBDIR += libfec SUBDIR += libimobiledevice SUBDIR += libirman SUBDIR += libmodbus Modified: head/comms/libfec/Makefile ============================================================================== --- head/comms/libfec/Makefile Tue Apr 19 03:28:32 2016 (r413621) +++ head/comms/libfec/Makefile Mon Apr 25 19:45:33 2016 (r414027) @@ -3,25 +3,22 @@ PORTNAME= libfec PORTVERSION= 3.0.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= comms astro hamradio math MASTER_SITES= http://www.ka9q.net/code/fec/ \ LOCAL/db DISTNAME= fec-${PORTVERSION} -MAINTAINER= olgeni@FreeBSD.org +MAINTAINER= hamradio@FreeBSD.org COMMENT= Several forward error correction (FEC) decoders -BROKEN= produces unusable library -DEPRECATED= Broken for more than 6 months -EXPIRATION_DATE= 2016-04-15 +LICENSE= LGPL21 MAKEFILE= makefile GNU_CONFIGURE= yes -USES= gmake tar:bzip2 +USES= autoreconf gmake tar:bzip2 USE_LDCONFIG= yes -ONLY_FOR_ARCHS= i386 amd64 PLIST_FILES= include/fec.h \ lib/libfec.so \ lib/libfec.a \ @@ -36,7 +33,7 @@ CFLAGS+= -fPIC .endif post-patch: - @${REINPLACE_CMD} -e 's|gcc|${CC}|g' ${WRKSRC}/makefile.in + @${CP} ${FILESDIR}/cpu_mode.c ${WRKSRC} do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/include Added: head/comms/libfec/files/cpu_mode.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/libfec/files/cpu_mode.c Mon Apr 25 19:45:33 2016 (r414027) @@ -0,0 +1,50 @@ +/* Determine CPU support for SIMD + * Copyright 2004 Phil Karn, KA9Q + */ +#include <stdio.h> +#include "fec.h" +#ifdef __VEC__ +#include <sys/sysctl.h> +#endif + +/* Various SIMD instruction set names */ +char *Cpu_modes[] = {"Unknown","Portable C","x86 Multi Media Extensions (MMX)", + "x86 Streaming SIMD Extensions (SSE)", + "x86 Streaming SIMD Extensions 2 (SSE2)", + "PowerPC G4/G5 Altivec/Velocity Engine"}; + +enum cpu_mode Cpu_mode; + +void find_cpu_mode(void){ + + int f; + if(Cpu_mode != UNKNOWN) + return; + else + Cpu_mode = PORT; +#ifdef __i386__ + /* Figure out what kind of CPU we have */ + f = cpu_features(); + if(f & (1<<26)){ /* SSE2 is present */ + Cpu_mode = SSE2; + } else if(f & (1<<25)){ /* SSE is present */ + Cpu_mode = SSE; + } else if(f & (1<<23)){ /* MMX is present */ + Cpu_mode = MMX; + } +#endif +//#ifdef __VEC__ +#if 0 +// This looks very Linux specific + { + /* Ask the OS if we have Altivec support */ + int selectors[2] = { CTL_HW, HW_VECTORUNIT }; + int hasVectorUnit = 0; + size_t length = sizeof(hasVectorUnit); + int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); + if(0 == error && hasVectorUnit) + Cpu_mode = ALTIVEC; + } +#endif + fprintf(stderr,"SIMD CPU detect: %s\n",Cpu_modes[Cpu_mode]); +} Added: head/comms/libfec/files/patch-configure.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/libfec/files/patch-configure.in Mon Apr 25 19:45:33 2016 (r414027) @@ -0,0 +1,27 @@ +--- configure.in.orig 2006-10-13 01:10:53 UTC ++++ configure.in +@@ -38,7 +38,7 @@ AC_CANONICAL_SYSTEM + case $target_cpu in + i386|i486|i586|i686) + ARCH_OPTION="-march=$target_cpu" +- MLIBS="viterbi27_mmx.o mmxbfly27.o viterbi27_sse.o ssebfly27.o viterbi27_sse2.o sse2bfly27.o \ ++ MLIBS="cpu_features.o viterbi27_mmx.o mmxbfly27.o viterbi27_sse.o ssebfly27.o viterbi27_sse2.o sse2bfly27.o \ + viterbi29_mmx.o mmxbfly29.o viterbi29_sse.o ssebfly29.o viterbi29_sse2.o sse2bfly29.o \ + viterbi39_sse2.o viterbi39_sse.o viterbi39_mmx.o \ + viterbi615_mmx.o viterbi615_sse.o viterbi615_sse2.o \ +@@ -50,13 +50,13 @@ i386|i486|i586|i686) + sumsq.o sumsq_port.o \ + sumsq_sse2.o sumsq_sse2_assist.o \ + sumsq_mmx.o sumsq_mmx_assist.o \ +- cpu_features.o cpu_mode_x86.o" ++ cpu_features.o" + ;; + powerpc*) + ARCH_OPTION="-fno-common -faltivec" + MLIBS="viterbi27_av.o viterbi29_av.o viterbi39_av.o viterbi615_av.o \ + encode_rs_av.o \ +- dotprod_av.o sumsq_av.o peakval_av.o cpu_mode_ppc.o" ++ dotprod_av.o sumsq_av.o peakval_av.o" + ;; + *) + MLIBS= Modified: head/comms/libfec/files/patch-dotprod.c ============================================================================== --- head/comms/libfec/files/patch-dotprod.c Tue Apr 19 03:28:32 2016 (r413621) +++ head/comms/libfec/files/patch-dotprod.c Mon Apr 25 19:45:33 2016 (r414027) @@ -1,21 +1,24 @@ ---- dotprod.c.orig 2006-10-13 03:10:53.000000000 +0200 -+++ dotprod.c 2014-01-17 12:35:33.000000000 +0100 -@@ -54,12 +54,16 @@ +--- dotprod.c.orig 2006-10-13 01:10:53 UTC ++++ dotprod.c +@@ -54,16 +54,21 @@ void freedp(void *p){ switch(Cpu_mode){ case PORT: default: -+ freedp_port(p); -+ break; ++ return; ++ break; #ifdef __i386__ case MMX: case SSE: -- return freedp_mmx(p); -+ freedp_mmx(p); -+ break; + return freedp_mmx(p); ++ break; case SSE2: -- return freedp_sse2(p); -+ freedp_sse2(p); -+ break; + return freedp_sse2(p); ++ break; #endif #ifdef __VEC__ case ALTIVEC: + return freedp_av(p); ++ break; + #endif + } + } Modified: head/comms/libfec/files/patch-fec.h ============================================================================== --- head/comms/libfec/files/patch-fec.h Tue Apr 19 03:28:32 2016 (r413621) +++ head/comms/libfec/files/patch-fec.h Mon Apr 25 19:45:33 2016 (r414027) @@ -1,6 +1,6 @@ ---- fec.h.orig 2007-07-02 13:26:12.000000000 -0400 -+++ fec.h 2007-07-02 13:38:26.000000000 -0400 -@@ -262,7 +262,7 @@ +--- fec.h.orig 2006-10-13 01:10:53 UTC ++++ fec.h +@@ -262,7 +262,7 @@ extern enum cpu_mode {UNKNOWN=0,PORT,MMX void find_cpu_mode(void); /* Call this once at startup to set Cpu_mode */ /* Determine parity of argument: 1 = odd, 0 = even */ Added: head/comms/libfec/files/patch-makefile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/comms/libfec/files/patch-makefile.in Mon Apr 25 19:45:33 2016 (r414027) @@ -0,0 +1,193 @@ +--- makefile.in.orig 2006-10-13 01:10:53 UTC ++++ makefile.in +@@ -8,7 +8,7 @@ prefix = @prefix@ + exec_prefix=@exec_prefix@ + VPATH = @srcdir@ + CC=@CC@ +-LIBS=@MLIBS@ fec.o sim.o viterbi27.o viterbi27_port.o viterbi29.o viterbi29_port.o \ ++LIBS=@MLIBS@ cpu_mode.o fec.o sim.o viterbi27.o viterbi27_port.o viterbi29.o viterbi29_port.o \ + viterbi39.o viterbi39_port.o \ + viterbi615.o viterbi615_port.o encode_rs_char.o encode_rs_int.o encode_rs_8.o \ + decode_rs_char.o decode_rs_int.o decode_rs_8.o \ +@@ -43,52 +43,50 @@ test: vtest27 vtest29 vtest39 vtest615 r + install: all + mkdir -p @libdir@ + install -m 644 -p $(SHARED_LIB) libfec.a @libdir@ +-# (cd @libdir@;ln -f -s $(SHARED_LIB) libfec.so) +- @REBIND@ + mkdir -p @includedir@ + install -m 644 -p fec.h @includedir@ + mkdir -m 0755 -p @mandir@/man3 + install -m 644 -p simd-viterbi.3 rs.3 dsp.3 @mandir@/man3 + + peaktest: peaktest.o libfec.a +- gcc -g -o $@ $^ ++ ${CC} -g -o $@ $^ + + sumsq_test: sumsq_test.o libfec.a +- gcc -g -o $@ $^ ++ ${CC} -g -o $@ $^ + + dtest: dtest.o libfec.a +- gcc -g -o $@ $^ -lm ++ ${CC} -g -o $@ $^ -lm + + vtest27: vtest27.o libfec.a +- gcc -g -o $@ $^ -lm ++ ${CC} -g -o $@ $^ -lm + + vtest29: vtest29.o libfec.a +- gcc -g -o $@ $^ -lm ++ ${CC} -g -o $@ $^ -lm + + vtest39: vtest39.o libfec.a +- gcc -g -o $@ $^ -lm ++ ${CC} -g -o $@ $^ -lm + + vtest615: vtest615.o libfec.a +- gcc -g -o $@ $^ -lm ++ ${CC} -g -o $@ $^ -lm + + rstest: rstest.o libfec.a +- gcc -g -o $@ $^ ++ ${CC} -g -o $@ $^ + + rs_speedtest: rs_speedtest.o libfec.a +- gcc -g -o $@ $^ ++ ${CC} -g -o $@ $^ + + # for some reason, the test programs without args segfault on the PPC with -O2 optimization. Dunno why - compiler bug? + vtest27.o: vtest27.c fec.h +- gcc -g -c $< ++ ${CC} -g -c $< + + vtest29.o: vtest29.c fec.h +- gcc -g -c $< ++ ${CC} -g -c $< + + vtest39.o: vtest39.c fec.h +- gcc -g -c $< ++ ${CC} -g -c $< + + vtest615.o: vtest615.c fec.h +- gcc -g -c $< ++ ${CC} -g -c $< + + libfec.a: $(LIBS) + ar rv $@ $^ +@@ -100,7 +98,7 @@ libfec.dylib: $(LIBS) + + # for Linux et al + libfec.so: $(LIBS) +- gcc -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive -lc ++ ${CC} -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive -lc + + dotprod.o: dotprod.c fec.h + +@@ -146,10 +144,10 @@ ccsds_tab.c: gen_ccsds + ./gen_ccsds > ccsds_tab.c + + gen_ccsds: gen_ccsds.o init_rs_char.o +- gcc -o $@ $^ ++ ${CC} -o $@ $^ + + gen_ccsds.o: gen_ccsds.c +- gcc $(CFLAGS) -c -o $@ $< ++ ${CC} $(CFLAGS) -c -o $@ $< + + ccsds_tal.o: ccsds_tal.c + +@@ -157,16 +155,16 @@ ccsds_tal.c: gen_ccsds_tal + ./gen_ccsds_tal > ccsds_tal.c + + exercise_char.o: exercise.c +- gcc $(CFLAGS) -c -o $@ $< ++ ${CC} $(CFLAGS) -c -o $@ $< + + exercise_int.o: exercise.c +- gcc -DBIGSYM=1 $(CFLAGS) -c -o $@ $< ++ ${CC} -DBIGSYM=1 $(CFLAGS) -c -o $@ $< + + exercise_8.o: exercise.c +- gcc -DFIXED=1 $(CFLAGS) -c -o $@ $< ++ ${CC} -DFIXED=1 $(CFLAGS) -c -o $@ $< + + exercise_ccsds.o: exercise.c +- gcc -DCCSDS=1 $(CFLAGS) -c -o $@ $< ++ ${CC} -DCCSDS=1 $(CFLAGS) -c -o $@ $< + + viterbi27.o: viterbi27.c fec.h + +@@ -175,13 +173,13 @@ viterbi27_port.o: viterbi27_port.c fec.h + viterbi27_av.o: viterbi27_av.c fec.h + + viterbi27_mmx.o: viterbi27_mmx.c fec.h +- gcc $(CFLAGS) -mmmx -c -o $@ $< ++ ${CC} $(CFLAGS) -mmmx -c -o $@ $< + + viterbi27_sse.o: viterbi27_sse.c fec.h +- gcc $(CFLAGS) -msse -c -o $@ $< ++ ${CC} $(CFLAGS) -msse -c -o $@ $< + + viterbi27_sse2.o: viterbi27_sse2.c fec.h +- gcc $(CFLAGS) -msse2 -c -o $@ $< ++ ${CC} $(CFLAGS) -msse2 -c -o $@ $< + + viterbi29.o: viterbi29.c fec.h + +@@ -190,13 +188,13 @@ viterbi29_port.o: viterbi29_port.c fec.h + viterbi29_av.o: viterbi29_av.c fec.h + + viterbi29_mmx.o: viterbi29_mmx.c fec.h +- gcc $(CFLAGS) -mmmx -c -o $@ $< ++ ${CC} $(CFLAGS) -mmmx -c -o $@ $< + + viterbi29_sse.o: viterbi29_sse.c fec.h +- gcc $(CFLAGS) -msse -c -o $@ $< ++ ${CC} $(CFLAGS) -msse -c -o $@ $< + + viterbi29_sse2.o: viterbi29_sse2.c fec.h +- gcc $(CFLAGS) -msse2 -c -o $@ $< ++ ${CC} $(CFLAGS) -msse2 -c -o $@ $< + + viterbi39.o: viterbi39.c fec.h + +@@ -205,13 +203,13 @@ viterbi39_port.o: viterbi39_port.c fec.h + viterbi39_av.o: viterbi39_av.c fec.h + + viterbi39_mmx.o: viterbi39_mmx.c fec.h +- gcc $(CFLAGS) -mmmx -c -o $@ $< ++ ${CC} $(CFLAGS) -mmmx -c -o $@ $< + + viterbi39_sse.o: viterbi39_sse.c fec.h +- gcc $(CFLAGS) -msse -c -o $@ $< ++ ${CC} $(CFLAGS) -msse -c -o $@ $< + + viterbi39_sse2.o: viterbi39_sse2.c fec.h +- gcc $(CFLAGS) -msse2 -c -o $@ $< ++ ${CC} $(CFLAGS) -msse2 -c -o $@ $< + + viterbi615.o: viterbi615.c fec.h + +@@ -220,17 +218,15 @@ viterbi615_port.o: viterbi615_port.c fec + viterbi615_av.o: viterbi615_av.c fec.h + + viterbi615_mmx.o: viterbi615_mmx.c fec.h +- gcc $(CFLAGS) -mmmx -c -o $@ $< ++ ${CC} $(CFLAGS) -mmmx -c -o $@ $< + + viterbi615_sse.o: viterbi615_sse.c fec.h +- gcc $(CFLAGS) -msse -c -o $@ $< ++ ${CC} $(CFLAGS) -msse -c -o $@ $< + + viterbi615_sse2.o: viterbi615_sse2.c fec.h +- gcc $(CFLAGS) -msse2 -c -o $@ $< +- +-cpu_mode_x86.o: cpu_mode_x86.c fec.h ++ ${CC} $(CFLAGS) -msse2 -c -o $@ $< + +-cpu_mode_ppc.o: cpu_mode_ppc.c fec.h ++cpu_mode.o: cpu_mode.c fec.h + + + clean:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604251945.u3PJjXvo084627>