Changeset 48
- Timestamp:
- Jun 24, 2009, 11:04:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.cmd
r47 r48 732 732 * however they are real functions in the library */ 733 733 734 old_qconfig_h = "" 734 /* use an "at exit" slot to undo temporary file rename operations since we 735 * can fail in the middle */ 736 exs = AddAtExitSlot() 737 735 738 qconfig_h = G.OutPath"\src\corelib\global\qconfig.h" 736 739 qmake_qconfig_h = qconfig_h".qmake" 737 740 if (FileExists(qconfig_h)) then do 738 old_qconfig_h = qconfig_h 739 call MoveFile old_qconfig_h, old_qconfig_h".old" 741 call MoveFile qconfig_h, qconfig_h".old" 742 /* record undo Move operation */ 743 call PutToAtExitSlot exs, 'call MoveFile "'qconfig_h'.old", "'qconfig_h'"' 740 744 end 741 745 … … 746 750 747 751 call MoveFile qmake_qconfig_h, qconfig_h 752 /* record undo Move operation */ 753 call PutToAtExitSlot exs, 'call MoveFile "'qconfig_h'", "'qmake_qconfig_h'"' 754 748 755 list.1 = G.OutPath"\include\QtCore\qconfig.h" 749 756 list.2 = G.OutPath"\include\Qt\qconfig.h" … … 761 768 762 769 /* put back original qconfig.h */ 763 call MoveFile qconfig_h, qmake_qconfig_h 764 if (old_qconfig_h \== "") then 765 call MoveFile old_qconfig_h".old", old_qconfig_h 770 call RunAtExitSlot exs 766 771 767 772 /* exit on failure */ … … 2335 2340 * @version 1.1 2336 2341 */ 2337 /* <<< export to qt.cmd starts */2338 2342 AddPathVar: procedure expose (Globals) 2339 2343 parse arg name, path, mode, environment … … 2385 2389 else call value name, cur 2386 2390 return 2387 /* >>> export to qt.cmd ends */2388 2391 2389 2392 /** 2390 2393 * Shortcut to AddPathVar(name, path, prepend, 'OS2ENVIRONMENT') 2391 2394 */ 2392 /* <<< export to qt.cmd starts */2393 2395 AddPathEnv: procedure expose (Globals) 2394 2396 parse arg name, path, prepend 2395 2397 call AddPathVar name, path, prepend, 'OS2ENVIRONMENT' 2396 2398 return 2397 /* >>> export to qt.cmd ends */2398 2399 2399 2400 /** … … 2422 2423 end 2423 2424 return str 2425 2426 /** 2427 * Initializes a new "at exit" slot and returns its ID. 2428 */ 2429 AddAtExitSlot: procedure expose (Globals) 2430 id = 1 2431 if (symbol('G.AtExit.0') == 'VAR') then 2432 id = G.AtExit.0 + 1 2433 G.AtExit.0 = id 2434 G.AtExit.id = "" 2435 return id 2436 2437 /** 2438 * Puts the REXX code passed in @a aCommand to the "at exit" slot with @a aID. 2439 * The entire set of commands will be executed upon program termination 2440 * unless the slot is purged earlier with RunAtExitSlot. 2441 * 2442 * Note that the commands will be executed in the order reverse to the order of 2443 * PutToAtExitSlot calls (i.e. the last put command will be executed first). 2444 * 2445 * @param aID Slot ID to add the command to. 2446 * @param aCommand Command to add. 2447 */ 2448 PutToAtExitSlot: procedure expose (Globals) 2449 parse arg aID, aCommand 2450 if (G.AtExit.aID == "") then 2451 G.AtExit.aID = aCommand 2452 else 2453 G.AtExit.aID = aCommand"; "G.AtExit.aID 2454 return 2455 2456 /** 2457 * Executes the "at exit" slot with @a aID and purges (removes) it from the 2458 * collection of slots so that it won't be executed upon program termination. 2459 * 2460 * Note that the commands will be executed in the order reverse to the order of 2461 * PutToAtExitSlot calls (i.e. the last put command will be executed first). 2462 * 2463 * @param aID Slot ID to run. 2464 */ 2465 RunAtExitSlot: procedure expose (Globals) 2466 parse arg aID 2467 cmds = G.AtExit.aID 2468 drop G.AtExit.aID 2469 /* shorten the list if we are the last (unless called from Done) */ 2470 if (value('G.Done_done') \= 1) then 2471 if (G.AtExit.0 == aID) then 2472 G.AtExit.0 = aID - 1 2473 /* execute commands */ 2474 interpret cmds 2475 return 2424 2476 2425 2477 /** … … 2488 2540 call value 'G.Done_done', 1 2489 2541 /* cleanup stuff goes there */ 2490 /* ... */ 2542 if (symbol('G.AtExit.0') == 'VAR') then do 2543 /* run all AtExit slots */ 2544 do i = 1 to G.AtExit.0 2545 if (symbol('G.AtExit.'i) == 'VAR') then 2546 call RunAtExitSlot i 2547 end 2548 end 2549 drop G.AtExit. 2491 2550 /* finally, exit */ 2492 2551 exit code
Note:
See TracChangeset
for help on using the changeset viewer.