o Add optimizations if WITH_OPTIMIZED_CFLAGS [1]

o Make it CFLAGS safe (I have no idea how this escaped me)
o Unless WITHOUT_LIBA52, use liba52 port instead of ffmpeg liba52
  code. The liba52 port is more optimized.
o Use FreeBSD byteswap optimized routines IF one happens to be using
  either FreeBSD 4.7-RELEASE or later
o Do not bump PORTREVISION

Submitted by:	"Steve O'Hara-Smith" <steve@sohara.org> [1]
Reviewed by:	"Steve O'Hara-Smith" <steve@sohara.org>
This commit is contained in:
Mario Sergio Fujikawa Ferreira 2002-11-03 07:01:44 +00:00
parent a23fe2469b
commit 77072d0212
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=69328
8 changed files with 280 additions and 4 deletions

View file

@ -26,7 +26,6 @@ USE_GMAKE= yes
USE_REINPLACE= yes
CONFIGURE_ARGS= --cc="${CC}" --prefix="${PREFIX}" \
--make="${GMAKE}" --enable-shared \
--extra-cflags="-I${LOCALBASE}/include" \
--extra-libs="-lm -L${LOCALBASE}/lib"
PLIST_SUB= SHLIB_VERSION=${SHLIB_VERSION}
INSTALLS_SHLIB= yes
@ -58,6 +57,16 @@ WITH_VORBIS=yes
## support activation
##
## disable a52
.ifndef(WITHOUT_A52)
LIB_DEPENDS+= a52.0:${PORTSDIR}/audio/liba52
CONFIGURE_ARGS+= --enable-a52 \
--enable-a52bin
.else
CONFIGURE_ARGS+= --enable-a52 \
--disable-a52bin
.endif
## disable mmx
.ifdef(WITHOUT_MMX)
CONFIGURE_ARGS+= --disable-mmx
@ -68,6 +77,13 @@ LIB_DEPENDS+= mp3lame.0:${PORTSDIR}/audio/lame
CONFIGURE_ARGS+= --enable-mp3lame
.endif
## optimization
.ifdef(WITH_OPTIMIZED_CFLAGS)
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
-O3 -ffast-math -fomit-frame-pointer"
.else
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
.endif
## vorbis
.ifdef(WITH_VORBIS)
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
@ -76,12 +92,20 @@ CONFIGURE_ARGS+= --enable-vorbis
.endif
pre-everything::
.ifndef(WITHOUT_LIBA52)
@${ECHO_MSG} "You can disable liba52 support by defining WITHOUT_LIBA52"
.endif
.ifndef(WITHOUT_MMX)
@${ECHO_MSG} "Define WITHOUT_MMX if your system does not support MMX"
.endif
.ifndef(WITH_MP3)
@${ECHO_MSG} 'Define WITH_MP3 to enable lame MP3 codec'
.endif
.ifndef(WITH_OPTIMIZED_CFLAGS)
@${ECHO_MSG}
@${ECHO_MSG} 'You can enable additional compilation optimizations'
@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
.endif
.ifndef(WITH_VORBIS)
@${ECHO_MSG} 'Define WITH_VORBIS to enable libvorbisenc VORBIS codec'
.endif
@ -118,6 +142,10 @@ post-patch:
"s!VIDEO_INPUT METEOR_INPUT_DEV0!VIDEO_INPUT METEOR_INPUT_DEV${WITH_BKTR_DEV}!" \
${WRKSRC}/libav/grab_bsdbktr.c
.endif
.ifndef(WITHOUT_LIBA52)
@${REINPLACE_CMD} -e 's|-ldl||' \
${WRKSRC}/configure
.endif
post-install:
.ifndef(NOPORTDOCS)

View file

@ -0,0 +1,41 @@
--- libavcodec/bswap.h.orig Sun Nov 3 04:51:51 2002
+++ libavcodec/bswap.h Sun Nov 3 04:53:30 2002
@@ -5,6 +5,14 @@
#include <byteswap.h>
#else
+#if (defined(BSD) && (BSD >= 199103))
+#include <sys/param.h>
+#endif
+
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#include <sys/endian.h>
+#endif
+
#ifdef ARCH_X86
inline static unsigned short ByteSwap16(unsigned short x)
{
@@ -13,7 +21,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_16(x) (be16toh(x))
+#else
#define bswap_16(x) ByteSwap16(x)
+#endif
inline static unsigned int ByteSwap32(unsigned int x)
{
@@ -29,7 +41,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_32(x) (be32toh(x))
+#else
#define bswap_32(x) ByteSwap32(x)
+#endif
inline static unsigned long long int ByteSwap64(unsigned long long int x)
{

View file

@ -26,7 +26,6 @@ USE_GMAKE= yes
USE_REINPLACE= yes
CONFIGURE_ARGS= --cc="${CC}" --prefix="${PREFIX}" \
--make="${GMAKE}" --enable-shared \
--extra-cflags="-I${LOCALBASE}/include" \
--extra-libs="-lm -L${LOCALBASE}/lib"
PLIST_SUB= SHLIB_VERSION=${SHLIB_VERSION}
INSTALLS_SHLIB= yes
@ -58,6 +57,16 @@ WITH_VORBIS=yes
## support activation
##
## disable a52
.ifndef(WITHOUT_A52)
LIB_DEPENDS+= a52.0:${PORTSDIR}/audio/liba52
CONFIGURE_ARGS+= --enable-a52 \
--enable-a52bin
.else
CONFIGURE_ARGS+= --enable-a52 \
--disable-a52bin
.endif
## disable mmx
.ifdef(WITHOUT_MMX)
CONFIGURE_ARGS+= --disable-mmx
@ -68,6 +77,13 @@ LIB_DEPENDS+= mp3lame.0:${PORTSDIR}/audio/lame
CONFIGURE_ARGS+= --enable-mp3lame
.endif
## optimization
.ifdef(WITH_OPTIMIZED_CFLAGS)
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
-O3 -ffast-math -fomit-frame-pointer"
.else
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
.endif
## vorbis
.ifdef(WITH_VORBIS)
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
@ -76,12 +92,20 @@ CONFIGURE_ARGS+= --enable-vorbis
.endif
pre-everything::
.ifndef(WITHOUT_LIBA52)
@${ECHO_MSG} "You can disable liba52 support by defining WITHOUT_LIBA52"
.endif
.ifndef(WITHOUT_MMX)
@${ECHO_MSG} "Define WITHOUT_MMX if your system does not support MMX"
.endif
.ifndef(WITH_MP3)
@${ECHO_MSG} 'Define WITH_MP3 to enable lame MP3 codec'
.endif
.ifndef(WITH_OPTIMIZED_CFLAGS)
@${ECHO_MSG}
@${ECHO_MSG} 'You can enable additional compilation optimizations'
@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
.endif
.ifndef(WITH_VORBIS)
@${ECHO_MSG} 'Define WITH_VORBIS to enable libvorbisenc VORBIS codec'
.endif
@ -118,6 +142,10 @@ post-patch:
"s!VIDEO_INPUT METEOR_INPUT_DEV0!VIDEO_INPUT METEOR_INPUT_DEV${WITH_BKTR_DEV}!" \
${WRKSRC}/libav/grab_bsdbktr.c
.endif
.ifndef(WITHOUT_LIBA52)
@${REINPLACE_CMD} -e 's|-ldl||' \
${WRKSRC}/configure
.endif
post-install:
.ifndef(NOPORTDOCS)

View file

@ -0,0 +1,41 @@
--- libavcodec/bswap.h.orig Sun Nov 3 04:51:51 2002
+++ libavcodec/bswap.h Sun Nov 3 04:53:30 2002
@@ -5,6 +5,14 @@
#include <byteswap.h>
#else
+#if (defined(BSD) && (BSD >= 199103))
+#include <sys/param.h>
+#endif
+
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#include <sys/endian.h>
+#endif
+
#ifdef ARCH_X86
inline static unsigned short ByteSwap16(unsigned short x)
{
@@ -13,7 +21,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_16(x) (be16toh(x))
+#else
#define bswap_16(x) ByteSwap16(x)
+#endif
inline static unsigned int ByteSwap32(unsigned int x)
{
@@ -29,7 +41,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_32(x) (be32toh(x))
+#else
#define bswap_32(x) ByteSwap32(x)
+#endif
inline static unsigned long long int ByteSwap64(unsigned long long int x)
{

View file

@ -26,7 +26,6 @@ USE_GMAKE= yes
USE_REINPLACE= yes
CONFIGURE_ARGS= --cc="${CC}" --prefix="${PREFIX}" \
--make="${GMAKE}" --enable-shared \
--extra-cflags="-I${LOCALBASE}/include" \
--extra-libs="-lm -L${LOCALBASE}/lib"
PLIST_SUB= SHLIB_VERSION=${SHLIB_VERSION}
INSTALLS_SHLIB= yes
@ -58,6 +57,16 @@ WITH_VORBIS=yes
## support activation
##
## disable a52
.ifndef(WITHOUT_A52)
LIB_DEPENDS+= a52.0:${PORTSDIR}/audio/liba52
CONFIGURE_ARGS+= --enable-a52 \
--enable-a52bin
.else
CONFIGURE_ARGS+= --enable-a52 \
--disable-a52bin
.endif
## disable mmx
.ifdef(WITHOUT_MMX)
CONFIGURE_ARGS+= --disable-mmx
@ -68,6 +77,13 @@ LIB_DEPENDS+= mp3lame.0:${PORTSDIR}/audio/lame
CONFIGURE_ARGS+= --enable-mp3lame
.endif
## optimization
.ifdef(WITH_OPTIMIZED_CFLAGS)
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
-O3 -ffast-math -fomit-frame-pointer"
.else
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
.endif
## vorbis
.ifdef(WITH_VORBIS)
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
@ -76,12 +92,20 @@ CONFIGURE_ARGS+= --enable-vorbis
.endif
pre-everything::
.ifndef(WITHOUT_LIBA52)
@${ECHO_MSG} "You can disable liba52 support by defining WITHOUT_LIBA52"
.endif
.ifndef(WITHOUT_MMX)
@${ECHO_MSG} "Define WITHOUT_MMX if your system does not support MMX"
.endif
.ifndef(WITH_MP3)
@${ECHO_MSG} 'Define WITH_MP3 to enable lame MP3 codec'
.endif
.ifndef(WITH_OPTIMIZED_CFLAGS)
@${ECHO_MSG}
@${ECHO_MSG} 'You can enable additional compilation optimizations'
@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
.endif
.ifndef(WITH_VORBIS)
@${ECHO_MSG} 'Define WITH_VORBIS to enable libvorbisenc VORBIS codec'
.endif
@ -118,6 +142,10 @@ post-patch:
"s!VIDEO_INPUT METEOR_INPUT_DEV0!VIDEO_INPUT METEOR_INPUT_DEV${WITH_BKTR_DEV}!" \
${WRKSRC}/libav/grab_bsdbktr.c
.endif
.ifndef(WITHOUT_LIBA52)
@${REINPLACE_CMD} -e 's|-ldl||' \
${WRKSRC}/configure
.endif
post-install:
.ifndef(NOPORTDOCS)

View file

@ -0,0 +1,41 @@
--- libavcodec/bswap.h.orig Sun Nov 3 04:51:51 2002
+++ libavcodec/bswap.h Sun Nov 3 04:53:30 2002
@@ -5,6 +5,14 @@
#include <byteswap.h>
#else
+#if (defined(BSD) && (BSD >= 199103))
+#include <sys/param.h>
+#endif
+
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#include <sys/endian.h>
+#endif
+
#ifdef ARCH_X86
inline static unsigned short ByteSwap16(unsigned short x)
{
@@ -13,7 +21,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_16(x) (be16toh(x))
+#else
#define bswap_16(x) ByteSwap16(x)
+#endif
inline static unsigned int ByteSwap32(unsigned int x)
{
@@ -29,7 +41,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_32(x) (be32toh(x))
+#else
#define bswap_32(x) ByteSwap32(x)
+#endif
inline static unsigned long long int ByteSwap64(unsigned long long int x)
{

View file

@ -26,7 +26,6 @@ USE_GMAKE= yes
USE_REINPLACE= yes
CONFIGURE_ARGS= --cc="${CC}" --prefix="${PREFIX}" \
--make="${GMAKE}" --enable-shared \
--extra-cflags="-I${LOCALBASE}/include" \
--extra-libs="-lm -L${LOCALBASE}/lib"
PLIST_SUB= SHLIB_VERSION=${SHLIB_VERSION}
INSTALLS_SHLIB= yes
@ -58,6 +57,16 @@ WITH_VORBIS=yes
## support activation
##
## disable a52
.ifndef(WITHOUT_A52)
LIB_DEPENDS+= a52.0:${PORTSDIR}/audio/liba52
CONFIGURE_ARGS+= --enable-a52 \
--enable-a52bin
.else
CONFIGURE_ARGS+= --enable-a52 \
--disable-a52bin
.endif
## disable mmx
.ifdef(WITHOUT_MMX)
CONFIGURE_ARGS+= --disable-mmx
@ -68,6 +77,13 @@ LIB_DEPENDS+= mp3lame.0:${PORTSDIR}/audio/lame
CONFIGURE_ARGS+= --enable-mp3lame
.endif
## optimization
.ifdef(WITH_OPTIMIZED_CFLAGS)
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
-O3 -ffast-math -fomit-frame-pointer"
.else
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
.endif
## vorbis
.ifdef(WITH_VORBIS)
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
@ -76,12 +92,20 @@ CONFIGURE_ARGS+= --enable-vorbis
.endif
pre-everything::
.ifndef(WITHOUT_LIBA52)
@${ECHO_MSG} "You can disable liba52 support by defining WITHOUT_LIBA52"
.endif
.ifndef(WITHOUT_MMX)
@${ECHO_MSG} "Define WITHOUT_MMX if your system does not support MMX"
.endif
.ifndef(WITH_MP3)
@${ECHO_MSG} 'Define WITH_MP3 to enable lame MP3 codec'
.endif
.ifndef(WITH_OPTIMIZED_CFLAGS)
@${ECHO_MSG}
@${ECHO_MSG} 'You can enable additional compilation optimizations'
@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
.endif
.ifndef(WITH_VORBIS)
@${ECHO_MSG} 'Define WITH_VORBIS to enable libvorbisenc VORBIS codec'
.endif
@ -118,6 +142,10 @@ post-patch:
"s!VIDEO_INPUT METEOR_INPUT_DEV0!VIDEO_INPUT METEOR_INPUT_DEV${WITH_BKTR_DEV}!" \
${WRKSRC}/libav/grab_bsdbktr.c
.endif
.ifndef(WITHOUT_LIBA52)
@${REINPLACE_CMD} -e 's|-ldl||' \
${WRKSRC}/configure
.endif
post-install:
.ifndef(NOPORTDOCS)

View file

@ -0,0 +1,41 @@
--- libavcodec/bswap.h.orig Sun Nov 3 04:51:51 2002
+++ libavcodec/bswap.h Sun Nov 3 04:53:30 2002
@@ -5,6 +5,14 @@
#include <byteswap.h>
#else
+#if (defined(BSD) && (BSD >= 199103))
+#include <sys/param.h>
+#endif
+
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#include <sys/endian.h>
+#endif
+
#ifdef ARCH_X86
inline static unsigned short ByteSwap16(unsigned short x)
{
@@ -13,7 +21,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_16(x) (be16toh(x))
+#else
#define bswap_16(x) ByteSwap16(x)
+#endif
inline static unsigned int ByteSwap32(unsigned int x)
{
@@ -29,7 +41,11 @@
"0" (x));
return x;
}
+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000
+#define bswap_32(x) (be32toh(x))
+#else
#define bswap_32(x) ByteSwap32(x)
+#endif
inline static unsigned long long int ByteSwap64(unsigned long long int x)
{