]> git.sesse.net Git - rdpsrv/blob - Xserver/config/util/xmkmf.cmd
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / config / util / xmkmf.cmd
1 /* OS/2 REXX */
2 /* make a Makefile from an Imakefile from inside or outside the sources
3  * 
4  * $XFree86: xc/config/util/xmkmf.cmd,v 3.1 1996/04/15 11:14:27 dawes Exp $
5  */
6 '@ECHO OFF'
7
8 /* this is actually used here */
9 x11root = getenv('X11ROOT')
10
11 /* these ones are checked only, because later scripts rely on their existance */
12 libpath = getenv('LIBRARY_PATH')
13 incpath = getenv('C_INCLUDE_PATH')
14
15 /* get args */
16 PARSE ARG arg0 arg1 arg2 arg3
17
18 /* from here almost everything is the same as in the xmkmf sh script */
19 topdir = ''
20 curdir = '.'
21 do_all = 0
22
23 IF arg0 = '-a' THEN DO
24         do_all = 1
25         arg0 = arg1
26         arg1 = arg2
27         arg2 = arg3
28 END
29 ELSE DO
30         do_all = 0
31 END
32
33 IF \(arg0 = '') THEN DO
34         IF \(arg1 = '') THEN
35                 curdir = arg1
36         topdir = arg0
37 END
38 IF \(arg2 = '') | SUBSTR(topdir,1,1) = '-' THEN DO
39         SAY 'usage:  xmkmf [-a] [top_of_sources_pathname [current_directory]]'
40         EXIT
41 END
42
43 IF exists('Makefile') THEN DO
44         SAY 'mv -f Makefile Makefile.bak'
45         'COPY Makefile Makefile.bak >nul 2>&1'
46         'DEL Makefile >nul 2>&1'
47 END
48
49 IF topdir = '' THEN
50         iargs = '-DUseInstalled -I'x11root'/XFree86/lib/X11/config'
51 ELSE
52         iargs = '-I'topdir'/config/cf -DTOPDIR='topdir' -DCURDIR='curdir
53
54 SAY 'imake 'iargs
55 IF do_all = 1 THEN DO
56         'imake 'iargs
57         SAY 'make Makefiles'
58         CALL make 'Makefiles'
59         SAY 'make includes'
60         CALL make 'includes'
61         SAY 'make depend'
62         CALL make 'depend'
63 END
64 ELSE
65         'imake 'iargs
66
67 EXIT
68
69 exists:
70 'DIR "'ARG(1)'" > nul 2>nul'
71 IF rc = 0 THEN RETURN 1
72 RETURN 0
73
74 getenv:
75 x = VALUE(ARG(1),,'OS2ENVIRONMENT')
76
77 IF x = '' THEN DO
78         SAY 'No 'ARG(1)' environment variable set!'
79         EXIT
80 END
81 RETURN x