echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
echo " --enable-dts enable GPLed DTS support [default=no]"
echo " --enable-pp enable GPLed postprocessing support [default=no]"
+echo " --enable-static build static libraries [default=yes]"
+echo " --disable-static do not build static libraries [default=no]"
echo " --enable-shared build shared libraries [default=no]"
+echo " --disable-shared do not build shared libraries [default=yes]"
echo " --enable-amr_nb enable amr_nb float audio codec"
echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
echo " --enable-amr_wb enable amr_wb float audio codec"
mingwce="no"
cygwin="no"
os2="no"
+lstatic="yes"
lshared="no"
optimize="yes"
debug="yes"
;;
--enable-mingwce) mingwce="yes"
;;
+ --enable-static) lstatic="yes"
+ ;;
+ --disable-static) lstatic="no"
+ ;;
--enable-shared) lshared="yes"
;;
+ --disable-shared) lshared="no"
+ ;;
--disable-debug) debug="no"
;;
--disable-opts) optimize="no"
esac
done
+# we need to build at least one lib type
+if test "$lstatic" = "no" && test "$lshared" = "no" ; then
+ cat <<EOF
+At least one library type must be built.
+Specify --enable-static to build the static libraries or --enable-shared to
+build the shared libraries as well. To only build the shared libraries specify
+--disable-static in addition to --enable-shared.
+EOF
+ exit 1;
+fi
+
if test "$theora" = "yes" ; then
if test "$libogg" = "no"; then
echo "libogg must be enabled to enable Theora."
fi
if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
+ if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
+ cat <<EOF
+You can only build one library type at once on MinGW.
+Specify --disable-static --enable-shared to only build
+the shared libraries. To build only the static libraries
+you don't need to pass additional options.
+EOF
+ exit 1
+ fi
v4l="no"
bktr="no"
audio_oss="no"
echo "debug symbols $debug"
echo "strip symbols $dostrip"
echo "optimize $optimize"
+echo "static $lstatic"
echo "shared $lshared"
echo "video hooking $vhook"
echo "SDL support $sdl"
echo "BUILDSUF=$BUILDSUF" >> config.mak
echo "LIBPREF=$LIBPREF" >> config.mak
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
-echo "LIB=$LIB" >> config.mak
+if test "$lstatic" = "yes" ; then
+ echo "LIB=$LIB" >> config.mak
+fi
echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
if test "$lshared" = "yes" ; then
+ echo "#define BUILD_SHARED_AV 1" >> $TMPH
echo "BUILD_SHARED=yes" >> config.mak
echo "PIC=-fPIC -DPIC" >> config.mak
echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
#FIXME: This should be in configure/config.mak
ifeq ($(CONFIG_WIN32),yes)
- LDFLAGS=-Wl,--output-def,$(@:.dll=.def)
+ LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a)
endif
OBJS= utils.o cutils.o os_support.o allformats.o
g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
clean:
- rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
+ rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
+ *.lib *.def *.dll.a *.exp
distclean: clean
rm -f .depend
VPATH=$(SRC_PATH)/libavutil
# NOTE: -I.. is needed to include config.h
-CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -DBUILD_AVUTIL -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
#FIXME: This should be in configure/config.mak
ifeq ($(CONFIG_WIN32),yes)
- LDFLAGS=-Wl,--output-def,$(@:.dll=.def)
+ LDFLAGS=-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a)
endif
OBJS= mathematics.o \
dep: depend
clean:
- rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll
+ rm -f *.o *.d *~ *.a *.lib *.so *.dylib *.dll \
+ *.lib *.def *.dll.a *.exp
distclean: clean
rm -f .depend
#ifdef HAVE_AV_CONFIG_H
+#if defined(__MINGW32__) && !defined(BUILD_AVUTIL) && defined(BUILD_SHARED_AV)
+# define FF_IMPORT_ATTR __declspec(dllimport)
+#else
+# define FF_IMPORT_ATTR
+#endif
+
+
# include "bswap.h"
// Use rip-relative addressing if compiling PIC code on x86-64.
#endif
/* misc math functions */
-extern const uint8_t ff_log2_tab[256];
+extern FF_IMPORT_ATTR const uint8_t ff_log2_tab[256];
static inline int av_log2(unsigned int v)
{
}
/* math */
-extern const uint8_t ff_sqrt_tab[128];
+extern FF_IMPORT_ATTR const uint8_t ff_sqrt_tab[128];
int64_t ff_gcd(int64_t a, int64_t b);