Opened 4 years ago

Closed 4 years ago

#1968 closed defect (invalid)

./configure --enable-shared --enable-static behavior odd.

Reported by: rogerdpack Owned by:
Priority: normal Component: build system
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no



I would expect that if I pass
ffmpeg $ ./configure --enable-shared --enable-static

that it would either
1) choose the latter of the 2, or
2) fail out, proclaiming that it has been passed conflicting instruction.

It appears that today, if I pass it this, it builds a shared build, effectively ignoring the "--enable-static" directive. At least for mingw32-cross compiler.


Summary of the bug:
How to reproduce:

% ffmpeg -i input ... output
ffmpeg version
built on ...

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (8)

comment:1 Changed 4 years ago by cehoyos

  • Component changed from undetermined to build system

(Since it works fine here)
Please add the following information for build problems:
Compiler version (gcc -v)
(minimal) configure line including output until the empty line after "makeinfo enabled"

I suspect that --enable-static is always ignored.

comment:2 follow-up: Changed 4 years ago by rogerdpack

I didn't see a "makeinfo enabled" message buthere's my atempt...

i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO

configuring ffmpeg_git as $ PATH=/home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-i686/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ./configure --arch=x86 --target-os=mingw32 --cross-prefix=/home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --enable-shared --enable-static --enable-runtime-cpudetect
install prefix            /usr/local
source path               .
C compiler                /home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-i686/bin/i686-w64-mingw32-gcc
ARCH                      x86 (generic)
big-endian                no
runtime cpu detection     yes
yasm                      yes
MMX enabled               yes
MMXEXT enabled            yes
3DNow! enabled            yes
3DNow! extended enabled   yes
SSE enabled               yes
SSSE3 enabled             yes
AVX enabled               yes
FMA4 enabled              yes
CMOV enabled              no
CMOV is fast              no
EBX available             yes
EBP available             yes
debug symbols             yes
strip symbols             yes
optimize for size         no
optimizations             yes
static                    yes
shared                    yes
postprocessing support    no
new filter support        yes
network support           yes
threading support         w32threads
safe bitstream reader     yes
SDL support               yes
libdxva2 enabled          yes
libva enabled             no
libvdpau enabled          no
AVISynth enabled          no
frei0r enabled            no
gnutls enabled            no
libaacplus enabled        no
libass enabled            no
libcaca enabled           no
libcdio support           no
libcelt enabled           no
libdc1394 support         no
libfaac enabled           no
libfdk-aac enabled        no
libgsm enabled            no
libiec61883 support       no
libilbc enabled           no
libmodplug enabled        no
libmp3lame enabled        no
libnut enabled            no
libopencore-amrnb support no
libopencore-amrwb support no
libopencv support         no
libopenjpeg enabled       no
libopus enabled           no
libpulse enabled          no
librtmp enabled           no
libschroedinger enabled   no
libspeex enabled          no
libstagefright-h264 enabled    no
libtheora enabled         no
libtwolame enabled        no
libutvideo enabled        no
libv4l2 enabled           no
libvo-aacenc support      no
libvo-amrwbenc support    no
libvorbis enabled         no
libvpx enabled            no
libx264 enabled           no
libxavs enabled           no
libxvid enabled           no
openal enabled            no
openssl enabled           no
zlib enabled              yes
bzlib enabled             yes
texi2html enabled         no
perl enabled              yes
pod2man enabled           yes
makeinfo enabled          no

Enabled decoders:
aac			c93			indeo4
aac_latm		cavs			indeo5
aasc			cdgraphics		interplay_dpcm
ac3			cdxl			interplay_video
adpcm_4xm		cinepak			jacosub
adpcm_adx		cljr			jpeg2000
adpcm_afc		cllc			jpegls
adpcm_ct		comfortnoise		jv
adpcm_ea		cook			kgv1
adpcm_ea_maxis_xa	cpia			kmvc
adpcm_ea_r1		cscd			lagarith
adpcm_ea_r2		cyuv			loco
adpcm_ea_r3		dca			mace3
adpcm_ea_xas		dfa			mace6
adpcm_g722		dirac			mdec
adpcm_g726		dnxhd			microdvd
adpcm_ima_amv		dpx			mimic
adpcm_ima_apc		dsicinaudio		mjpeg
adpcm_ima_dk3		dsicinvideo		mjpegb
adpcm_ima_dk4		dvbsub			mlp
adpcm_ima_ea_eacs	dvdsub			mmvideo
adpcm_ima_ea_sead	dvvideo			motionpixels
adpcm_ima_iss		dxa			movtext
adpcm_ima_oki		dxtory			mp1
adpcm_ima_qt		eac3			mp1float
adpcm_ima_smjpeg	eacmv			mp2
adpcm_ima_wav		eamad			mp2float
adpcm_ima_ws		eatgq			mp3
adpcm_ms		eatgv			mp3adu
adpcm_sbpro_2		eatqi			mp3adufloat
adpcm_sbpro_3		eightbps		mp3float
adpcm_sbpro_4		eightsvx_exp		mp3on4
adpcm_swf		eightsvx_fib		mp3on4float
adpcm_thp		escape124		mpc7
adpcm_xa		escape130		mpc8
adpcm_yamaha		exr			mpeg1video
alac			ffv1			mpeg2video
als			ffvhuff			mpeg4
amrnb			ffwavesynth		mpegvideo
amrwb			flac			msa1
amv			flashsv			msmpeg4v1
anm			flashsv2		msmpeg4v2
ansi			flic			msmpeg4v3
ape			flv			msrle
ass			fourxm			mss1
asv1			fraps			mss2
asv2			frwu			msvideo1
atrac1			g723_1			mszh
atrac3			g729			mts2
aura			gif			mxpeg
aura2			gsm			nellymoser
avrn			gsm_ms			nuv
avrp			h261			paf_audio
avs			h263			paf_video
avui			h263i			pam
ayuv			h263p			pbm
bethsoftvid		h264			pcm_alaw
bfi			huffyuv			pcm_bluray
bink			iac			pcm_dvd
binkaudio_dct		idcin			pcm_f32be
binkaudio_rdft		idf			pcm_f32le
bintext			iff_byterun1		pcm_f64be
bmp			iff_ilbm		pcm_f64le
bmv_audio		imc			pcm_lxf
bmv_video		indeo2			pcm_mulaw
brender_pix		indeo3			pcm_s16be
pcm_s16be_planar	rv20			v410
pcm_s16le		rv30			vb
pcm_s16le_planar	rv40			vble
pcm_s24be		s302m			vc1
pcm_s24daud		sami			vc1image
pcm_s24le		sanm			vcr1
pcm_s24le_planar	sgi			vima
pcm_s32be		shorten			vmdaudio
pcm_s32le		sipr			vmdvideo
pcm_s32le_planar	smackaud		vmnc
pcm_s8			smacker			vorbis
pcm_s8_planar		smc			vp3
pcm_u16be		snow			vp5
pcm_u16le		sol_dpcm		vp6
pcm_u24be		sonic			vp6a
pcm_u24le		sp5x			vp6f
pcm_u32be		srt			vp8
pcm_u32le		subrip			vqa
pcm_u8			subviewer		wavpack
pcm_zork		sunrast			webvtt
pcx			svq1			wmalossless
pgm			svq3			wmapro
pgmyuv			tak			wmav1
pgssub			targa			wmav2
pictor			targa_y216		wmavoice
png			text			wmv1
ppm			theora			wmv2
prores			thp			wmv3
prores_lgpl		tiertexseqvideo		wmv3image
ptx			tiff			wnv1
qcelp			tmv			ws_snd1
qdm2			truehd			xan_dpcm
qdraw			truemotion1		xan_wc3
qpeg			truemotion2		xan_wc4
qtrle			truespeech		xbin
r10k			tscc			xbm
r210			tscc2			xface
ra_144			tta			xl
ra_288			twinvq			xsub
ralf			txd			xwd
rawvideo		ulti			y41p
realtext		utvideo			yop
rl2			v210			yuv4
roq			v210x			zerocodec
roq_dpcm		v308			zlib
rpza			v408			zmbv

Enabled encoders:
a64multi		jpeg2000		pgmyuv
a64multi5		jpegls			png
aac			ljpeg			ppm
ac3			mjpeg			prores
ac3_fixed		movtext			prores_anatoliy
adpcm_adx		mp2			prores_kostya
adpcm_g722		mpeg1video		qtrle
adpcm_g726		mpeg2video		r10k
adpcm_ima_qt		mpeg4			r210
adpcm_ima_wav		msmpeg4v2		ra_144
adpcm_ms		msmpeg4v3		rawvideo
adpcm_swf		msvideo1		roq
adpcm_yamaha		nellymoser		roq_dpcm
alac			pam			rv10
amv			pbm			rv20
ass			pcm_alaw		sgi
asv1			pcm_f32be		snow
asv2			pcm_f32le		sonic
avrp			pcm_f64be		sonic_ls
avui			pcm_f64le		srt
ayuv			pcm_mulaw		subrip
bmp			pcm_s16be		sunrast
cljr			pcm_s16be_planar	svq1
comfortnoise		pcm_s16le		targa
dca			pcm_s16le_planar	tiff
dnxhd			pcm_s24be		utvideo
dpx			pcm_s24daud		v210
dvbsub			pcm_s24le		v308
dvdsub			pcm_s24le_planar	v408
dvvideo			pcm_s32be		v410
eac3			pcm_s32le		vorbis
ffv1			pcm_s32le_planar	wmav1
ffvhuff			pcm_s8			wmav2
flac			pcm_s8_planar		wmv1
flashsv			pcm_u16be		wmv2
flashsv2		pcm_u16le		xbm
flv			pcm_u24be		xface
g723_1			pcm_u24le		xsub
gif			pcm_u32be		xwd
h261			pcm_u32le		y41p
h263			pcm_u8			yuv4
h263p			pcx			zlib
huffyuv			pgm			zmbv

Enabled hwaccels:
h264_dxva2		vc1_dxva2		wmv3_dxva2

Enabled parsers:
aac			dvdsub			mpegvideo
aac_latm		flac			png
ac3			gsm			pnm
adx			h261			rv30
bmp			h263			rv40
cavsvideo		h264			tak
cook			mjpeg			vc1
dca			mlp			vorbis
dirac			mpeg4video		vp3
dnxhd			mpegaudio		vp8

Enabled demuxers:
aac			iff			pcm_u32be
ac3			ilbc			pcm_u32le
act			image2			pcm_u8
adf			image2pipe		pmp
adx			ingenient		pva
aea			ipmovie			qcp
afc			iss			r3d
aiff			iv8			rawvideo
amr			ivf			realtext
anm			jacosub			rl2
apc			jv			rm
ape			latm			roq
asf			lmlm4			rpl
ass			loas			rso
ast			lvf			rtp
au			lxf			rtsp
avi			m4v			sami
avr			matroska		sap
avs			mgsts			sbg
bethsoftvid		microdvd		sdp
bfi			mjpeg			segafilm
bink			mlp			shorten
bintext			mm			siff
bit			mmf			smacker
bmv			mov			smjpeg
c93			mp3			smush
caf			mpc			sol
cavsvideo		mpc8			sox
cdg			mpegps			spdif
cdxl			mpegts			srt
daud			mpegtsraw		str
dfa			mpegvideo		subviewer
dirac			msnwc_tcp		swf
dnxhd			mtv			tak
dsicin			mvi			thp
dts			mxf			tiertexseq
dtshd			mxg			tmv
dv			nc			truehd
dxa			nsv			tta
ea			nut			tty
ea_cdata		nuv			txd
eac3			ogg			vc1
ffm			oma			vc1t
ffmetadata		paf			vmd
filmstrip		pcm_alaw		voc
flac			pcm_f32be		vqf
flic			pcm_f32le		w64
flv			pcm_f64be		wav
fourxm			pcm_f64le		wc3
g722			pcm_mulaw		webvtt
g723_1			pcm_s16be		wsaud
g729			pcm_s16le		wsvqa
gsm			pcm_s24be		wtv
gxf			pcm_s24le		wv
h261			pcm_s32be		xa
h263			pcm_s32le		xbin
h264			pcm_s8			xmv
hls			pcm_u16be		xwma
ico			pcm_u16le		yop
idcin			pcm_u24be		yuv4mpegpipe
idf			pcm_u24le

Enabled muxers:
a64			image2pipe		pcm_s16be
ac3			ipod			pcm_s16le
adts			ismv			pcm_s24be
adx			ivf			pcm_s24le
aiff			jacosub			pcm_s32be
amr			latm			pcm_s32le
asf			m4v			pcm_s8
asf_stream		matroska		pcm_u16be
ass			matroska_audio		pcm_u16le
au			md5			pcm_u24be
avi			microdvd		pcm_u24le
avm2			mjpeg			pcm_u32be
bit			mkvtimestamp_v2		pcm_u32le
caf			mlp			pcm_u8
cavsvideo		mmf			psp
crc			mov			rawvideo
daud			mp2			rm
dirac			mp3			roq
dnxhd			mp4			rso
dts			mpeg1system		rtp
dv			mpeg1vcd		rtsp
eac3			mpeg1video		sap
f4v			mpeg2dvd		segment
ffm			mpeg2svcd		smjpeg
ffmetadata		mpeg2video		smoothstreaming
filmstrip		mpeg2vob		sox
flac			mpegts			spdif
flv			mpjpeg			srt
framecrc		mxf			stream_segment
framemd5		mxf_d10			swf
g722			null			tg2
g723_1			nut			tgp
gif			ogg			truehd
gxf			oma			vc1t
h261			pcm_alaw		voc
h263			pcm_f32be		wav
h264			pcm_f32le		webm
hls			pcm_f64be		wtv
ico			pcm_f64le		wv
ilbc			pcm_mulaw		yuv4mpegpipe

Enabled protocols:
applehttp		hls			pipe
cache			http			rtmp
concat			httpproxy		rtmpt
crypto			md5			rtp
ffrtmphttp		mmsh			tcp
file			mmst			udp

Enabled filters:
aconvert		copy			pan
aevalsrc		crop			pixdesctest
afifo			deshake			removelogo
aformat			drawbox			rgbtestsrc
alphaextract		earwax			scale
alphamerge		edgedetect		select
amerge			fade			sendcmd
amix			field			setdar
amovie			fieldorder		setfield
anull			fifo			setpts
anullsink		format			setsar
anullsrc		fps			settb
aresample		framestep		showinfo
asendcmd		gradfun			showspectrum
asetnsamples		hflip			showwaves
asetpts			idet			silencedetect
asettb			join			slicify
ashowinfo		life			smptebars
asink			lut			split
asink			lutrgb			swapuv
asplit			lutyuv			testsrc
astreamsync		mandelbrot		thumbnail
atempo			movie			tile
bbox			negate			transpose
blackdetect		noformat		unsharp
cellauto		null			vflip
channelmap		nullsink		volume
channelsplit		nullsrc			volumedetect
color			overlay			vsink
concat			pad			vsink

Enabled bsfs:
aac_adtstoasc		mjpeg2jpeg		mp3_header_decompress
chomp			mjpega_dump_header	noise
dump_extradata		mov2textsub		remove_extradata
h264_mp4toannexb	mp3_header_compress	text2movsub

Enabled indevs:
dshow			lavfi			vfwcap

Enabled outdevs:

License: LGPL version 2.1 or later
Creating config.mak and config.h...
Version 0, edited 4 years ago by rogerdpack (next)

comment:3 in reply to: ↑ 2 Changed 4 years ago by cehoyos

Replying to rogerdpack:

I didn't see a "makeinfo enabled" message buthere's my attempt...

makeinfo enabled          no
static                    yes
shared                    yes

creates this file:

-rwxrwxr-x 1 rdp rdp 205312 Nov 27 10:37 ffmpeg.exe

which I assume is "just" a shared build.

The important question is if static libraries are built:
libavutil/libavutil.a, libavcodec/libavcodec.a, libavformat/libavformat.a, ...
(configure's output above indicates that they will be built.)

comment:4 Changed 4 years ago by rogerdpack

Ok here appears to be the behavior:
with just --enable-shared, it builds .dll's, and a "small" ffmpeg.exe (no libav*.a files)
with just --enable-static, it builds a "large" ffmpeg.exe, no .dll's, and yes libav*.a files. So far so good.

The confusion comes when you do both of them together. It's like it must decide "which one" to use for building ffmpeg.exe (large, or small?) and it appears to default to small, even if --enable-static is specified, and is last. It chooses a size arbitrarily it seems. If this is expected then fine (maybe configure could output a warning or something in this case?)
Thank you.

comment:5 Changed 4 years ago by reimar

Just like "configure --help" describes, these two options specify whether the static and the dynamic libav* libraries will be built.
When both are enabled, it is up to the toolchain (the build system only tells it which libraries to link against but nothing more specific), which almost always will default to preferring shared libraries.
If you want a stand-alone binary, "--extra-ldflags=-static" is a better solution since it will also try to statically link system library dependencies.
Anything else is probably a too special case for us to support it.

comment:6 Changed 4 years ago by cehoyos

Replying to rogerdpack:

The confusion comes when you do both of them together. It's like it must decide "which one" to use for building ffmpeg.exe (large, or small?)

Please understand that both "--enable-shared" and "--enable-static" do not directly influence if ffmpeg (the executable) is linked statically or dynamically (or is, in your words, "large or small"), test for example "./configure --disable-static --enable-shared && make ffmpeg; ./configure --enable-static --disable-shared && make ffmpeg" and you will see that only the linker (that is not part of FFmpeg) decides which library files to use. (Even if I am wrong and linkers must use the dynamic libraries to conform to some specification that does not change my argument that this in no way indicates a bug in FFmpeg.)

Allow me to repeat the question:
If you configure with "--enable-shared --enable-static" are the static archives - libavutil/libavutil.a, libavcodec/libavcodec.a, libavformat/libavformat.a, ... - built or not?

comment:7 Changed 4 years ago by rogerdpack

Yes they are built (and yes, the linker ignores them LOL). Shame it's so hard to be able to specify the output linkage can close this I suppose, thanks for your help here with this cross compiling newbie :P

comment:8 Changed 4 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.