uname -at is all 64 bit Linux I think. Any quick hints how to look it up?
Dear Cerberus X User!
As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.
Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.
Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!
Accepting ensures:
- Continued access to your account with a short break for the actual transfer.
- Retention of your data under the same terms.
Without consent:
- You don't have further access to your forum user account.
- Your account and personal data will be deleted after April 5, 2024.
- Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.
We hope to keep you in our community and see you on the forum soon!
All the best
Your Cerberus X Team
uname -at is all 64 bit Linux I think. Any quick hints how to look it up?
Installing it is easy on Manjaro. Just look in the community repositories. But looks I will have to do some changes so that GCC version can be passed. Which means another update to the builders for transcc.Changing gcc g++ version seams to be not that easy.
Import builder
Class GlfwBuilder Extends Builder
Method New( tcc:TransCC )
Super.New( tcc )
End
Method Config:String()
Local config:=New StringStack
For Local kv:=Eachin GetConfigVars()
config.Push "#define CFG_"+kv.Key+" "+kv.Value
Next
Return config.Join( "~n" )
End
'***** GCC *****
Method MakeGcc:Void()
Local msize:=GetConfigVar( "GLFW_GCC_MSIZE_"+HostOS.ToUpper() )
Local tconfig:=casedConfig+msize
Local dst:="gcc_"+HostOS
CreateDir dst+"/"+tconfig
CreateDir dst+"/"+tconfig+"/internal"
CreateDir dst+"/"+tconfig+"/external"
CreateDataDir dst+"/"+tconfig+"/data"
' need to rewrite resources.rc so that icon is rebuilt
CopyIcon(GetConfigVar( "GLFW_APP_ICON"),CurrentDir()+"\cerberus.ico")
Local main:=LoadString( "main.cpp" )
main=ReplaceBlock( main,"TRANSCODE",transCode )
main=ReplaceBlock( main,"CONFIG",Config() )
SaveString main,"main.cpp"
If tcc.opt_build
ChangeDir dst
CreateDir "build"
CreateDir "build/"+tconfig
Local ccopts:="",ldopts:="", libopts:="", libcopy:=""
If msize ccopts+=" -m"+msize;ldopts+=" -m"+msize
ccopts+=" "+GetConfigVar( "GLFW_GCC_CC_OPTS" ).Replace( ";"," " )
ldopts+=" "+GetConfigVar( "GLFW_GCC_LD_OPTS" ).Replace( ";"," " )
libopts+=" "+GetConfigVar( "GLFW_GCC_LIB_OPTS" ).Replace( ";"," " )
Select ENV_CONFIG
Case "debug"
ccopts+=" -O0"
Case "release"
ccopts+=" -O3 -DNDEBUG"
ldopts+=" -s"
End
' Process external libs to copy over
ProcessExternalLibs( CurrentDir()+"\"+casedConfig, msize, libopts )
Local cmd:="make", gccVer$=GetConfigVar( "GCC_VERSION_LINUX" ), GCCVER:="GCCVER="
If HostOS="winnt" And FileType( tcc.MINGW_PATH+"/bin/mingw32-make.exe" ) cmd="mingw32-make"
' Set up additional operating specific values.
If HostOS="winnt"
ldopts+=" -L"+tcc._libs+"Win"+msize
Else If HostOS="linux"
If gccVer<>"" GCCVER+="-"+gccVer
Endif
Execute cmd+" "+GCCVER+" CCOPTS=~q"+ccopts+"~q LDOPTS=~q"+ldopts+"~q LIBOPTS=~q"+libopts+"~q OUT=~q"+tconfig+"/CerberusGame~q"
If tcc.opt_run
ChangeDir tconfig
If HostOS="winnt"
Execute "CerberusGame"
Else
Execute "./CerberusGame"
Endif
Endif
Endif
End
'***** Vc2010 *****
Method MakeVc2010:Void()
CreateDir "vc2010/"+casedConfig
CreateDir "vc2010/"+casedConfig+"/internal"
CreateDir "vc2010/"+casedConfig+"/external"
CreateDataDir "vc2010/"+casedConfig+"/data"
Local main:=LoadString( "main.cpp" )
main=ReplaceBlock( main,"TRANSCODE",transCode )
main=ReplaceBlock( main,"CONFIG",Config() )
SaveString main,"main.cpp"
If tcc.opt_build
ChangeDir "vc2010"
Execute "~q"+tcc.MSBUILD_PATH+"~q /p:Configuration="+casedConfig+" /p:Platform=Win32 CerberusGame.sln"
If tcc.opt_run
ChangeDir casedConfig
Execute "CerberusGame"
Endif
Endif
End
'***** Msvc *****
Method MakeMsvc:Void()
CreateDir "msvc/"+casedConfig
CreateDir "msvc/"+casedConfig+"/internal"
CreateDir "msvc/"+casedConfig+"/external"
CreateDataDir "msvc/"+casedConfig+"/data"
' need to rewrite resources.rc so that icon is rebuilt
CopyIcon(GetConfigVar( "GLFW_APP_ICON"),CurrentDir()+"\cerberus.ico")
Local main:=LoadString( "main.cpp" )
main=ReplaceBlock( main,"TRANSCODE",transCode )
main=ReplaceBlock( main,"CONFIG",Config() )
SaveString main,"main.cpp"
If tcc.opt_build
ChangeDir "msvc"
Execute "~q"+tcc.MSBUILD_PATH+"~q /p:Configuration="+casedConfig'+" /p:Platform=win32 CerberusGame.sln"
If tcc.opt_run
ChangeDir casedConfig
Execute "CerberusGame"
Endif
Endif
End
'***** Xcode *****
Method MakeXcode:Void()
CreateDataDir "xcode/data"
Local main:=LoadString( "main.cpp" )
main=ReplaceBlock( main,"TRANSCODE",transCode )
main=ReplaceBlock( main,"CONFIG",Config() )
SaveString main,"main.cpp"
If tcc.opt_build
ChangeDir "xcode"
' Execute "set -o pipefail && xcodebuild -configuration "+casedConfig+" | egrep -A 5 ~q(error|warning):~q"
Execute "xcodebuild -configuration "+casedConfig
If tcc.opt_run
ChangeDir "build/"+casedConfig
ChangeDir "CerberusGame.app/Contents/MacOS"
Execute "./CerberusGame"
Endif
Endif
End
'***** Builder *****
Method IsValid:Bool()
Select HostOS
Case "winnt"
If tcc.MINGW_PATH Or tcc.MSBUILD_PATH Return True
Default
Return True
End
Return False
End
Method Begin:Void()
ENV_LANG="cpp"
_trans=New CppTranslator
End
Method MakeTarget:Void()
Select HostOS
Case "winnt"
If GetConfigVar( "GLFW_USE_MINGW" )="1" And tcc.MINGW_PATH
MakeGcc
Else If FileType( "vc2010" )=FILETYPE_DIR
MakeVc2010
Else If FileType( "msvc" )=FILETYPE_DIR
MakeMsvc
Else If tcc.MINGW_PATH
MakeGcc
Endif
Case "macos"
MakeXcode
Case "linux"
MakeGcc
End
End
' Process external shared libraries to copy
Method ProcessExternalLibs( config:String, arch:String, link:String )
Local libStr:String = GetConfigVar( "GLFW_COPY_LIBS" ).ToLower()
If libStr = "" Then Return
Local libcopy:String[] = libStr.Split( ";" )
Local dst:String = config+arch
For Local i:= Eachin libcopy
If HostOS="winnt"
If i <> ""
If FileType( dst+"/"+i+".dll" ) = FILETYPE_FILE Continue
If CopyFile( tcc._libs+"Win"+arch+"/"+i+".dll", dst+"/"+i+".dll" ) = 1
Print "Copied "+i+".dll to "+dst
Else
Print "Failed to copy "+i+" to "+dst
EndIf
If FileType( tcc._libs+"/"+i+"_COPYING" )<> FILETYPE_NONE
If CopyFile( tcc._libs+"/"+i+"_COPYING", dst+"/"+i+"_COPYING" ) = 1
Print "Copied "+i+"_COPYING to "+dst
Else
Print "Failed to copy "+i+"_COPYING To "+dst
Endif
Endif
If FileType( tcc._libs+"/"+i+"_LICENCE" )<> FILETYPE_NONE
If CopyFile( tcc._libs+"/"+i+"_LICENCE", dst+"/"+i+"_LICENCE" ) = 1
Print "Copied "+i+"_LICENCE to "+dst
Else
Print "Failed to copy "+i+"_COPYING To "+dst
Endif
Endif
Endif
EndIf
Next
End
End
Import builder
Class StdcppBuilder Extends Builder
Method New( tcc:TransCC )
Super.New( tcc )
End
Method Config:String()
Local config:=New StringStack
For Local kv:=Eachin GetConfigVars()
config.Push "#define CFG_"+kv.Key+" "+kv.Value
Next
Return config.Join( "~n" )
End
Method IsValid:Bool()
Select HostOS
Case "winnt"
If tcc.MINGW_PATH Return True
Default
Return True
End
Return False
End
Method Begin:Void()
ENV_LANG="cpp"
_trans=New CppTranslator
End
Method MakeTarget:Void()
Select ENV_CONFIG
Case "debug" SetConfigVar "DEBUG","1"
Case "release" SetConfigVar "RELEASE","1"
Case "profile" SetConfigVar "PROFILE","1"
End
CopySourceFiles(".")
Local main:=LoadString( "main.cpp" )
main=ReplaceBlock( main,"TRANSCODE",transCode )
main=ReplaceBlock( main,"CONFIG",Config() )
SaveString main,"main.cpp"
If tcc.opt_build
Local out:="main_"+HostOS
DeleteFile out
Local OPTS:="",LIBS:="", GCCVER:="", gccVer:=GetConfigVar( "GCC_VERSION_LINUX" )
Select ENV_HOST
Case "winnt"
OPTS+=" -Wno-free-nonheap-object"
LIBS+=" -lwinmm -lws2_32"
Case "macos"
OPTS+=" -Wno-parentheses -Wno-dangling-else"
OPTS+=" -mmacosx-version-min=10.9 -std=gnu++0x -stdlib=libc++"
Case "linux"
OPTS+=" -Wno-unused-result"
LIBS+=" -lpthread"
If gccVer<>"" GCCVER="-"+gccVer
End
Select ENV_CONFIG
Case "debug"
OPTS+=" -O0"
Case "release"
OPTS+=" -O3 -DNDEBUG"
End
Local cc_opts:=GetConfigVar( "CC_OPTS" )
If cc_opts OPTS+=" "+cc_opts.Replace( ";"," " )
Local cc_libs:=GetConfigVar( "CC_LIBS" )
If cc_libs LIBS+=" "+cc_libs.Replace( ";"," " )
If HostOS="macos"
Execute "clang++"+OPTS+" -o "+out+" main.cpp"+LIBS
Else
Execute "g++"+GCCVER+" "+OPTS+" -o "+out+" main.cpp"+LIBS
Endif
If tcc.opt_run
Execute "~q"+RealPath( out )+"~q"
Endif
Endif
End
End
CC=gcc$(GCCVER)
CFLAGS=
CXX=g++$(GCCVER)
CXXFLAGS=
That was the only thing I had to investigate myself. You named it #GCC_VERSION_LINUX in the code.All you do then is add #GCC_VERSION="8" to your source file
I've never been a fan of the GLFW naming when needing to pass compiler specific information to the compiler.BTW If we keep something like this for the official release it might be better to use the naming scheme of config settings like #GLFW_GCC_MSIZE_WINNT
So it would be for the version: #GLFW_GCC_VERSION_LINUX
Not a good idea. Not everyone will be using the same compiler and you only need to put it in the main build file, or place it in your own config.cxs within your project directory.And put it into the config.cxs file to avoid the need of having it in each source file.
Technically this is right, but there are two practical reasons to name like this:I've never been a fan of the GLFW naming when needing to pass compiler specific information to the compiler.
It can confuse the situation when you have multiple preprocessor directives that basically do the same thing.
I was not thinking about setting it to 8 but leaving it empty to be aware of the existence of this Option. Further more if you are on a system with this problem, you need this setting for building your app every time.Not a good idea. Not everyone will be using the same compiler and you only need to put it in the main build file, or place it in your own config.cxs within your project directory.
Nice you found another way to deal with the problem.#GLFW_GCC_CC_OPTS+="-fpic -no-pie"
So no need to change any files yet.
ccopts+=" "+GetConfigVar( "GLFW_GCC_CC_OPTS" ).Replace( ";"," " )
ldopts+=" "+GetConfigVar( "GLFW_GCC_LD_OPTS" ).Replace( ";"," " )
libopts+=" "+GetConfigVar( "GLFW_GCC_LIB_OPTS" ).Replace( ";"," " )
Print "ccopts=" + ccopts ' I inserted the line for test.
Select ENV_CONFIG
Case "debug"
ccopts+=" -O0"
Case "release"
ccopts+=" -O3 -DNDEBUG"
ldopts+=" -s"
End
ccopts+=" "+GetConfigVar( "GLFW_GCC_CC_OPTS" ).Replace( ";"," " )
ldopts+=" "+GetConfigVar( "GLFW_GCC_LD_OPTS" ).Replace( ";"," " )
libopts+=" "+GetConfigVar( "GLFW_GCC_LIB_OPTS" ).Replace( ";"," " )
Print "ccopts=" + ccopts ' I inserted the line for test.
Select ENV_CONFIG
Case "debug"
ccopts+=" -O0"
Case "release"
ccopts+=" -O3 -DNDEBUG -fpic" ' <================ Here, it works.
ldopts+=" -s"
End
[/ICODE]
I'm still using g ++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)