[Viking-devel] another portability nit

2020-03-18 Thread Greg Troxel
In configure, we patch

  $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM

to

  $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.not-random

$RANDOM is a bashism not specified by POSIX, and not available in a
number of shells.  (It is available in NetBSD's /bin/sh, but pkgsrc has
a bunch of portability checks because pkgsrc does not require that a
platforms /bin/sh have anything beyond what POSIX requires.)


I'd suggest changing to


  $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.viking.

I have not tested; I am guessing this passes $$ to the shell after make
quoting.

That should be enough not to collide, even if there are multiple viking
builds happening at once.



___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/


Re: [Viking-devel] pkgsrc updated to 1.8, stray visibility defines fix

2020-03-18 Thread Greg Troxel
Robert Norris  writes:

>> #define _XOPEN_SOURCE
>
> Simply removing it is the best option, as it compiles and runs on Linux OK 
> without this line.
> I've no idea why it was put in, but the line originates from the initial code 
> creation back in 2005.
> Some background on this define:
>
> https://stackoverflow.com/questions/5378778/what-does-d-xopen-source-do-mean
>
> So as Viking doesn't use strdup() directly (it uses g_() versions when 
> available), any usage (or attempt thereof) of _XOPEN_SOURCE is unnecessary.
> Even in the very first version of gpx.c, strdup() was not used.
>  
> Admittedly I always wondered a little about this define really meant/what it 
> was used for, but never bothered to investigate further as it appeared to 
> 'work'.
>
> PS. Thanks as always for your pkgsrc efforts

2005 was a really long time ago.  So definitely just take it out, and if
something turns out to be needed on solaris, somebody can figure out the
minimal change.


The real point of these defines is to have a program declare the
specification it is written so, so that operating systems will hide all
symbols and functions etc. that are not mandated by that standard.  This
checks that the program really is portable.

Instead, they often get used when some operating system does not make
available extensions by default.  However, more or less the norm today
is that if POSIX specifies it, and the OS doesn't provide it, the OS
should be fixed (and usually is).


___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/