# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup crossgcc 1.0 # keep in sync with x86_64-w64-mingw32-gcc set mingw_name w64-mingw32 set mingw_arch i686 set mingw_target ${mingw_arch}-${mingw_name} crossgcc.setup ${mingw_target} 13.2.0 crossgcc.languages {c c++ fortran objc obj-c++} dist_subdir gcc[lindex [split ${version} .] 0] revision 0 maintainers {mojca @mojca} openmaintainer # these are build + runtime dependencies # (binutils are already added by the portgroup) depends_lib-append port:${mingw_target}-headers # not sure if useful: # port:cloog # port:ppl # Fixes libgomp compile patchfiles-append patch-libgomp-Don-t-hard-code-MS-printf-attributes.diff configure.args-replace \ --enable-multilib \ --disable-multilib configure.args-append \ --enable-shared \ --with-dwarf \ --enable-fully-dynamic-string \ --enable-libssp \ --enable-lto # not sure if useful: # --with-cloog=${prefix} # --with-ppl=${prefix} # TODO: # --enable-version-specific-runtime-libs # Installs libgcc/libstdc++ and other target support libraries in such a # way that multiple GCC installs can coexist simultaneously. # (add once you have the default working as it needs some extra tweaking) # First bootstrapping phase subport ${mingw_target}-gcc-bootstrap { build.target all-gcc destroot.target install-gcc } # Second bootstrapping phase subport ${mingw_target}-gcc-nothreads { # these two are not needed since we are not yet requesting posix threads # build.target all-target-libgcc # destroot.target install-target-libgcc depends_lib-append port:${mingw_target}-crt depends_build-append bin:${mingw_target}-gcc:${mingw_target}-gcc-bootstrap } # Final phase if {${subport} eq ${name}} { depends_lib-append port:${mingw_target}-crt \ port:${mingw_target}-winpthreads depends_build-append path:${mingw_target}/lib/libgcc_s.a:${mingw_target}-gcc-nothreads configure.args-append --enable-threads=posix \ --enable-libgomp notes " If you want your MinGW-generated windows binaries to work under wine out-of-the-box (and they are not statically linked), you can instruct wine to automatically search for dll-s by running: wine regedit Nagivate to: \[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment\] or \[HKEY_CURRENT_USER\\Environment\] and add Z:[string map {/ \\} ${prefix}]\\${mingw_target}\\bin to the 'PATH' variable. " } else { livecheck.type none } if {${subport} ne "${name}-bootstrap"} { post-destroot { move {*}[glob ${destroot}${prefix}/${mingw_target}/lib/*.dll] \ ${destroot}${prefix}/${mingw_target}/bin } pre-activate { foreach flavour {gcc-bootstrap gcc-nothreads gcc} { set gcc ${mingw_target}-${flavour} if {![catch {set installed [lindex [registry_active ${gcc}] 0]}]} { registry_deactivate_composite ${gcc} "" [list ports_nodepcheck 1] } } } }