2 $! This file sets things up to build gas on a VMS system to generate object
3 $! files for a VMS system. We do not use the configure script, since we
4 $! do not have /bin/sh to execute it.
7 $ arch=F$GETSYI("ARCH_NAME")
8 $ arch=F$EDIT(arch,"LOWERCASE")
13 $ target_alias = "alpha-dec-openvms"
14 $ target_canonical = "alpha-dec-openvms"
20 $ target_alias = "ia64-openvms"
21 $ target_canonical = "ia64-unknown-openvms"
25 $ write sys$output "Generate targ-cpu.[ch]"
27 $! Target specific information
28 $ open/write outfile targ-cpu.h
29 $ write outfile "#include ""tc-''arch'.h"""
31 $! Target specific information
32 $ open/write outfile targ-cpu.c
33 $ write outfile "#include ""tc-''arch'.c"""
36 $ write sys$output "Generate targ-env.h"
38 $ open/write outfile targ-env.h
39 $ write outfile "#include ""te-''env'.h"""
42 $ write sys$output "Generate obj-format.[ch]"
44 $! Code to handle the object file format.
45 $ open/write outfile obj-format.h
46 $ write outfile "#include ""obj-''format'.h"""
48 $ open/write outfile obj-format.c
49 $ write outfile "#include ""obj-''format'.c"""
52 $ write sys$output "Generate atof-targ.c"
55 #include "atof-ieee.c"
57 $ write sys$output "Generate gas/config.h"
59 $ create config-vms.in
60 /* config.h. Generated by configure.com. */
61 /* Define to 1 if using `alloca.c'. */
64 /* Default architecture. */
67 /* Default emulation. */
68 #define DEFAULT_EMULATION ""
70 /* Supported emulations. */
73 /* Define if you want run-time sanity checks. */
74 #undef ENABLE_CHECKING
76 /* Define to 1 if translation of program messages to the user's native
77 language is requested. */
80 /* Define to 1 if you have `alloca', as a function or macro. */
83 #define C_alloca(x) __ALLOCA(x)
85 /* Define to 1 if you have the `basename' function. */
86 #define HAVE_DECL_BASENAME 1
88 /* Is the prototype for getopt in <unistd.h> in the expected format? */
89 #define HAVE_DECL_GETOPT 1
91 /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
93 #undef HAVE_DECL_VSNPRINTF
95 /* Define to 1 if you have the declaration of `snprintf', and to 0 if you
97 #define HAVE_DECL_SNPRINTF 1
99 /* Define to 1 if you have the <errno.h> header file. */
100 #define HAVE_ERRNO_H 1
102 /* Define to 1 if you have the <limits.h> header file. */
105 /* Define to 1 if you have the `remove' function. */
106 #define HAVE_REMOVE 1
108 /* Define to 1 if you have the <stdarg.h> header file. */
109 #define HAVE_STDARG_H 1
111 /* Define to 1 if you have the <stdint.h> header file. */
114 /* Define to 1 if you have the <stdlib.h> header file. */
115 #define HAVE_STDLIB_H 1
117 /* Define to 1 if you have the <strings.h> header file. */
118 #define HAVE_STRINGS_H 1
120 /* Define to 1 if you have the <string.h> header file. */
121 #define HAVE_STRING_H 1
123 /* Define to 1 if you have the <sys/stat.h> header file. */
124 #undef HAVE_SYS_STAT_H
126 /* Define to 1 if you have the <sys/types.h> header file. */
127 #undef HAVE_SYS_TYPES_H
129 /* Define to 1 if you have the <unistd.h> header file. */
132 /* Define to 1 if you have the `unlink' function. */
135 /* Name of package */
136 #define PACKAGE "gas"
138 /* Define to the address where bug reports for this package should be sent. */
139 #define PACKAGE_BUGREPORT ""
141 /* Define to the full name of this package. */
142 #define PACKAGE_NAME ""
144 /* Define to the full name and version of this package. */
145 #define PACKAGE_STRING ""
147 /* Define to the one symbol short name of this package. */
148 #define PACKAGE_TARNAME ""
150 /* Define to the version of this package. */
151 #define PACKAGE_VERSION ""
153 /* Define to 1 if you have the ANSI C header files. */
154 #define STDC_HEADERS 1
157 #define TARGET_OS "openvms"
160 #define TARGET_VENDOR "dec"
162 /* Define to 1 if your processor stores words with the most significant byte
163 first (like Motorola and SPARC, unlike Intel and VAX). */
164 #define WORDS_BIGENDIAN 1
166 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
168 #undef YYTEXT_POINTER
170 /* Version number of package */
172 $! Get VERSION from ../bfd/configure.in
174 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input
177 mfile := CREATE_BUFFER("mfile", "[-.bfd]configure.in");
178 match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, mfile);
179 IF match_pos <> 0 THEN;
180 POSITION(BEGINNING_OF(match_pos));
182 vers := CURRENT_LINE-")";
187 file := CREATE_BUFFER("file", "config-vms.in");
188 POSITION(END_OF(file));
189 COPY_TEXT("#define VERSION """);
192 WRITE_FILE(file, "config.h");
195 $del/nolog config-vms.in;
196 $ open/append outfile config.h
198 $ write outfile "/* Target alias. */"
199 $ write outfile "#define TARGET_ALIAS ""''target_alias'"""
201 $ write outfile "/* Canonical target. */"
202 $ write outfile "#define TARGET_CANONICAL ""''target_canonical'"""
204 $ write outfile "/* Target CPU. */"
205 $ write outfile "#define TARGET_CPU ""'arch'"""
208 $ write sys$output "Generate gas/build.com"
214 $ CFLAGS=OPT + "/include=([],""../include"",[-.bfd],""../"",[.config])" +-
215 "/name=(as_is,shortened)" +-
216 "/prefix=(all,exc=(""getopt"",""optarg"",""optopt"",""optind"",""opterr""))"
217 $ FILES="obj-format,atof-targ,app,as,atof-generic,cond,depend,"+-
218 "expr,flonum-konst,flonum-copy,flonum-mult,frags,hash,input-file,"+-
219 "input-scrub,literal,messages,output-file,read,subsegs,symbols,write,"+-
220 "listing,ecoff,stabs,sb,macro,ehopt,dw2gencfi,dwarf2dbg,remap"
221 $ LIBBFD = ",[-.bfd]libbfd.olb/lib"
222 $ LIBIBERTY = ",[-.libiberty]libiberty.olb/lib"
223 $ LIBOPCODES = ",[-.opcodes]libopcodes.olb/lib"
225 $ AS_OBJS="targ-cpu," + FILES
227 $ write sys$output "CFLAGS=",CFLAGS
233 $ open/append outfile build.com
234 $ write outfile "$ write sys$output ""Compiling te-vms.c"""
235 $ write outfile "$ cc 'CFLAGS /obj=te-vme.obj [.config]te-vms.c + " +-
236 "sys$library:sys$lib_c.tlb/lib"
237 $ write outfile "$ AS_OBJS=AS_OBJS + "",te-vms.obj"""
241 $ append sys$input build.com
245 $ write sys$output "Compiling targ-cpu.c (/noopt)"
246 $ cc 'CFLAGS /noopt targ-cpu
249 $ F = F$ELEMENT(NUM,",",FILES)
250 $ IF F.EQS."," THEN GOTO END
251 $ write sys$output "Compiling ", F, ".c"
259 $ write sys$output "Building as.exe"
260 $ AS_OBJS=AS_OBJS + LIBOPCODES + LIBBFD + LIBIBERTY
261 $ link/exe=as 'AS_OBJS