[FFmpeg-devel] [Patch] Alternative OS/2 patch

Dave Yeo daveryeo
Mon Nov 5 17:04:12 CET 2007


On 11/04/07 04:29 pm, Diego Biurrun wrote:
> On Sun, Nov 04, 2007 at 02:07:54PM -0800, Dave Yeo wrote:
>> On 11/03/07 06:19 pm, Diego Biurrun wrote:
>>> On Mon, Oct 29, 2007 at 04:27:40PM -0700, Dave Yeo wrote:
>>>> On 10/24/07 10:10 pm, Dave Yeo wrote:
>> ...
>>>> +        echo EXPORTS >> \$(FULLNAME).def; \
>>>> +        emxexp -o \$(SHARED_OBJS) >> \$(FULLNAME).def"
>>>> +    SLIB_EXTRA_CMD='emximp -o $(LIBPREF)$(FULLNAME)_dll.a 
>>>> $(FULLNAME).def; emximp -o $(LIBPREF)$(FULLNAME)_dll.lib $(FULLNAME).def'
>>> I think it should be just SLIB_EXTRA_CMD unless SLIB_CREATE_DEF_CMD gets
>>> reused on another platform.
>> The problem is that SLIB_CREATE_DEF_CMD needs to be run before linking so 
>> we have a def file to link.
> 
> Can you point me at some place that explains what the def file is for so
> I can understand all of this a bit better?

Hard to find anything so simple. IBM has removed everything OS/2 
related. This is the toolkit documentation on DEF files, unluckily the 
web interface is somewhat broken. 
http://www.warpspeed.com.au/cgi-bin/inf2html.cmd?..\html\book\Toolkt40\TOOLSREF.INF+376 

use the next button for more.
Most of the info on DEFs at 
http://sourceware.org/binutils/docs-2.18/ld/WIN32.html also applies to 
OS/2 except all the ld and gcc flags (though OS/2 also supports 
__declspec). Windows defs are basically a subset of OS/2 ones.

> 
>> I'm not sure about the use of SLIB_EXTRA_CMD in mingw. It looks like it is 
>> just appending some more linker flags in which case they could perhaps be 
>> moved to SHFLAGS and SLIB_EXTRA_CMD moved to prelinking or replaced by 
>> SLIB_CREATE_DEF_CMD. The SLIB_EXTRA_CMD here could easily be rolled into 
>> SLIB_CREATE_DEF_CMD as well.
> 
> I'm not sure what the lib command does either, but since it is run after
> installation it cannot add linker flags unless I misunderstand what you
> mean by "adding linker flags".

It throws me off by having a cmd that starts with -
> 
> Doesn't the lib command create some sort of def file as well?

Yes ld creates a def file while linking the dll then SLIB_EXTRA_CMD 
creates an import lib from the def, basically the same process as OS/2 
though with different cmds and OS/2 outputting 2 binary formats.

> 
>>>> +    SLIB_INSTALL_EXTRA_CMD='install -m 644 $(LIBPREF)$(FULLNAME)_dll.lib 
>>>> $(LIBPREF)$(FULLNAME)_dll.a $(LIBDIR)'
>>>> +    SLIB_UNINSTALL_EXTRA_CMD='rm -f 
>>>> $(LIBDIR)/$(LIBPREF)$(FULLNAME)_dll.lib; rm -f 
>>>> $(LIBDIR)/$(LIBPREF)$(FULLNAME)_dll.a'
>>> Both of these need quoting, $(LIBDIR) might contain spaces.
>> Fixed though I notice right now make uninstall does not remove the binaries 
>> and manpages if $PREFIX contains spaces due to lack of quoting. I'll look 
>> into this when time permits.
> 
> No need to look into this, I fixed it, thanks for pointing this out.
> 
>> ps also added creation of map files to assist in debugging.
> 
> Where?

The -Zmap flag causes the linker to output a map file besides the dlls 
and executables. Same name except .map suffix

> 
>> --- configure	(revision 10924)
>> +++ configure	(working copy)
>> @@ -1210,6 +1212,33 @@
>> +  os/2)
>> +    SLIB_CREATE_DEF_CMD="echo LIBRARY \$(FULLNAME) INITINSTANCE TERMINSTANCE > \$(FULLNAME).def; \
>> +        echo DESCRIPTION '\"\$(SLIBNAME_WITH_VERSION)\"' >> \$(FULLNAME).def; \
>> +        echo PROTMODE >> \$(FULLNAME).def; \
>> +        echo CODE PRELOAD MOVEABLE DISCARDABLE >> \$(FULLNAME).def; \
>> +        echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> \$(FULLNAME).def; \
>> +        echo EXPORTS >> \$(FULLNAME).def; \
>> +        emxexp -o \$(OBJS) >> \$(FULLNAME).def"
> 
> Try using 'cat << EOF', that should simplify things a lot.

I've never seen cat used this way and not sure how that would work.
> 
>> +    SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(FULLNAME)_dll.lib; rm -f "$(LIBDIR)"/$(LIBPREF)$(FULLNAME)_dll.a'
> 
> Nit: Put the double quotes around the complete filename.
ok
> 
> Diego

Dave




More information about the ffmpeg-devel mailing list