On 7/14/20 10:10 AM, y...@freebsd.org wrote:
On 2020-07-14 09:59, Don Wilde wrote:
Hi, Yuri -- I understand that you maintain the png++ "C++ wrapper for
libpng"?
There's a game engine I'm trying to work with on my 12-stable system,
called Drag[en]gine.
https://dragondreams.ch/
It's a complicated port, and I'll end up tweaking some heavy-duty
OpenGL graphics to get it to do stuff for me. The first issue is that
our libpng16 library is missing a C++ call:
png_access_version_number(), which causes its setup program (a Python
script)to crash.
I have both png and png++ installed and both libpng16.so and
libpng16.a are present.
I'm in the process of (also) installing it on my Ubuntu 18.04.4
machine. It hasn't given me this libpng16 issue.
What do you think of this problem? Is this yours or is it the actual
libpng library itself?
Hi Don,
I used png++ on both Linux (CentOS) and FreeBSD without any problems.
I also can't find png_access_version_number() call in the png++ sources.
Okay, this must actually be a call in the actual libpng sources.
Could you please provide an example code that exhibits the problem?
Here's what happens, though there's evidently quite a bit of
construction that happens in the middle.
scons is Yet Another Super-Make, and it's plus (evidently) is that it
can also generate Android and Windows code.
I type 'scons -h', and the output is:
scons: Reading SConscript files ...
Checking for zlibVersion() in C++ library z... yes
Checking for png_access_version_number() in C++ library png16... no
KeyError: 'forceRuntimeLibs':
File "/opt/dragengine/SConstruct", line 633:
duplicate=0, exports='parent_env parent_targets parent_report' )
File
"/usr/local/lib/python3.7/site-packages/SCons/Script/SConscript.py",
line 660:
return method(*args, **kw)
File
"/usr/local/lib/python3.7/site-packages/SCons/Script/SConscript.py",
line 597:
return _SConscript(self.fs, *files, **subst_kw)
File
"/usr/local/lib/python3.7/site-packages/SCons/Script/SConscript.py",
line 286:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/opt/dragengine/extern/libpng/SConscript", line 120:
forceRuntimeLibs.extend(parent_targets['lib_zlib']['forceRuntimeLibs'])
The SConscript files are generated from the (attached) custom.py, from
what I understand. The error happens in the construct between lines 631
- 633 of that attached SConscript file (which acts like Makefile does
for C and C++).
Don Wilde
* What is the Internet of Things but a system *
* of systems including humans? *
from SConsCommon import *
from SConsPlatformAndroid import androidUpdateEnv
# create environment
tools = ARGUMENTS.get( 'tools', '' )
if tools:
if tools == 'mingw64':
parent_env = Environment( CPPPATH='.', LIBPATH='.',
tools=['mingw'] )
compiler = 'x86_64-w64-mingw32'
if not parent_env.Detect( '{}-g++'.format( compiler ) ):
print( 'Windows 64-bit Cross-Compiler not found.' )
Return()
parent_env.Replace( CC = '{}-gcc'.format( compiler ) )
parent_env.Replace( CXX = '{}-g++'.format( compiler ) )
parent_env.Replace( LD = '{}-ld'.format( compiler ) )
parent_env.Replace( AR = '{}-ar'.format( compiler ) )
parent_env.Replace( STRIP = '{}-strip'.format( compiler ) )
#parent_env.Replace( MAKE = '{}-make'.format( compiler ) )
parent_env.Replace( RANLIB = '{}-ranlib'.format( compiler ) )
parent_env.Replace( NM = '{}-nm'.format( compiler ) )
parent_env.Replace( RC = '{}-windres'.format( compiler ) )
parent_env.Replace( DLLTOOL = '{}-dlltool'.format( compiler ) )
parent_env.Replace( SHCCFLAGS = [ '$CCFLAGS' ] ) # remove -fPIC
if included. just to silence misleading warnings
parent_env.Replace( SHLIBPREFIX = '' ) # fix prefix since the
environment is set up for unix
parent_env.Replace( SHLIBSUFFIX = '.dll' ) # fix suffix since
the environment is set up for unix
parent_env.Replace( LIBPREFIX = '' ) # fix prefix since the
environment is set up for unix
parent_env.Replace( LIBPREFIXES = [ '' ] ) # fix prefix since
the environment is set up for unix
parent_env.Replace( LIBSUFFIX = '.lib' )
parent_env.Replace( LIBSUFFIXES = [ '.lib', '.a' ] )
parent_env[ 'OS_NAME' ] = 'win32'
parent_env[ 'SYS_PLATFORM' ] = 'win32'
parent_env[ 'CROSSCOMPILE_HOST' ] = compiler
parent_env[ 'CROSSCOMPILE_SYSROOT' ] = '/usr/{}'.format(
compiler )