| 105 | variant universal { |
| 106 | pre-fetch { |
| 107 | if {![file exists ${configure.universal_sysroot}]} { |
| 108 | return -code error "Universal SDK is not installed (are we running on 10.3? did you forget to install it?) and building with +universal will very likely fail" |
| 109 | } |
| 110 | ui_debug "[configure_get_universal_system_name]" |
| 111 | } |
| 112 | |
| 113 | post-patch { |
| 114 | set first_arch [lindex ${configure.universal_archs} 0] |
| 115 | foreach {arch} ${configure.universal_archs} { |
| 116 | copy ${worksrcpath} ${workpath}/${arch} |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | configure { |
| 121 | set archs ${configure.universal_archs} |
| 122 | set args ${configure.args} |
| 123 | set cflags ${configure.cflags} |
| 124 | set cxxflags ${configure.cxxflags} |
| 125 | set cppflags ${configure.cppflags} |
| 126 | set ldflags ${configure.ldflags} |
| 127 | |
| 128 | foreach {arch} $archs { |
| 129 | configure.universal_archs $arch |
| 130 | eval configure.args $args [configure_get_universal_args] |
| 131 | eval configure.cflags $cflags [configure_get_universal_cflags] |
| 132 | eval configure.cxxflags $cxxflags [configure_get_universal_cflags] |
| 133 | eval configure.cppflags $cppflags [configure_get_universal_cppflags] |
| 134 | eval configure.ldflags $ldflags [configure_get_universal_ldflags] |
| 135 | configure.dir ${workpath}/${arch} |
| 136 | configure_main |
| 137 | } |
| 138 | |
| 139 | eval configure.universal_archs $archs |
| 140 | } |
| 141 | |
| 142 | build { |
| 143 | foreach {arch} ${configure.universal_archs} { |
| 144 | if {[string range $arch 0 2] == "ppc"} { |
| 145 | touch \ |
| 146 | ${workpath}/${arch}/fc-arch/fc-arch.o \ |
| 147 | ${workpath}/${arch}/fc-arch/fc-arch |
| 148 | |
| 149 | set fcarch [open ${workpath}/${arch}/fc-arch/fcarch.h w] |
| 150 | puts $fcarch "#define FC_ARCHITECTURE \"$arch\"" |
| 151 | close $fcarch |
| 152 | } |
| 153 | |
| 154 | build.dir ${workpath}/${arch} |
| 155 | build_main |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | destroot { |
| 160 | foreach {arch} ${configure.universal_archs} { |
| 161 | destroot.dir ${workpath}/${arch} |
| 162 | destroot.destdir DESTDIR=${workpath}/pre-dest/${arch} |
| 163 | destroot_main |
| 164 | } |
| 165 | |
| 166 | merge ${workpath}/pre-dest |
| 167 | } |
| 168 | } |
| 169 | |