From 958a967d28fa1bb484deb288ba4bc2d08286d0a1 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Tue, 11 Jan 2011 19:19:09 -0800 Subject: [PATCH] Enable build on NetBSD (3090684) --- configure | 10 +++++++++- src/mlt++/configure | 2 +- src/modules/avformat/configure | 2 +- src/modules/kino/endian_types.h | 14 +++++--------- src/modules/kino/riff.cc | 3 --- src/modules/qimage/configure | 2 +- src/modules/sox/configure | 2 +- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/configure b/configure index af159a50..c36779c4 100755 --- a/configure +++ b/configure @@ -97,6 +97,14 @@ build_config() echo "RDYNAMIC=-rdynamic" echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed" ;; + NetBSD) + [ "$(uname -m)" = "amd64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64" + echo "OPTIMISATIONS+=-ffast-math" + echo "CFLAGS+=-pthread" + echo "SHFLAGS=-shared" + echo "RDYNAMIC=-rdynamic" + echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed" + ;; *) ;; esac @@ -171,7 +179,7 @@ case $targetos in Darwin) LIBSUF=".dylib" ;; - Linux|FreeBSD) + Linux|FreeBSD|NetBSD) LIBSUF=".so" ;; *) diff --git a/src/mlt++/configure b/src/mlt++/configure index e83b6ed1..e7c0de62 100755 --- a/src/mlt++/configure +++ b/src/mlt++/configure @@ -11,7 +11,7 @@ case $targetos in echo "CXXFLAGS+=-D__DARWIN__ -Wall -fPIC" echo "LIBFLAGS=-dynamiclib -single_module" ;; - Linux|FreeBSD) + Linux|FreeBSD|NetBSD) echo LIBSUF=.so echo "CXXFLAGS+=-Wall $WARNINGS -fPIC -DPIC" echo "LIBFLAGS=-shared" diff --git a/src/modules/avformat/configure b/src/modules/avformat/configure index 654133b7..29e13ad6 100755 --- a/src/modules/avformat/configure +++ b/src/modules/avformat/configure @@ -36,7 +36,7 @@ else Darwin) export LIBSUF=.dylib ;; - Linux|FreeBSD) + Linux|FreeBSD|NetBSD) export LIBSUF=.so ;; *) diff --git a/src/modules/kino/endian_types.h b/src/modules/kino/endian_types.h index d66cdb65..7d4ab868 100644 --- a/src/modules/kino/endian_types.h +++ b/src/modules/kino/endian_types.h @@ -28,30 +28,26 @@ #define _ENDIAN_TYPES_H /* Needed for BYTE_ORDER and BIG/LITTLE_ENDIAN macros. */ +#if !defined(__FreeBSD__) && !defined(__NetBSD__) #ifndef _BSD_SOURCE # define _BSD_SOURCE -#ifndef __FreeBSD__ # include -#else -# include -#endif /* __FreeBSD__ */ # undef _BSD_SOURCE #else -#ifndef __FreeBSD__ # include +#endif #else # include -#endif /* __FreeBSD__ */ -#endif +#endif /* !defined(__FreeBSD__) && !defined(__NetBSD__) */ #include -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__NetBSD__) #include #else #define bswap_16(x) bswap16(x) #define bswap_32(x) bswap32(x) #define bswap_64(x) bswap64(x) -#endif /* __FreeBSD__ */ +#endif /* !defined(__FreeBSD__) && !defined(__NetBSD__) */ static inline int8_t bswap(const int8_t& x) { diff --git a/src/modules/kino/riff.cc b/src/modules/kino/riff.cc index 6a57b87e..efd91d61 100644 --- a/src/modules/kino/riff.cc +++ b/src/modules/kino/riff.cc @@ -25,9 +25,6 @@ //#include #include #include -#ifndef __FreeBSD__ -#include -#endif /* __FreeBSD__ */ using std::cout; using std::hex; diff --git a/src/modules/qimage/configure b/src/modules/qimage/configure index d33c1fef..8f1a6ad7 100755 --- a/src/modules/qimage/configure +++ b/src/modules/qimage/configure @@ -24,7 +24,7 @@ else Darwin) export LIBSUF=.dylib ;; - Linux|FreeBSD) + Linux|FreeBSD|NetBSD) export LIBSUF=.so ;; *) diff --git a/src/modules/sox/configure b/src/modules/sox/configure index 9df730af..c1790be0 100755 --- a/src/modules/sox/configure +++ b/src/modules/sox/configure @@ -8,7 +8,7 @@ then Darwin) LDD="otool -L" ;; - Linux|FreeBSD) + Linux|FreeBSD|NetBSD) LDD="ldd" ;; *) -- 2.39.5