[MPlayer-dev-eng] Customizing binary names via configure

Corey Hickey bugfood-ml at fatooh.org
Mon Dec 12 04:24:11 CET 2005


The Wanderer wrote:
> Diego Biurrun wrote:
> 
> 
>>On Sun, Nov 13, 2005 at 02:05:48PM -0500, The Wanderer wrote:
>>
>>
>>>Perhaps the simplest approach would be to just provide a means of
>>>specifying the entire binary name directly ("--mplayer-name" and
>>>"--mencoder-name"), overriding the hardcoded _prg and _prg_mencoder
>>>entirely; that provides the most configure-time power for the
>>>least coding effort and the least added complexity. However, for
>>>various reasons which were clearer in my mind the last time I
>>>thought about this than they are now, I'm not sure there aren't
>>>problems with doing it that way.
>>
>>I'm not sure this is a good thing to begin with, but this one sounds
>>like the sanest approach to me.
> 
> 
> Well, it doesn't necessarily have to be done; still, I'd be interested
> in hearing what problems you have with it, other than the ones I
> referred to briefly in the last paragraph of the initial post.
> 
> If people think having this option would be a bad idea, I won't add it,
> but there *are* people (including myself) who would like to have the
> functionality available.
> 
> (In any case, there is still the problem of 'gmplayer', since I haven't
> been able to work out where that name is set; if it's generated by
> prepending 'g' to _prg, then things should still work reasonably well -
> albeit with a few hiccups for some names people might specify - but if
> it's hardcoded, then that would have to be taken into account as well.)
> 

It's in mplayer.c at line 1378. See below (I've rewrapped it so it fits
within 72 characters and is readable in this email).

if ( argv[0] )
  if(!strcmp(argv[0],"gmplayer") ||
    (strrchr(argv[0],'/') &&
    !strcmp(strrchr(argv[0],'/'),"/gmplayer") ) )
          use_gui=1;


You could have configure put a #define in config.h like:

#define PRG_GMPLAYER "gmplayer"

...and then replace the strings in the lines above like this:

if ( argv[0] )
  if(!strcmp(argv[0],PRG_GMPLAYER) ||
    (strrchr(argv[0],'/') &&
    !strcmp(strrchr(argv[0],'/'),"/"PRG_GMPLAYER) ) )
          use_gui=1;


I think that would work.

-Corey




More information about the MPlayer-dev-eng mailing list