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.
6 $! Copyright (C) 2012-2017 Free Software Foundation, Inc.
8 $! This file is free software; you can redistribute it and/or modify
9 $! it under the terms of the GNU General Public License as published by
10 $! the Free Software Foundation; either version 3 of the License, or
11 $! (at your option) any later version.
13 $! This program is distributed in the hope that it will be useful,
14 $! but WITHOUT ANY WARRANTY; without even the implied warranty of
15 $! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 $! GNU General Public License for more details.
18 $! You should have received a copy of the GNU General Public License
19 $! along with this program; see the file COPYING3. If not see
20 $! <http://www.gnu.org/licenses/>.
23 $ arch=F$GETSYI("ARCH_NAME")
24 $ arch=F$EDIT(arch,"LOWERCASE")
29 $ target_alias = "alpha-dec-openvms"
30 $ target_canonical = "alpha-dec-openvms"
36 $ target_alias = "ia64-openvms"
37 $ target_canonical = "ia64-unknown-openvms"
41 $ write sys$output "Generate targ-cpu.[ch]"
43 $! Target specific information
44 $ open/write outfile targ-cpu.h
45 $ write outfile "#include ""tc-''arch'.h"""
47 $! Target specific information
48 $ open/write outfile targ-cpu.c
49 $ write outfile "#include ""tc-''arch'.c"""
52 $ write sys$output "Generate targ-env.h"
54 $ open/write outfile targ-env.h
55 $ write outfile "#include ""te-''env'.h"""
58 $ write sys$output "Generate obj-format.[ch]"
60 $! Code to handle the object file format.
61 $ open/write outfile obj-format.h
62 $ write outfile "#include ""obj-''format'.h"""
64 $ open/write outfile obj-format.c
65 $ write outfile "#include ""obj-''format'.c"""
68 $ write sys$output "Generate atof-targ.c"
71 #include "atof-ieee.c"
73 $ write sys$output "Generate gas/config.h"
75 $ create config-vms.in
76 /* config.h. Generated by configure.com. */
77 /* Define to 1 if using `alloca.c'. */
80 /* Default architecture. */
83 /* Default emulation. */
84 #define DEFAULT_EMULATION ""
86 /* Supported emulations. */
89 /* Define if you want run-time sanity checks. */
90 #undef ENABLE_CHECKING
92 /* Define to 1 if translation of program messages to the user's native
93 language is requested. */
96 /* Define to 1 if you have `alloca', as a function or macro. */
99 #define C_alloca(x) __ALLOCA(x)
101 /* Define to 1 if you have the `basename' function. */
102 #define HAVE_DECL_BASENAME 1
104 /* Is the prototype for getopt in <unistd.h> in the expected format? */
105 #define HAVE_DECL_GETOPT 1
107 /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
109 #undef HAVE_DECL_VSNPRINTF
111 /* Define to 1 if you have the declaration of `snprintf', and to 0 if you
113 #define HAVE_DECL_SNPRINTF 1
115 /* Define to 1 if you have the <errno.h> header file. */
116 #define HAVE_ERRNO_H 1
118 /* Define to 1 if you have the <limits.h> header file. */
121 /* Define to 1 if you have the `remove' function. */
122 #define HAVE_REMOVE 1
124 /* Define to 1 if you have the <stdarg.h> header file. */
125 #define HAVE_STDARG_H 1
127 /* Define to 1 if you have the <stdint.h> header file. */
130 /* Define to 1 if you have the <stdlib.h> header file. */
131 #define HAVE_STDLIB_H 1
133 /* Define to 1 if you have the <strings.h> header file. */
134 #define HAVE_STRINGS_H 1
136 /* Define to 1 if you have the <string.h> header file. */
137 #define HAVE_STRING_H 1
139 /* Define to 1 if you have the <sys/stat.h> header file. */
140 #undef HAVE_SYS_STAT_H
142 /* Define to 1 if you have the <sys/types.h> header file. */
143 #define HAVE_SYS_TYPES_H
145 /* Define to 1 if you have the <unistd.h> header file. */
146 #define HAVE_UNISTD_H
148 /* Define to 1 if you have the `unlink' function. */
151 /* Name of package */
152 #define PACKAGE "gas"
154 /* Define to the address where bug reports for this package should be sent. */
155 #define PACKAGE_BUGREPORT ""
157 /* Define to the full name of this package. */
158 #define PACKAGE_NAME ""
160 /* Define to the full name and version of this package. */
161 #define PACKAGE_STRING ""
163 /* Define to the one symbol short name of this package. */
164 #define PACKAGE_TARNAME ""
166 /* Define to the version of this package. */
167 #define PACKAGE_VERSION ""
169 /* Define to 1 if you have the ANSI C header files. */
170 #define STDC_HEADERS 1
173 #define TARGET_OS "openvms"
176 #define TARGET_VENDOR "dec"
178 /* Define to 1 if your processor stores words with the most significant byte
179 first (like Motorola and SPARC, unlike Intel and VAX). */
180 #define WORDS_BIGENDIAN 1
182 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
184 #undef YYTEXT_POINTER
186 /* Version number of package */
188 $! Get VERSION from ../bfd/version.m4
190 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input
193 mfile := CREATE_BUFFER("mfile", "[-.bfd]version.m4");
194 match_pos := SEARCH_QUIETLY('m4_define([BFD_VERSION], [', FORWARD, EXACT, mfile);
195 IF match_pos <> 0 THEN;
196 POSITION(BEGINNING_OF(match_pos));
198 vers := CURRENT_LINE-"])";
203 file := CREATE_BUFFER("file", "config-vms.in");
204 POSITION(END_OF(file));
205 COPY_TEXT("#define VERSION """);
208 WRITE_FILE(file, "config.h");
211 $del/nolog config-vms.in;
212 $ open/append outfile config.h
214 $ write outfile "/* Target alias. */"
215 $ write outfile "#define TARGET_ALIAS ""''target_alias'"""
217 $ write outfile "/* Canonical target. */"
218 $ write outfile "#define TARGET_CANONICAL ""''target_canonical'"""
220 $ write outfile "/* Target CPU. */"
221 $ write outfile "#define TARGET_CPU ""'arch'"""
224 $ write sys$output "Generate gas/build.com"
230 $ CFLAGS=OPT + "/include=([],""../include"",[-.bfd],""../"",[.config])" +-
231 "/name=(as_is,shortened)" +-
232 "/prefix=(all,exc=(""getopt"",""optarg"",""optopt"",""optind"",""opterr""))"
233 $ FILES="obj-format,atof-targ,app,as,atof-generic,cond,depend,"+-
234 "expr,flonum-konst,flonum-copy,flonum-mult,frags,hash,input-file,"+-
235 "input-scrub,literal,messages,output-file,read,subsegs,symbols,write,"+-
236 "listing,ecoff,stabs,sb,macro,ehopt,dw2gencfi,dwarf2dbg,remap"
237 $ LIBBFD = ",[-.bfd]libbfd.olb/lib"
238 $ LIBIBERTY = ",[-.libiberty]libiberty.olb/lib"
239 $ LIBOPCODES = ",[-.opcodes]libopcodes.olb/lib"
241 $ AS_OBJS="targ-cpu," + FILES
243 $ write sys$output "CFLAGS=",CFLAGS
249 $ open/append outfile build.com
250 $ write outfile "$ write sys$output ""Compiling te-vms.c"""
251 $ write outfile "$ cc 'CFLAGS /obj=te-vms.obj [.config]te-vms.c + " +-
252 "sys$library:sys$lib_c.tlb/lib"
253 $ write outfile "$ AS_OBJS=AS_OBJS + "",te-vms.obj"""
257 $ append sys$input build.com
261 $ write sys$output "Compiling targ-cpu.c (/noopt)"
262 $ cc 'CFLAGS /noopt targ-cpu
265 $ F = F$ELEMENT(NUM,",",FILES)
266 $ IF F.EQS."," THEN GOTO END
267 $ write sys$output "Compiling ", F, ".c"
275 $ write sys$output "Building as.exe"
276 $ AS_OBJS=AS_OBJS + LIBOPCODES + LIBBFD + LIBIBERTY
277 $ link/exe=as 'AS_OBJS