View Single Post
Posts: 252 | Thanked: 282 times | Joined on Oct 2021 @ Poland
#4
I also had a unusual problem - I had to make a gcc wrapper with custom arguments, because apparently GCC 4.4 doesn't use compiler-specific variables like C_INCLUDE_PATH or CXXFLAGS and similar. sh couldn't work, because it has problem with dealing with quotation marks. In the end I just used Python, and wrote below.

GCC:

Code:
#!/usr/bin/env python3.1

import subprocess
import sys

args = ["gcc-4.4", "-D_Static_assert(a,b)=(1)", "-I/opt/wunderw/include", "-L/opt/wunderw/lib", "-lncursesw", "-lpng", "-lunistring"]

for i, arg in enumerate(sys.argv):
    if i == 0:
        continue
    else:
        args.append(arg)

result = subprocess.call(args)
sys.exit(result)
G++:

Code:
#!/usr/bin/env python3.1

import subprocess
import sys

args = ["g++-4.4", "-I/opt/wunderw/include", "-L/opt/wunderw/lib", "-lncursesw", "-lpng", "-lunistring"]

for i, arg in enumerate(sys.argv):
    if i == 0:
        continue
    args.append(arg)

result = subprocess.call(args)
sys.exit(result)
It will add some paths to library and include paths, and include some libraries. Seems to work well.
How to use? Put into /usr/bin/gcc and /usr/bin/g++ and chmod 755 both of files.
__________________
My Telegram group (Maemo / MeeGo / Sailfish):
https://t.me/linuxmobile_world
Channel for Maemo/MeeGo:
https://t.me/maemomeegoapps