[FFmpeg-devel] [PATCH v3 1/1] configure: Refactor setting of feature test macro _XOPEN_SOURCE

Michael Niedermayer michaelni at gmx.at
Mon Sep 22 20:51:32 CEST 2014


On Mon, Sep 22, 2014 at 06:39:51PM +0200, wm4 wrote:
> On Mon, 22 Sep 2014 18:31:36 +0200
> Michael Niedermayer <michaelni at gmx.at> wrote:
> 
> > On Mon, Sep 22, 2014 at 06:19:42PM +0200, wm4 wrote:
> > > On Mon, 22 Sep 2014 17:13:24 +0200
> > > Michael Niedermayer <michaelni at gmx.at> wrote:
> > > 
> > > > On Sun, Sep 21, 2014 at 10:48:01PM +0200, Jörg Krause wrote:
> > > > > Some C libraries, eg glibc, uclibc, and musl, uses feature test macros 
> > > > > to expose definitions conforming to the standards ISO C, POSIX and 
> > > > > extensions. According to which feature test macros are defined by the 
> > > > > user or the compiler, a header file, eg <features.h>, used by these 
> > > > > libraries internally defines various other macros.
> > > > > 
> > > > > glibc and uclibc also defines release test macros, eg __GLIBC__ and
> > > > > __UCLIBC__ in <features.h>. musl does not have (and does not want) a 
> > > > > macro __MUSL__. Therefore it is not possible to check for the musl
> > > > > library.
> > > > > 
> > > > > However, building FFmpeg with musl needs the feature test macro
> > > > > _XOPEN_SOURCE=600 to be defined.
> > > > > 
> > > > > Signed-off-by: Jörg Krause <jkrause at posteo.de>
> > > > > ---
> > > > > Changes v2 -> v3:
> > > > >   - set _XOPEN_SOURCE as default in case no C library can be detected
> > > > > 
> > > > > Changes v1 -> v2:
> > > > >   - do not set _XOPEN_SOURCE twice for glibc and uclibc
> > > > > ---
> > > > >  configure | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > 
> > > > patch reverted
> > > > it broke netbsd and macosx at least
> > > > see
> > > > http://fate.ffmpeg.org/log.cgi?time=20140922033546&log=compile&slot=i386-darwin-gcc-4.7
> > > > 
> > > > [...]
> > > > 
> > > 
> > > It looks like the code uses inet_aton even if getaddrinfo is available.
> > > 
> > > Should the code using inet_aton just not be compiled if HAVE_GETADDRINFO
> > > is not 0?
> > 
> > the code uses inet_aton() when HAVE_INET_ATON is set
> > it is set but the code fails to build (on netbsd at least but probably
> > the failure on the other bsds is similar)
> > 
> > [...]
> 
> What I meant is that it could be moved inside of
> the "#if !HAVE_GETADDRINFO" block. Only the getaddrinfo emulation uses
> ff_inet_aton.
> 
> (I'm assuming OSX and the BSDs have getaddrinfo().)
> 
> Unless I misunderstood the problem.


the HAVE_ defines are wrong, HAVE_INET_ATON is set yet
-D_XOPEN_SOURCE=600 disables inet_aton() and several other features

also why would we want to disable these features on BSDs ?!


also
if i build with gmake -k and
grep -i Err mlist
/usr/include/dev/ic/bt8xx.h:60: error: expected specifier-qualifier-list before 'u_short'
/usr/include/dev/ic/bt8xx.h:68: error: expected specifier-qualifier-list before 'u_int'
/usr/include/dev/ic/bt8xx.h:77: error: expected specifier-qualifier-list before 'u_int'
/usr/include/dev/ic/bt8xx.h:287: error: expected specifier-qualifier-list before 'u_char'
/usr/include/dev/ic/bt8xx.h:388: error: expected specifier-qualifier-list before 'u_int'
libavdevice/bktr.c:149: error: 'struct meteor_geomet' has no member named 'rows'
libavdevice/bktr.c:150: error: 'struct meteor_geomet' has no member named 'columns'
libavdevice/bktr.c:151: error: 'struct meteor_geomet' has no member named 'frames'
libavdevice/bktr.c:152: error: 'struct meteor_geomet' has no member named 'oformat'
libavdevice/bktr.c:165: error: 'struct meteor_geomet' has no member named 'oformat'
gmake: *** [libavdevice/bktr.o] Error 1
CC      libavformat/sierravmd.o
CC      libavcodec/error_resilience.o
libavcodec/mpegvideo_enc.c:934: warning: 'error_rate' is deprecated (declared at libavcodec/avcodec.h:2949)
libavcodec/mpegvideo_enc.c:935: warning: 'error_rate' is deprecated (declared at libavcodec/avcodec.h:2949)
libavcodec/options_table.h:328: warning: 'error_rate' is deprecated (declared at libavcodec/avcodec.h:2949)
/usr/include/x86/sysarch.h:126: error: expected specifier-qualifier-list before 'u_long'
/usr/include/x86/sysarch.h:130: error: expected specifier-qualifier-list before 'u_long'
/usr/include/machine/pcb.h:93: error: expected specifier-qualifier-list before 'u_int'
/usr/include/sys/signalvar.h:59: error: 'NSIG' undeclared here (not in a function)
/usr/include/sys/lwp.h:77: error: expected specifier-qualifier-list before 'u_int'
/usr/include/sys/lwp.h:86: error: field 'l_rtime' has incomplete type
/usr/include/sys/lwp.h:87: error: field 'l_stime' has incomplete type
/usr/include/sys/lwp.h:88: error: expected specifier-qualifier-list before 'u_int'
/usr/include/sys/proc.h:100: error: expected specifier-qualifier-list before 'u_int'
/usr/include/sys/proc.h:152: error: expected declaration specifiers or '...' before 'u_long'
/usr/include/sys/proc.h:168: error: expected declaration specifiers or '...' before 'vaddr_t'
/usr/include/sys/proc.h:170: error: expected specifier-qualifier-list before 'vaddr_t'
/usr/include/sys/proc.h:228: error: expected specifier-qualifier-list before 'u_int'
/usr/include/uvm/uvm_page.h:145: error: expected specifier-qualifier-list before 'paddr_t'
/usr/include/uvm/uvm_page.h:233: error: expected specifier-qualifier-list before 'paddr_t'
/usr/include/uvm/uvm_map.h:129: error: expected specifier-qualifier-list before 'vsize_t'
/usr/include/uvm/uvm_map.h:222: error: expected specifier-qualifier-list before 'vsize_t'
/usr/include/uvm/uvm_pager.h:139: error: expected declaration specifiers or '...' before 'vaddr_t'
/usr/include/sys/sysctl.h:1202: error: expected declaration specifiers or '...' before 'u_int'
/usr/include/sys/sysctl.h:1204: error: expected declaration specifiers or '...' before 'u_int'
libavutil/cpu.c:267: error: too many arguments to function 'sysctl'
gmake: *** [libavutil/cpu.o] Error 1
CC      libavutil/error.o
./libavcodec/options_table.h:328: warning: 'error_rate' is deprecated (declared at ./libavcodec/avcodec.h:2949)
gmake: Target `all' not remade because of errors.



[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140922/2054bbd1/attachment.asc>


More information about the ffmpeg-devel mailing list