aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2008-04-24 20:33:17 +0800
committerpav <pav@FreeBSD.org>2008-04-24 20:33:17 +0800
commit03b33e435081c6531bd6490325ecda639b1b4b80 (patch)
treefe2cdc54c5d4ec6e9ea90a2e91acd69d0cf3187e /audio
parent4abb22ae81c8c2c82ed68852e703d35a8cb707d2 (diff)
downloadfreebsd-ports-gnome-03b33e435081c6531bd6490325ecda639b1b4b80.tar.gz
freebsd-ports-gnome-03b33e435081c6531bd6490325ecda639b1b4b80.tar.zst
freebsd-ports-gnome-03b33e435081c6531bd6490325ecda639b1b4b80.zip
- Fix build with new nasm
- Provide option to build threaded encoder Submitted by: bf <bf2006a@yahoo.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/gogo-petit/Makefile23
-rw-r--r--audio/gogo-petit/files/Makefile.rfork119
-rw-r--r--audio/gogo-petit/files/Makefile.unthreaded111
-rw-r--r--audio/gogo-petit/files/patch-FreeBSD-Makefile21
-rw-r--r--audio/gogo-petit/files/patch-engine_i386_fftsse.nas25
-rw-r--r--audio/gogo-petit/pkg-descr12
6 files changed, 278 insertions, 33 deletions
diff --git a/audio/gogo-petit/Makefile b/audio/gogo-petit/Makefile
index 8ea48808d975..965059535f2b 100644
--- a/audio/gogo-petit/Makefile
+++ b/audio/gogo-petit/Makefile
@@ -21,13 +21,26 @@ BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
WRKSRC= ${WRKDIR}/${DISTNAME}/FreeBSD
-CFLAGS+= ${PTHREAD_CFLAGS}
+AS = nasm
+AFLAGS = -f elf -Ox
+ALL_TARGET= test
+MAKE_ENV+= AS="${AS}" \
+ AFLAGS="${AFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
ONLY_FOR_ARCHS= i386
PLIST_FILES= bin/gogo-petit
-post-patch:
- @${REINPLACE_CMD} -e 's|-lc_r|${PTHREAD_LIBS}| ; \
- s|/usr/local/bin|${PREFIX}/bin|g' ${WRKSRC}/Makefile || @${ECHO} yo
+OPTIONS= THREADS "build a multithreaded encoder for SMP" Off
+
+.include <bsd.port.pre.mk>
+
+.ifdef(WITH_THREADS)
+LDFLAGS+= ${PTHREAD_LIBS}
+CFLAGS+= ${PTHREAD_CFLAGS}
+MAKEFILE= ${FILESDIR}/Makefile.rfork
+.else
+MAKEFILE= ${FILESDIR}/Makefile.unthreaded
+.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/audio/gogo-petit/files/Makefile.rfork b/audio/gogo-petit/files/Makefile.rfork
new file mode 100644
index 000000000000..fc81e7698a4e
--- /dev/null
+++ b/audio/gogo-petit/files/Makefile.rfork
@@ -0,0 +1,119 @@
+#######################################################
+#
+# Makefile for GOGO-no-coda
+#
+# Copyright(C)2001,2002,2003 K.Sakai
+# Copyright(C)2001,2002,2003 gogo-developer
+#
+#######################################################
+
+TARGET = gogo-petit
+
+#######################################################
+
+LD = ${CC} ${CFLAGS}
+MAKECFG = makecfg
+LIBS = -lm
+VPATH = ../engine:../engine/i386:../file_io:../rfork/i386
+
+AFLAGS += -I../engine/i386/ -D__unix__ $(E3DN)
+
+CFLAGS += -DHAVE_CONFIG_H -DLAMEPARSE -DLAMESNDFILE
+CFLAGS += -DUSE_X86ASM
+
+COBJS = bitstream.o get_audio.o \
+ newmdct.o quantize_pvt.o \
+ tables.o util.o \
+ gogo.o \
+ psymodel.o reservoir.o \
+ takehiro.o \
+ fft.o lame.o \
+ quantize.o \
+ tool.o vbrtag.o \
+ main.o gogo_io.o setup.o
+
+AOBJS = clka.o cpua.o cpu.o choose_table.o quantizea.o quant3dn.o vars.o psymodela.o psysse.o psy3dn.o gogo2_fht.o fftsse.o mdctsse.o mdct3dn.o sbandfpu.o sbandsse.o sbandtbl.o sband3dn.o
+
+CFLAGS += -DUSE_RFORK -DUSE_PIPE
+COBJS += thread.o
+AOBJS += atomic.o
+
+.SUFFIXES: .nas .c
+
+all: $(TARGET)
+
+install : $(TARGET)
+ ${BSD_INSTALL_PROGRAM} ${TARGET} ${PREFIX}/bin
+
+$(TARGET): $(COBJS) $(AOBJS)
+ $(LD) $(COBJS) $(AOBJS) $(LDFLAGS) -o $(TARGET) $(LIBS)
+
+.nas.o:
+ $(AS) $(AFLAGS) $< -o $@
+
+.c.o:
+ ${CC} -c -I../engine $(CFLAGS) $< -o $@
+
+clean:
+ \rm -f *.o $(TARGET) *~ ../engine/i386/global.cfg $(MAKECFG)
+
+$(MAKECFG) : ../engine/i386/makecfg.c global.h
+ ${CC} -I../engine $(CFLAGS) $< -o $@
+
+cpua.o: cpua.nas nasm.cfg global.cfg
+clka.o: clka.nas nasm.cfg global.cfg
+choose_table.o: choose_table.nas nasm.cfg global.cfg
+quantizea.o: quantizea.nas nasm.cfg global.cfg
+quant3dn.o: quant3dn.nas nasm.cfg global.cfg
+cpu.o: cpu.c common.h cpu.h gogo.h global.h
+vars.o: vars.nas global.cfg
+psymodela.o: psymodela.nas nasm.cfg global.cfg
+psysse.o: psysse.nas nasm.cfg global.cfg
+psy3dn.o: psy3dn.nas nasm.cfg global.cfg
+gogo2_fht.o: gogo2_fht.nas nasm.cfg global.cfg
+fftsse.o: fftsse.nas nasm.cfg global.cfg
+mdctsse.o: mdctsse.nas nasm.cfg global.cfg
+mdct3dn.o: mdct3dn.nas nasm.cfg global.cfg
+sbandtbl.o: sbandtbl.nas nasm.cfg global.cfg
+sbandfpu.o: sbandfpu.nas nasm.cfg global.cfg
+sbandsse.o: sbandsse.nas nasm.cfg global.cfg
+sband3dn.o: sband3dn.nas nasm.cfg global.cfg
+
+atomic.o: atomic.nas nasm.cfg global.cfg
+
+global.cfg : $(MAKECFG) global.h
+ ./$(MAKECFG) > ../engine/i386/global.cfg
+
+thread.o : thread.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h ../pthread/thread.c
+
+bitstream.o: bitstream.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h util.h tables.h bitstream.h quantize.h quantize_pvt.h
+fft.o: fft.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h fft.h
+get_audio.o: get_audio.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h get_audio.h tool.h gogo_io.h
+gogo.o: gogo.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h get_audio.h cpu.h tool.h gogo_io.h encoder.c version.h
+lame.o: lame.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h util.h bitstream.h tables.h quantize_pvt.h vbrtag.h
+newmdct.o: newmdct.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h newmdct.h
+psymodel.o: psymodel.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h psymodel.h tables.h
+quantize.o: quantize.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h quantize.h reservoir.h quantize_pvt.h
+quantize_pvt.o: quantize_pvt.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h tables.h reservoir.h quantize_pvt.h
+reservoir.o: reservoir.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h reservoir.h
+tables.o: tables.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h tables.h
+takehiro.o: takehiro.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h tables.h quantize_pvt.h
+tool.o: tool.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h tool.h lame.h vbrtag.h gogo_io.h
+util.o: util.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h
+vbrtag.o: vbrtag.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h vbrtag.h bitstream.h
+
+main.o: ../main.c common.h gogo.h global.h tool.h cpu.h
+ ${CC} -c -I../engine $(CFLAGS) -I../engine $< -o $@
+
+test: $(TARGET)
+ ./$(TARGET) -test 10 -q 0
+ ./$(TARGET) -test 10 -q 5
+ ./$(TARGET) -test 10 -q 9
+ ./$(TARGET) -test 10 -a -q 0 -b 160
+ ./$(TARGET) -test 10 -a -q 5 -b 192
+ ./$(TARGET) -test 10 -a -q 9 -b 256
+ ./$(TARGET) -test 10 -v 0 -vb 40 256
+ ./$(TARGET) -test 10 -v 5 -q 1
+ ./$(TARGET) -test 10 -v 9 -vb 160 320
+ ./$(TARGET) -test 10 -s 2 -b 64
+ ./$(TARGET) -test 10 -s 999 -b 32
diff --git a/audio/gogo-petit/files/Makefile.unthreaded b/audio/gogo-petit/files/Makefile.unthreaded
new file mode 100644
index 000000000000..7c0e4bec4cb3
--- /dev/null
+++ b/audio/gogo-petit/files/Makefile.unthreaded
@@ -0,0 +1,111 @@
+#######################################################
+#
+# Makefile for GOGO-no-coda
+#
+# Copyright(C)2001,2002,2003 K.Sakai
+# Copyright(C)2001,2002,2003 gogo-developer
+#
+#######################################################
+
+TARGET = gogo-petit
+
+#######################################################
+
+LD = ${CC} ${CFLAGS}
+MAKECFG = makecfg
+LIBS = -lm
+VPATH = ../engine:../engine/i386:../file_io
+
+AFLAGS += -I../engine/i386/ -D__unix__ $(E3DN)
+
+CFLAGS += -DHAVE_CONFIG_H -DLAMEPARSE -DLAMESNDFILE
+CFLAGS += -DUSE_X86ASM
+
+COBJS = bitstream.o get_audio.o \
+ newmdct.o quantize_pvt.o \
+ tables.o util.o \
+ gogo.o \
+ psymodel.o reservoir.o \
+ takehiro.o \
+ fft.o lame.o \
+ quantize.o \
+ tool.o vbrtag.o \
+ main.o gogo_io.o setup.o
+
+AOBJS = clka.o cpua.o cpu.o choose_table.o quantizea.o quant3dn.o vars.o psymodela.o psysse.o psy3dn.o gogo2_fht.o fftsse.o mdctsse.o mdct3dn.o sbandfpu.o sbandsse.o sbandtbl.o sband3dn.o
+
+.SUFFIXES: .nas .c
+
+all: $(TARGET)
+
+install : $(TARGET)
+ ${BSD_INSTALL_PROGRAM} ${TARGET} ${PREFIX}/bin
+
+$(TARGET): $(COBJS) $(AOBJS)
+ $(LD) $(COBJS) $(AOBJS) $(LDFLAGS) -o $(TARGET) $(LIBS)
+
+.nas.o:
+ $(AS) $(AFLAGS) $< -o $@
+
+.c.o:
+ ${CC} -c -I../engine $(CFLAGS) $< -o $@
+
+clean:
+ \rm -f *.o $(TARGET) *~ ../engine/i386/global.cfg $(MAKECFG)
+
+$(MAKECFG) : ../engine/i386/makecfg.c global.h
+ ${CC} -I../engine $(CFLAGS) $< -o $@
+
+cpua.o: cpua.nas nasm.cfg global.cfg
+clka.o: clka.nas nasm.cfg global.cfg
+choose_table.o: choose_table.nas nasm.cfg global.cfg
+quantizea.o: quantizea.nas nasm.cfg global.cfg
+quant3dn.o: quant3dn.nas nasm.cfg global.cfg
+cpu.o: cpu.c common.h cpu.h gogo.h global.h
+vars.o: vars.nas global.cfg
+psymodela.o: psymodela.nas nasm.cfg global.cfg
+psysse.o: psysse.nas nasm.cfg global.cfg
+psy3dn.o: psy3dn.nas nasm.cfg global.cfg
+gogo2_fht.o: gogo2_fht.nas nasm.cfg global.cfg
+fftsse.o: fftsse.nas nasm.cfg global.cfg
+mdctsse.o: mdctsse.nas nasm.cfg global.cfg
+mdct3dn.o: mdct3dn.nas nasm.cfg global.cfg
+sbandtbl.o: sbandtbl.nas nasm.cfg global.cfg
+sbandfpu.o: sbandfpu.nas nasm.cfg global.cfg
+sbandsse.o: sbandsse.nas nasm.cfg global.cfg
+sband3dn.o: sband3dn.nas nasm.cfg global.cfg
+
+global.cfg : $(MAKECFG) global.h
+ ./$(MAKECFG) > ../engine/i386/global.cfg
+
+bitstream.o: bitstream.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h util.h tables.h bitstream.h quantize.h quantize_pvt.h
+fft.o: fft.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h fft.h
+get_audio.o: get_audio.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h get_audio.h tool.h gogo_io.h
+gogo.o: gogo.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h get_audio.h cpu.h tool.h gogo_io.h encoder.c version.h
+lame.o: lame.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h lame.h util.h bitstream.h tables.h quantize_pvt.h vbrtag.h
+newmdct.o: newmdct.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h newmdct.h
+psymodel.o: psymodel.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h psymodel.h tables.h
+quantize.o: quantize.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h quantize.h reservoir.h quantize_pvt.h
+quantize_pvt.o: quantize_pvt.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h tables.h reservoir.h quantize_pvt.h
+reservoir.o: reservoir.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h reservoir.h
+tables.o: tables.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h tables.h
+takehiro.o: takehiro.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h tables.h quantize_pvt.h
+tool.o: tool.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h tool.h lame.h vbrtag.h gogo_io.h
+util.o: util.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h util.h
+vbrtag.o: vbrtag.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h vbrtag.h bitstream.h
+
+main.o: ../main.c common.h gogo.h global.h tool.h cpu.h
+ ${CC} -c -I../engine $(CFLAGS) -I../engine $< -o $@
+
+test: $(TARGET)
+ ./$(TARGET) -test 10 -q 0
+ ./$(TARGET) -test 10 -q 5
+ ./$(TARGET) -test 10 -q 9
+ ./$(TARGET) -test 10 -a -q 0 -b 160
+ ./$(TARGET) -test 10 -a -q 5 -b 192
+ ./$(TARGET) -test 10 -a -q 9 -b 256
+ ./$(TARGET) -test 10 -v 0 -vb 40 256
+ ./$(TARGET) -test 10 -v 5 -q 1
+ ./$(TARGET) -test 10 -v 9 -vb 160 320
+ ./$(TARGET) -test 10 -s 2 -b 64
+ ./$(TARGET) -test 10 -s 999 -b 32
diff --git a/audio/gogo-petit/files/patch-FreeBSD-Makefile b/audio/gogo-petit/files/patch-FreeBSD-Makefile
deleted file mode 100644
index 9a78dfa98690..000000000000
--- a/audio/gogo-petit/files/patch-FreeBSD-Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
---- Makefile.orig Tue Jul 6 15:16:18 2004
-+++ Makefile Tue Jul 6 15:25:20 2004
-@@ -7,7 +7,7 @@
- #
- #######################################################
-
--TARGET = gogo
-+TARGET = gogo-petit
-
- #######################################################
-
-@@ -150,7 +150,8 @@
- #global.h : common.h gogo.h l3side.h
- #l3side.h: encoder.h machine.h
-
--../engine/i386/global.cfg : $(MAKECFG) global.h
-+global.cfg : $(MAKECFG) global.h
-+ gcc -pipe -I../engine ../engine/i386/makecfg.c -o $(MAKECFG)
- ./$(MAKECFG) > ../engine/i386/global.cfg
-
- thread.o : thread.c config.h global.h common.h gogo.h l3side.h encoder.h machine.h thread.h ../pthread/thread.c
diff --git a/audio/gogo-petit/files/patch-engine_i386_fftsse.nas b/audio/gogo-petit/files/patch-engine_i386_fftsse.nas
new file mode 100644
index 000000000000..3f78225ce1f2
--- /dev/null
+++ b/audio/gogo-petit/files/patch-engine_i386_fftsse.nas
@@ -0,0 +1,25 @@
+--- ../engine/i386/fftsse.nas.orig 2008-04-17 05:53:06.929178210 -0400
++++ ../engine/i386/fftsse.nas 2008-04-17 05:54:58.927590299 -0400
+@@ -23,14 +23,14 @@
+ Q_SQRT2 dd 1.41421356237, 1.41421356237, 1.41421356237, 1.41421356237
+
+ Q_1 dd 1.0, 1.0, 1.0, 1.0
+-costab dd 9.238795325112867e-01F, 9.238795325112867e-01F, 9.238795325112867e-01F, 9.238795325112867e-01F
+- dd 3.826834323650898e-01F, 3.826834323650898e-01F, 3.826834323650898e-01F, 3.826834323650898e-01F
+- dd 9.951847266721969e-01F, 9.951847266721969e-01F, 9.951847266721969e-01F, 9.951847266721969e-01F
+- dd 9.801714032956060e-02F, 9.801714032956060e-02F, 9.801714032956060e-02F, 9.801714032956060e-02F
+- dd 9.996988186962042e-01F, 9.996988186962042e-01F, 9.996988186962042e-01F, 9.996988186962042e-01F
+- dd 2.454122852291229e-02F, 2.454122852291229e-02F, 2.454122852291229e-02F, 2.454122852291229e-02F
+- dd 9.999811752826011e-01F, 9.999811752826011e-01F, 9.999811752826011e-01F, 9.999811752826011e-01F
+- dd 6.135884649154475e-03F, 6.135884649154475e-03F, 6.135884649154475e-03F, 6.135884649154475e-03F
++costab dd 9.238795325112867e-1, 9.238795325112867e-1, 9.238795325112867e-1, 9.238795325112867e-1
++ dd 3.826834323650898e-1, 3.826834323650898e-1, 3.826834323650898e-1, 3.826834323650898e-1
++ dd 9.951847266721969e-1, 9.951847266721969e-1, 9.951847266721969e-1, 9.951847266721969e-1
++ dd 9.801714032956060e-2, 9.801714032956060e-2, 9.801714032956060e-2, 9.801714032956060e-2
++ dd 9.996988186962042e-1, 9.996988186962042e-1, 9.996988186962042e-1, 9.996988186962042e-1
++ dd 2.454122852291229e-2, 2.454122852291229e-2, 2.454122852291229e-2, 2.454122852291229e-2
++ dd 9.999811752826011e-1, 9.999811752826011e-1, 9.999811752826011e-1, 9.999811752826011e-1
++ dd 6.135884649154475e-3, 6.135884649154475e-3, 6.135884649154475e-3, 6.135884649154475e-3
+
+ align 32
+ revLongInit db 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
diff --git a/audio/gogo-petit/pkg-descr b/audio/gogo-petit/pkg-descr
index 520d2452af45..971e21f6b392 100644
--- a/audio/gogo-petit/pkg-descr
+++ b/audio/gogo-petit/pkg-descr
@@ -1,10 +1,8 @@
-GOGO-no-coda-petit is new variant of well-known GOGO-no-coda
-mp3 encoder optimized with MMX, 3DNow!, Enhanced 3DNow! and SSE
+GOGO-no-coda-petit is a new variant of the well-known GOGO-no-coda
+mp3 encoder, optimized for MMX, 3DNow!, Enhanced 3DNow! and SSE
+capable CPUs.
-*** DO NOT OVERCLOCK YOUR CPUs ***
-GOGO heavily uses the part of processors that almost sleeps in usual,
-so makes them very hot even it runs standard clock.
-Overclocking may cause serious internal errors and crazy results.
-Or you need gigantic heatsink and extra-noisy fans. :-)
+** WARNING: USE OF THIS ENCODER WITH OVERCLOCKED CPUS CAN RESULT **
+** IN SERIOUS OVERHEATING PROBLEMS! **
WWW: http://homepage2.nifty.com/kei-i/