@@ -35,38 +35,35 @@ def populate_env(env, dirs):
3535 :type dirs: ``relenv.build.common.Dirs``
3636 """
3737 # CC and CXX need to be to have the full path to the executable
38- env ["CC" ] = "{ }/bin/{}-gcc -no-pie". format ( dirs . toolchain , env [ "RELENV_HOST" ])
39- env ["CXX" ] = "{ }/bin/{}-g++ -no-pie". format ( dirs . toolchain , env [ "RELENV_HOST" ])
38+ env ["CC" ] = f" { dirs . toolchain } /bin/{ env [ 'RELENV_HOST' ] } -gcc -no-pie"
39+ env ["CXX" ] = f" { dirs . toolchain } /bin/{ env [ 'RELENV_HOST' ] } -g++ -no-pie"
4040 # Add our toolchain binaries to the path. We also add the bin directory of
4141 # our prefix so that libtirpc can find krb5-config
42- env ["PATH" ] = "{ }/bin/:{}/bin/:{PATH}" . format ( dirs . toolchain , dirs . prefix , ** env )
42+ env ["PATH" ] = f" { dirs . toolchain } /bin/:{ dirs . prefix } /bin/:{ env [ ' PATH' ] } "
4343 ldflags = [
4444 "-Wl,--build-id=sha1" ,
45- "-Wl,--rpath={prefix}/lib" ,
46- "-L{prefix}/lib" ,
47- "-L{}/{RELENV_HOST}/sysroot/lib" .format (dirs .toolchain , ** env ),
48- "-static-libstdc++" ,
45+ f"-Wl,--rpath={ dirs .prefix } /lib" ,
46+ f"-L{ dirs .prefix } /lib" ,
47+ f"-L{ dirs .toolchain } /{ env ['RELENV_HOST' ]} /sysroot/lib" ,
4948 ]
50- env ["LDFLAGS" ] = " " .join (ldflags ). format ( prefix = dirs . prefix )
49+ env ["LDFLAGS" ] = " " .join (ldflags )
5150 cflags = [
5251 "-g" ,
53- "-I{prefix}/include" ,
54- "-I{prefix}/include/readline" ,
55- "-I{prefix}/include/ncursesw" ,
56- "-I{}/{RELENV_HOST}/sysroot/usr/include" . format ( dirs . toolchain , ** env ) ,
52+ f "-I{ dirs . prefix } /include" ,
53+ f "-I{ dirs . prefix } /include/readline" ,
54+ f "-I{ dirs . prefix } /include/ncursesw" ,
55+ f "-I{ dirs . toolchain } /{ env [ ' RELENV_HOST' ] } /sysroot/usr/include" ,
5756 ]
58- env ["CFLAGS" ] = " " .join (cflags ). format ( prefix = dirs . prefix )
57+ env ["CFLAGS" ] = " " .join (cflags )
5958 # CPPFLAGS are needed for Python's setup.py to find the 'nessicery bits'
6059 # for things like zlib and sqlite.
6160 cpplags = [
62- "-I{prefix}/include" ,
63- "-I{prefix}/include/readline" ,
64- "-I{prefix}/include/ncursesw" ,
65- "-I{}/{RELENV_HOST}/sysroot/usr/include" . format ( dirs . toolchain , ** env ) ,
61+ f "-I{ dirs . prefix } /include" ,
62+ f "-I{ dirs . prefix } /include/readline" ,
63+ f "-I{ dirs . prefix } /include/ncursesw" ,
64+ f "-I{ dirs . toolchain } /{ env [ ' RELENV_HOST' ] } /sysroot/usr/include" ,
6665 ]
67- env ["CPPFLAGS" ] = " " .join (cpplags ).format (prefix = dirs .prefix )
68- env ["CXXFLAGS" ] = " " .join (cpplags ).format (prefix = dirs .prefix )
69- env ["LD_LIBRARY_PATH" ] = "{prefix}/lib"
66+ env ["CPPFLAGS" ] = " " .join (cpplags )
7067 env ["PKG_CONFIG_PATH" ] = f"{ dirs .prefix } /lib/pkgconfig"
7168
7269
@@ -354,9 +351,9 @@ def build_python(env, dirs, logfp):
354351 :param logfp: A handle for the log file
355352 :type logfp: file
356353 """
357- env [ "LDFLAGS" ] = "-Wl,--rpath={prefix}/lib {ldflags}" . format (
358- prefix = dirs . prefix , ldflags = env ["LDFLAGS" ]
359- )
354+ ldflagopt = f "-Wl,--rpath={ dirs . prefix } /lib"
355+ if ldflagopt not in env ["LDFLAGS" ]:
356+ env [ "LDFLAGS" ] = f" { ldflagopt } { env [ 'LDFLAGS' ] } "
360357
361358 # Needed when using a toolchain even if build and host match.
362359 runcmd (
@@ -433,6 +430,8 @@ def build_python(env, dirs, logfp):
433430 with io .open ("Modules/Setup" , "a+" ) as fp :
434431 fp .seek (0 , io .SEEK_END )
435432 fp .write ("*disabled*\n " "_tkinter\n " "nsl\n " "nis\n " )
433+ for _ in ["LDFLAGS" , "CFLAGS" , "CPPFLAGS" , "CXX" , "CC" ]:
434+ env .pop (_ )
436435 runcmd (["make" , "-j8" ], env = env , stderr = logfp , stdout = logfp )
437436 runcmd (["make" , "install" ], env = env , stderr = logfp , stdout = logfp )
438437
@@ -555,8 +554,8 @@ def build_python(env, dirs, logfp):
555554 download = {
556555 "url" : "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz" ,
557556 # "fallback_url": "https://woz.io/relenv/dependencies/libffi-{version}.tar.gz",
558- "version" : "3.4.7 " ,
559- "checksum" : "b07136211f47fa30c0512ebd7484fde724978d99 " ,
557+ "version" : "3.4.8 " ,
558+ "checksum" : "6930b77aebe2465a8e1a8617c4c9a8fa3199b256 " ,
560559 "checkfunc" : github_version ,
561560 "checkurl" : "https://github.com/libffi/libffi/releases/" ,
562561 },
0 commit comments