]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/one-true-awk/mac.code
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / one-true-awk / mac.code
1 Note added June, 2002:  
2
3 With the advent of OS X, life is simpler:  if you have the developer
4 tools installed, the standard awk makefile and gcc works fine, and
5 you can ignore the rest of this file, which is now hereby deprecated.
6
7
8
9
10 This file contains a make shell script and a version of the file
11 missing95.c for the Mac, courtesy of Dan Allen.
12
13 make shell script:
14
15 # MPW Shell script to build Awk using Apple's MRC compiler.
16 # 22 Jan 1999 - Created by Dan Allen.
17 # 25 Mar 1999 - Updated for newer Awk.
18 #
19 # Porting notes for the Mac:
20
21 # 1.  main in main.c needs to have its prototype changed to:
22
23 #     int main(int argc, char *argv[], char *environ[])
24 #
25 # 2.  popen and pclose in missing95.c need to have as their body the
26 #     older style
27 #
28 #                               return NULL;
29 #
30 #     as parallel pipes are not supported by MPW.
31 #
32 # 3.  To make your Mac more responsive while long awk scripts run,
33 #     you may want to add some SpinCursor calls to support cooperative multitasking.
34 #
35 # All of these minor changes can be put under "#ifdef powerc" for portability's sake.
36 #
37 #
38
39 If {1} == "clean"
40         Delete -i awk maketab maketab.c.o ytab.c.o b.c.o main.c.o parse.c.o proctab.c proctab.c.o tran.c.o lib.c.o run.c.o lex.c.o missing95.c.o
41 Else
42         MRC ytab.c -w off -opt speed
43         MRC b.c -w off -opt speed
44         MRC main.c -w off -opt speed
45         MRC parse.c -w off -opt speed
46         MRC maketab.c -w off -opt speed
47         PPCLink -o maketab maketab.c.o "{PPCLibraries}InterfaceLib" "{PPCLibraries}MathLib" "{PPCLibraries}StdCLib" "{PPCLibraries}StdCRuntime.o" "{PPCLibraries}PPCCRuntime.o" "{PPCLibraries}PPCToolLibs.o" -t MPST -c 'MPS '
48         maketab > proctab.c
49         MRC proctab.c -w off -opt speed
50         MRC tran.c -w off -opt speed
51         MRC lib.c -w off -opt speed
52         MRC run.c -w off -opt speed
53         MRC lex.c -w off -opt speed
54         MRC missing95.c -w off -opt speed
55         PPCLink -o awk ytab.c.o b.c.o main.c.o parse.c.o proctab.c.o tran.c.o lib.c.o run.c.o lex.c.o missing95.c.o "{PPCLibraries}InterfaceLib" "{PPCLibraries}MathLib" "{PPCLibraries}StdCLib" "{PPCLibraries}StdCRuntime.o" "{PPCLibraries}PPCCRuntime.o" "{PPCLibraries}PPCToolLibs.o" -d
56         SetFile awk -d . -m . -t MPST -c 'MPS '
57 End
58
59
60 missing95.c for the Mac:
61
62 /* popen and pclose are not available on the Mac. */
63
64 #include <stdio.h>
65
66 FILE *popen(char *s, char *m) {
67         return NULL;
68 }
69
70 int pclose(FILE *f) {
71         return NULL;
72 }
73