Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 696 lines (661 sloc) 14.993 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695
# THIS IS A GENERATED FILE! DO NOT EDIT!
# Begin generated code

.loadlib "io_ops"
# end libs
.namespace [ ]

.sub 'main' :main
        .param pmc __ARG_1
.const 'Sub' WSubId_1 = "WSubId_1"
.const 'Sub' WSubId_2 = "WSubId_2"
.const 'Sub' WSubId_3 = "WSubId_3"
.const 'Sub' WSubId_4 = "WSubId_4"
.const 'Sub' WSubId_5 = "WSubId_5"
.const 'Sub' WSubId_6 = "WSubId_6"
.const 'Sub' WSubId_7 = "WSubId_7"
.const 'Sub' WSubId_8 = "WSubId_8"
# Body
# {
.annotate 'file', 'setup.winxed'
.annotate 'line', 5
# var parrot_gmp: $P1
    root_new $P1, ['parrot';'Hash']
    box $P5, 'Parrot-GMP'
    $P1["name"] = $P5
    box $P6, 'Parrot bindings for the GNU Multi-Precision Library'
    $P1["abstract"] = $P6
    box $P7, 'Parrot bindings for the GNU Multi-Precision Library. Currently has bindings for Integer type functions and random initialization functions.'
    $P1["description"] = $P7
    box $P8, 'http://github.com/bubaflub'
    $P1["authority"] = $P8
    box $P9, 'Bob Kuo'
    $P1["copyright_holder"] = $P9
.annotate 'line', 11
    root_new $P11, ['parrot';'ResizablePMCArray']
    box $P12, "parrot"
    push $P11, $P12
    box $P12, "gmp"
    push $P11, $P12
    $P1["keywords"] = $P11
    box $P13, 'Artistic License 2.0'
    $P1["license_type"] = $P13
    box $P14, 'http://www.perlfoundation.org/artistic_license_2_0'
    $P1["license_uri"] = $P14
    box $P15, 'git://github.com/bubaflub/parrot-gmp.git'
    $P1["checkout_uri"] = $P15
    box $P16, 'git://github.com/bubaflub/parrot-gmp'
    $P1["browser_uri"] = $P16
    box $P17, 'git://github.com/bubaflub/parrot-gmp'
    $P1["project_uri"] = $P17
.annotate 'line', 17
    root_new $P19, ['parrot';'Hash']
    $P1["pir_winxed"] = $P19
.annotate 'line', 18
    root_new $P21, ['parrot';'Hash']
    $P1["pbc_pir"] = $P21
.annotate 'line', 19
    root_new $P23, ['parrot';'ResizablePMCArray']
    $P1["inst_lib"] = $P23
.annotate 'line', 20
    root_new $P26, ['parrot';'Hash']
    $P1["installable_pbc"] = $P26
.annotate 'line', 21
    root_new $P28, ['parrot';'Hash']
    $P1["include_winxed"] = $P28
.annotate 'line', 22
    root_new $P30, ['parrot';'ResizablePMCArray']
    box $P31, "README.md"
    push $P30, $P31
    box $P31, "setup.winxed"
    push $P30, $P31
    $P1["manifest_includes"] = $P30
.annotate 'line', 24
# var config: $P2
# predefined getinterp
    getinterp $P5
    $P2 = $P5[8]
.annotate 'line', 25
# pirop set_global
    set_global 'config', $P2
.annotate 'line', 27
    $P5 = __ARG_1[1]
    set $S1, $P5
    ne $S1, "test", __label_1
.annotate 'line', 28
    WSubId_1()
  __label_1: # endif
.annotate 'line', 30
    WSubId_2($P1)
# predefined load_bytecode
.annotate 'line', 32
    load_bytecode 'distutils.pir'
.annotate 'line', 33
    get_hll_global $P3, 'setup'
.annotate 'line', 34
    get_hll_global $P4, 'register_step_before'
.annotate 'line', 36
    $P4("build", WSubId_3)
.annotate 'line', 37
    $P4("clean", WSubId_4)
.annotate 'line', 39
    $P5 = WSubId_5('has_libffi')
    set $I1, $P5
    eq $I1, 1, __label_2
# {
.annotate 'line', 40
    $P4("build", WSubId_6)
.annotate 'line', 41
    $P4("clean", WSubId_7)
.annotate 'line', 42
    'register_step_after'("install", WSubId_8)
# }
  __label_2: # endif
.annotate 'line', 45
    __ARG_1.'shift'()
.annotate 'line', 46
    $P3(__ARG_1, $P1)
# }
.annotate 'line', 47

.end # main


.sub 'setup_stable_libraries' :subid('WSubId_2')
        .param pmc __ARG_1
# Body
# {
.annotate 'line', 50
    $P2 = __ARG_1["pbc_pir"]
    $P2["GMP/raw.pbc"] = "src/GMP/raw.pir"
.annotate 'line', 51
    $P2 = __ARG_1["inst_lib"]
    $P2.'push'("GMP/raw.pbc")
.annotate 'line', 53
# var libs: $P1
    root_new $P1, ['parrot';'ResizablePMCArray']
    box $P2, 'Common'
    push $P1, $P2
    box $P2, 'Random'
    push $P1, $P2
    box $P2, 'Integer'
    push $P1, $P2
.annotate 'line', 59
# prefix: $S1
    set $S1, "src/GMP/"
.annotate 'line', 61
    if_null $P1, __label_2
    iter $P3, $P1
    set $P3, 0
  __label_1: # for iteration
    unless $P3 goto __label_2
    shift $S2, $P3
# {
.annotate 'line', 62
# winxed_file: $S3
    concat $S3, $S1, $S2
    concat $S3, $S3, ".winxed"
.annotate 'line', 63
# pir_file: $S4
    concat $S4, $S1, $S2
    concat $S4, $S4, ".pir"
.annotate 'line', 64
# pbc_file: $S5
    concat $S5, "GMP/", $S2
    concat $S5, $S5, ".pbc"
.annotate 'line', 65
    $P2 = __ARG_1["pir_winxed"]
    $P2[$S4] = $S3
.annotate 'line', 66
    $P2 = __ARG_1["pbc_pir"]
    $P2[$S5] = $S4
.annotate 'line', 67
    $P2 = __ARG_1["inst_lib"]
    $P2.'push'($S5)
# }
    goto __label_1
  __label_2: # endfor
# }
.annotate 'line', 70

.end # setup_stable_libraries


.sub 'do_test' :subid('WSubId_1')
.const 'Sub' WSubId_9 = "WSubId_9"
# Body
# {
.annotate 'line', 73
# result: $I1
    null $I1
.annotate 'line', 74
# command: $S1
    root_new $P2, ['parrot';'ResizablePMCArray']
    box $P3, "parrot-nqp"
    push $P2, $P3
    box $P3, "t/harness"
    push $P2, $P3
    $P1 = WSubId_9($P2)
    null $S1
    if_null $P1, __label_1
    set $S1, $P1
  __label_1:
.annotate 'line', 78
# pirop spawnw
    spawnw $I1, $S1
.annotate 'line', 79
# pirop exit
    exit $I1
# }
.annotate 'line', 80

.end # do_test


.sub 'check_dependencies' :subid('WSubId_3')
.const 'Sub' WSubId_5 = "WSubId_5"
.const 'Sub' WSubId_9 = "WSubId_9"
# Body
# {
.annotate 'line', 84
# maj: $I1
    $P4 = WSubId_5('MAJOR')
    set $I1, $P4
.annotate 'line', 85
# min: $I2
    $P4 = WSubId_5('MINOR')
    set $I2, $P4
.annotate 'line', 86
    islt $I8, $I1, 3
    if $I8 goto __label_2
    iseq $I8, $I1, 3
    unless $I8 goto __label_3
    islt $I8, $I2, 2
  __label_3:
  __label_2:
    unless $I8 goto __label_1
# {
# predefined die
.annotate 'line', 87
    die "You need at least Parrot 3.2.0 to use Parrot-GMP"
# }
  __label_1: # endif
.annotate 'line', 90
# has_gmp: $I3
    $P4 = WSubId_5('HAS_GMP')
    set $I3, $P4
.annotate 'line', 91
    not $I8, $I3
    unless $I8 goto __label_4
# {
# predefined die
.annotate 'line', 92
    die "You need to have Parrot configured with GMP to use Parrot-GMP"
# }
  __label_4: # endif
.annotate 'line', 96
# file: $S1
    set $S1, "build/gmp_test.c"
.annotate 'line', 97
# exe: $S2
# predefined string
    $P4 = WSubId_5('exe')
    set $S5, $P4
    concat $S2, "build/gmp_test", $S5
.annotate 'line', 98
# command: $S3
    root_new $P5, ['parrot';'ResizablePMCArray']
.annotate 'line', 99
    $P7 = WSubId_5('cc')
.annotate 'line', 98
    push $P5, $P7
.annotate 'line', 100
    $P8 = WSubId_5('ccflags')
.annotate 'line', 98
    push $P5, $P8
.annotate 'line', 101
    $P9 = WSubId_5('cc_exe_out')
.annotate 'line', 98
    push $P5, $P9
.annotate 'line', 102
    box $P6, $S2
.annotate 'line', 98
    push $P5, $P6
.annotate 'line', 103
    box $P6, $S1
.annotate 'line', 98
    push $P5, $P6
    $P4 = WSubId_9($P5)
    null $S3
    if_null $P4, __label_5
    set $S3, $P4
  __label_5:
.annotate 'line', 105
# predefined say
    say $S3
.annotate 'line', 106
    'system'($S3)
.annotate 'line', 107
# var pipe: $P1
    new $P1, [ "FileHandle" ]
.annotate 'line', 108
    $P1.'encoding'('utf8')
.annotate 'line', 109
    $P1.'open'($S2, "rp")
.annotate 'line', 110
# output: $S4
    $P4 = $P1.'readall'()
    null $S4
    if_null $P4, __label_6
    set $S4, $P4
  __label_6:
.annotate 'line', 111
    $P1.'close'()
.annotate 'line', 112
# exit_status: $I4
    $P4 = $P1.'exit_status'()
    set $I4, $P4
.annotate 'line', 113
    eq $I4, 0, __label_7
# {
.annotate 'line', 114
    concat $S5, "Could not run ", $S2
    concat $S5, $S5, ": please check that your system has libgmp"
# predefined die
    die $S5
# }
  __label_7: # endif
.annotate 'line', 116
# var lines: $P2
# predefined split
    split $P2, "\n", $S4
.annotate 'line', 117
# var values: $P3
    $P4 = $P2[0]
    set $S5, $P4
# predefined split
    split $P3, ' ', $S5
.annotate 'line', 118
# gmp_major: $I5
    $I5 = $P3[0]
.annotate 'line', 119
# gmp_minor: $I6
    $I6 = $P3[1]
.annotate 'line', 120
# gmp_patch: $I7
    $I7 = $P3[2]
.annotate 'line', 121
    islt $I8, $I5, 4
    if $I8 goto __label_9
    iseq $I8, $I5, 4
    unless $I8 goto __label_10
    islt $I8, $I6, 2
  __label_10:
  __label_9:
    unless $I8 goto __label_8
# {
# predefined die
.annotate 'line', 122
    die "Need GMP version >= 4.2"
# }
  __label_8: # endif
# }
.annotate 'line', 125

.end # check_dependencies


.sub 'clean_build_dir' :subid('WSubId_4')
.const 'Sub' WSubId_5 = "WSubId_5"
.const 'Sub' WSubId_10 = "WSubId_10"
# Body
# {
.annotate 'line', 128
# exe: $S1
# predefined string
    $P1 = WSubId_5('exe')
    set $S2, $P1
    concat $S1, "build/gmp_test", $S2
.annotate 'line', 129
    WSubId_10($S1)
.annotate 'line', 130
    WSubId_10("src/GMP/thunks.c")
.annotate 'line', 131
    WSubId_10("src/GMP/thunks.o")
# }
.annotate 'line', 132

.end # clean_build_dir


.sub '_unlink_file' :subid('WSubId_10')
        .param string __ARG_1
# Body
# {
.annotate 'line', 135
# e: $I1
    null $I1
.annotate 'line', 136
# pirop stat
    stat $I1, __ARG_1, 0
.annotate 'line', 137
    unless $I1 goto __label_1
# {
.annotate 'line', 138
    concat $S1, "unlink ", __ARG_1
# predefined say
    say $S1
.annotate 'line', 139
    'unlink'(__ARG_1)
# }
  __label_1: # endif
# }
.annotate 'line', 141

.end # _unlink_file


.sub 'build_nci_thunks' :subid('WSubId_6')
.const 'Sub' WSubId_9 = "WSubId_9"
.const 'Sub' WSubId_5 = "WSubId_5"
# Body
# {
.annotate 'line', 144
# thunk: $S1
    set $S1, "src/GMP/thunks.c"
.annotate 'line', 145
# result: $I1
    null $I1
.annotate 'line', 146
# command: $S2
    root_new $P2, ['parrot';'ResizablePMCArray']
    box $P3, "parrot_nci_thunk_gen"
    push $P2, $P3
    box $P3, "--dynext"
    push $P2, $P3
    box $P3, "--no-warn-dups"
    push $P2, $P3
    box $P3, "--output=src/GMP/thunks.c"
    push $P2, $P3
    box $P3, "<src/GMP/thunks.nci"
    push $P2, $P3
    $P1 = WSubId_9($P2)
    null $S2
    if_null $P1, __label_1
    set $S2, $P1
  __label_1:
.annotate 'line', 153
# predefined say
    say $S2
.annotate 'line', 154
# pirop spawnw
    spawnw $I1, $S2
.annotate 'line', 156
# file: $S3
    set $S3, "src/GMP/thunks.c"
.annotate 'line', 157
# obj: $S4
# predefined string
    $P1 = WSubId_5('o')
    set $S6, $P1
    concat $S4, "GMP/thunks", $S6
.annotate 'line', 158
    root_new $P2, ['parrot';'ResizablePMCArray']
.annotate 'line', 159
    $P4 = WSubId_5('cc')
.annotate 'line', 158
    push $P2, $P4
.annotate 'line', 160
    $P5 = WSubId_5('embed-cflags')
.annotate 'line', 158
    push $P2, $P5
.annotate 'line', 161
    $P6 = WSubId_5('libparrot_linkflags')
.annotate 'line', 158
    push $P2, $P6
    box $P3, "-Ipmc/pmc_nci.h"
    push $P2, $P3
.annotate 'line', 163
    $P7 = WSubId_5('cc_o_out')
.annotate 'line', 158
    push $P2, $P7
.annotate 'line', 164
    box $P3, $S4
.annotate 'line', 158
    push $P2, $P3
    box $P3, "-c"
    push $P2, $P3
.annotate 'line', 166
    box $P3, $S3
.annotate 'line', 158
    push $P2, $P3
    $P1 = WSubId_9($P2)
    set $S2, $P1
.annotate 'line', 168
# predefined say
    say $S2
.annotate 'line', 169
# pirop spawnw
    spawnw $I1, $S2
.annotate 'line', 170
# shared_obj: $S5
# predefined string
    $P1 = WSubId_5('load_ext')
    set $S6, $P1
    concat $S5, "GMP/thunks", $S6
.annotate 'line', 171
    root_new $P2, ['parrot';'ResizablePMCArray']
.annotate 'line', 172
    $P4 = WSubId_5('ld')
.annotate 'line', 171
    push $P2, $P4
.annotate 'line', 173
    $P5 = WSubId_5('ld_out')
.annotate 'line', 171
    push $P2, $P5
.annotate 'line', 174
    box $P3, $S5
.annotate 'line', 171
    push $P2, $P3
.annotate 'line', 175
    box $P3, $S4
.annotate 'line', 171
    push $P2, $P3
.annotate 'line', 176
    $P6 = WSubId_5('ldflags')
.annotate 'line', 171
    push $P2, $P6
.annotate 'line', 177
    $P7 = WSubId_5('ld_debug')
.annotate 'line', 171
    push $P2, $P7
.annotate 'line', 178
    $P8 = WSubId_5('rpath_blib')
.annotate 'line', 171
    push $P2, $P8
.annotate 'line', 179
    $P9 = WSubId_5('linkflags')
.annotate 'line', 171
    push $P2, $P9
.annotate 'line', 180
    $P10 = WSubId_5('ld_load_flags')
.annotate 'line', 171
    push $P2, $P10
    $P1 = WSubId_9($P2)
    set $S2, $P1
.annotate 'line', 182
# predefined string
    $P1 = WSubId_5('parrot_is_shared')
    set $S6, $P1
    if_null $S6, __label_2
    unless $S6 goto __label_2
# {
.annotate 'line', 183
# predefined string
    $P2 = WSubId_5('inst_libparrot_ldflags')
    set $S7, $P2
    concat $S2, $S2, " "
    concat $S2, $S2, $S7
# }
  __label_2: # endif
.annotate 'line', 185
# predefined say
    say $S2
.annotate 'line', 186
# pirop spawnw
    spawnw $I1, $S2
# }
.annotate 'line', 187

.end # build_nci_thunks


.sub 'clean_nci_thunks' :subid('WSubId_7')
.const 'Sub' WSubId_10 = "WSubId_10"
.const 'Sub' WSubId_5 = "WSubId_5"
# Body
# {
.annotate 'line', 190
    WSubId_10("src/GMP/thunks.c")
.annotate 'line', 191
# predefined string
    $P1 = WSubId_5('o')
    set $S1, $P1
    concat $S2, "GMP/thunks", $S1
    WSubId_10($S2)
.annotate 'line', 192
# predefined string
    $P1 = WSubId_5('load_ext')
    set $S1, $P1
    concat $S2, "GMP/thunks", $S1
    WSubId_10($S2)
# }
.annotate 'line', 193

.end # clean_nci_thunks


.sub 'install_nci_thunks' :subid('WSubId_8')
.const 'Sub' WSubId_5 = "WSubId_5"
.const 'Sub' WSubId_9 = "WSubId_9"
# Body
# {
.annotate 'line', 196
# install_path: $S1
# predefined string
    $P1 = WSubId_5('libdir')
    set $S4, $P1
# predefined string
    $P2 = WSubId_5('versiondir')
    set $S5, $P2
    concat $S1, $S4, $S5
.annotate 'line', 197
# predefined string
    $P1 = WSubId_5('slash')
    set $S4, $P1
# predefined string
    $P2 = WSubId_5('slash')
    set $S5, $P2
    concat $S1, $S1, $S4
    concat $S1, $S1, 'dynext'
    concat $S1, $S1, $S5
.annotate 'line', 198
# shared_obj: $S2
# predefined string
    $P1 = WSubId_5('load_ext')
    set $S4, $P1
    concat $S2, "GMP/thunks", $S4
.annotate 'line', 199
# result: $I1
    null $I1
.annotate 'line', 200
# command: $S3
    root_new $P2, ['parrot';'ResizablePMCArray']
    box $P3, 'cp'
    push $P2, $P3
.annotate 'line', 202
    box $P3, $S2
.annotate 'line', 200
    push $P2, $P3
.annotate 'line', 203
    box $P3, $S1
.annotate 'line', 200
    push $P2, $P3
    $P1 = WSubId_9($P2)
    null $S3
    if_null $P1, __label_1
    set $S3, $P1
  __label_1:
.annotate 'line', 205
# predefined say
    say $S3
.annotate 'line', 206
# pirop spawnw
    spawnw $I1, $S3
# }
.annotate 'line', 207

.end # install_nci_thunks


.sub '_config' :subid('WSubId_5')
        .param string __ARG_1
# Body
# {
.annotate 'line', 210
# var config: $P1
    null $P1
.annotate 'line', 211
# pirop get_global
    get_global $P1, 'config'
# predefined string
.annotate 'line', 212
    $S1 = $P1[__ARG_1]
    .return($S1)
# }
.annotate 'line', 213

.end # _config


.sub '_build_command' :subid('WSubId_9')
        .param pmc __ARG_1
# Body
# {
# predefined string
.annotate 'line', 216
# predefined join
    join $S1, ' ', __ARG_1
    .return($S1)
# }
.annotate 'line', 217

.end # _build_command

# End generated code
Something went wrong with that request. Please try again.