File: vmsbuild.com

package info (click to toggle)
unixodbc 2.1.1-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 12,668 kB
  • ctags: 12,486
  • sloc: ansic: 107,685; cpp: 33,663; sh: 13,300; makefile: 2,926; yacc: 499; lex: 241; sed: 93; sql: 1
file content (142 lines) | stat: -rw-r--r-- 4,181 bytes parent folder | download
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
$ set nover
$
$ cwd = f$directory()
$ basedir = cwd - "]"
$ 
$ includes = "''basedir'.INCLUDE],''basedir'.EXTRAS]"
$ defines = "UNIXODBC,HAVE_PWD_H," + """""readonly""""=""""__readonly"""""
$
$ if p1 .eqs. "" then $goto ERR_NOPARAMS
$
$ CFLAGS="/opt/nodeb/name=as_is/prefix=all/include=(''includes')/warning=nowarnings/define=(''defines')"
$ LFLAGS="/nodeb/notrace"
$
$! DEBUG DEFINES
$! CFLAGS="/noopt/deb/name=as_is/prefix=all/include=(''includes')/warning=nowarnings/define=(''defines')"
$! LFLAGS="/deb/trace"
$
$ if p1 .eqs. "CLEAN" 
$ then
$   set def 'cwd'
$   write sys$output "Removing all object files"
$   del [...]*.obj;*
$   write sys$output "Removing all object libraries"
$   del [...]*.olb;*
$ endif
$
$ if p1 .eqs. "COMPILE" .or. p1 .eqs. "ALL"
$ then
$   write sys$output "Compiling unixODBC"
$   call compile "[.extras]" "*.c"
$   call compile "[.ini]" "*.c"
$   call compile "[.log]" "*.c"
$   call compile "[.lst]" "*.c"
$   call compile "[.odbcinst]" "*.c"
$   call compile "[.drivermanager]" "*.c"
$   call compile "[.exe]" "isql*.c"
$   call compile "[.drivers.postgresql]" "*.c"
$   write sys$output "Building Object Libraries"
$   set def 'cwd'
$   library/create [.vms]libodbcinst.olb
$   library/insert [.vms]libodbcinst.olb [.extras]*.obj, [.ini]*.obj, [.log]*.obj, [.lst]*.obj, [.odbcinst]*.obj
$   library/create [.vms]libodbc.olb
$   library/insert [.vms]libodbc.olb [.extras]*.obj,[.ini]*.obj, [.lst]*.obj, [.drivermanager]*.obj
$   library/create [.vms]libodbcpsql.olb
$   library/insert [.vms]libodbcpsql.olb [.drivers.postgresql]*.obj
$
$ endif
$!
$! Build Shared objects
$!
$
$!
$! Install them
$!
$ if p1 .eqs. "LINK" .or. p1 .eqs. "ALL"
$ then
$   set def 'cwd'
$   set def [.vms]
$
$   write sys$output "Linking ODBCINST.EXE"
$   link 'LFLAGS' libodbcinst.olb/lib,odbcinst_axp.opt/opt /exec=odbcinst.exe/share
$   write sys$output "Installing image SYS$SHARE:ODBCINST.EXE"
$   copy odbcinst.exe sys$share:odbcinst.exe
$   @install_image sys$share:odbcinst.exe
$
$   write sys$output "Linking ODBC.EXE"
$   link 'LFLAGS' libodbc.olb/lib,odbc_axp.opt/opt /exec=odbc.exe/share
$   write sys$output "Installing image SYS$SHARE:ODBC.EXE"
$   copy odbc.exe sys$share:odbc.exe
$   @install_image sys$share:odbc.exe
$
$   write sys$output "Linking ODBCPSQL.EXE"
$   link 'LFLAGS' libodbcpsql.olb/lib/inc=psqlodbc,odbc2_axp.opt/opt /exec=odbcpsql.exe/share
$   write sys$output "Installing image SYS$SHARE:ODBCPSQL.EXE"
$   copy odbcpsql.exe sys$share:odbcpsql.exe
$   @install_image sys$share:odbcpsql.exe
$
$   write sys$output "Linking ISQL.EXE"
$   set def [-.exe]
$   link 'LFLAGS' ISQL.OBJ,ISQL_AXP.OPT/OPT
$
$   set def 'cwd'
$
$!
$! check for odbc.ini and odbcinst.ini in SYS$SHARE
$! 
$   file = f$search ("SYS$SHARE:ODBC.INI")
$   if file .eqs. ""
$   then 
$     write sys$output "Creating SYS$SHARE:ODBC.INI"
$     create sys$share:odbc.ini

$   endif
$!
$   file = f$search ("SYS$SHARE:ODBCINST.INI")
$   if file .eqs. ""
$   then 
$     write sys$output "Creating SYS$SHARE:ODBCINST.INI"
$     create sys$share:odbcinst.ini

$   endif
$ endif
$!
$ set def 'cwd'
$ exit (1)
$
$ ERR_NOPARAMS:
$ write sys$output " "
$ write sys$output "The correct calling sequence is: "
$ write sys$output " "
$ write sys$output "$ @vmsbuild p1
$ write sys$output " "
$ write sys$output "Where p1 is : "
$ write sys$output " "
$ write sys$output "    ALL      : COMPILE and LINK steps."
$ write sys$output "    CLEAN    : Remove all objects and object libraries."
$ write sys$output "    COMPILE  : Compile all source and produce object libraries"
$ write sys$output "    LINK     : Link, copy and install driver manager shared objects into SYS$SHARE:"
$ write sys$output " "
$ exit 44
$
$!
$! compile subroutine will compile all p1 source files
$!
$ compile : subroutine
$ set def 'p1'
$ loop:
$   file = f$search ("''p2'",1)
$   if file .eqs. "" then goto complete
$   filename = f$parse (file,,,"name")
$   object = F$SEARCH ("''filename'.OBJ;*",2)
$   if object .eqs. ""
$   then
$      write sys$output "cc ''CFLAGS' ''filename'.C"
$      cc 'CFLAGS' 'filename'
$   endif
$   goto loop
$ complete:
$ set def 'cwd'
$ exit
$ endsubroutine : compile
$