1$!
2$! This file configures binutils for use with openVMS/Alpha
3$! We do not use the configure script, since we do not have /bin/sh
4$! to execute it.
5$!
6$!   Copyright (C) 2012-2017 Free Software Foundation, Inc.
7$!
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.
12$!
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.
17$!
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/>.
21$!
22$! Written by Klaus K"ampf (kkaempf@rmi.de)
23$!
24$ arch=F$GETSYI("ARCH_NAME")
25$ arch=F$EDIT(arch,"LOWERCASE")
26$ write sys$output "Configuring binutils for ''arch' target"
27$!
28$! Generate config.h
29$!
30$ create config.h
31/* config.h.  Generated automatically by configure.com  */
32/* Is the type time_t defined in <time.h>?  */
33#define HAVE_TIME_T_IN_TIME_H 1
34/* Is the type time_t defined in <sys/types.h>?  */
35#define HAVE_TIME_T_IN_TYPES_H 1
36/* Does <utime.h> define struct utimbuf?  */
37#define HAVE_GOOD_UTIME_H 1
38/* Whether fprintf must be declared even if <stdio.h> is included.  */
39#define NEED_DECLARATION_FPRINTF 1
40/* Do we need to use the b modifier when opening binary files?  */
41/* #undef USE_BINARY_FOPEN */
42/* Define if you have the utimes function.  */
43#define HAVE_UTIMES 1
44/* Define if you have the <fcntl.h> header file.  */
45#define HAVE_FCNTL_H 1
46/* Define if you have the <stdlib.h> header file.  */
47#define HAVE_STDLIB_H 1
48/* Define if you have the <string.h> header file.  */
49#define HAVE_STRING_H 1
50/* Define if you have the <strings.h> header file.  */
51#define HAVE_STRINGS_H 1
52/* Define if you have the <sys/file.h> header file.  */
53#define HAVE_SYS_FILE_H 1
54/* Define if you have the <unistd.h> header file.  */
55#define HAVE_UNISTD_H 1
56
57/* Alloca.  */
58#ifdef __DECC
59#include <builtins.h>
60#define C_alloca(x) __ALLOCA(x)
61#endif
62/* Name of package */
63#define PACKAGE "binutils"
64
65/* Define to the address where bug reports for this package should be sent. */
66#define PACKAGE_BUGREPORT ""
67
68/* Define to the full name of this package. */
69#define PACKAGE_NAME ""
70
71/* Define to the full name and version of this package. */
72#define PACKAGE_STRING ""
73
74/* Define to the one symbol short name of this package. */
75#define PACKAGE_TARNAME ""
76
77/* Define to the home page for this package. */
78#define PACKAGE_URL ""
79
80/* Define to the version of this package. */
81#define PACKAGE_VERSION ""
82$!
83$! Add TARGET.
84$!
85$ if arch .eqs. "ia64" then target = "elf64-ia64-vms"
86$ if arch .eqs. "alpha" then target = "vms-alpha"
87$ if arch .eqs. "vax" then target = "vms-vax"
88$!
89$ open/append tfile config.h
90$ write tfile "#define TARGET """ + target + """"
91$ close tfile
92$ write sys$output "Created `config.h'"
93$!
94$ write sys$output "Generate binutils build.com"
95$!
96$ create build.com
97$DECK
98$ DEFS=""
99$ OPT="/noopt/debug"
100$ CFLAGS=OPT + "/include=([],""../include"",[-.bfd])" +-
101 "/name=(as_is,shortened)" +-
102 "/prefix=(all,exc=(""getopt"",""optarg"",""optopt"",""optind"",""opterr""))"
103$ BFDLIB = ",[-.bfd]libbfd.olb/lib"
104$ LIBIBERTY = ",[-.libiberty]libiberty.olb/lib"
105$ OPCODES = ",[-.opcodes]libopcodes.olb/lib"
106$ DEBUG_FILES = ",rddbg,debug,stabs,ieee,rdcoff,dwarf"
107$ BULIBS_FILES = ",bucomm,version,filemode"
108$ ALL_FILES="nm,strings,addr2line,size,objdump,prdbg" +-
109   BULIBS_FILES + DEBUG_FILES
110$!
111$ write sys$output "CFLAGS=",CFLAGS
112$ if p1.nes."LINK"
113$ then
114$   NUM = 0
115$   LOOP:
116$     F = F$ELEMENT(NUM,",",ALL_FILES)
117$     IF F.EQS."," THEN GOTO END
118$     write sys$output "Compiling ", F, ".c"
119$     cc 'CFLAGS 'F.c
120$     NUM = NUM + 1
121$     GOTO LOOP
122$   END:
123$ endif
124$ purge
125$!
126$ write sys$output "Building nm.exe"
127$ NM_OBJS="nm.obj" + BULIBS_FILES + BFDLIB + LIBIBERTY
128$ link/exe=nm 'NM_OBJS
129$!
130$ write sys$output "Building strings.exe"
131$ STRINGS_OBJS="strings.obj" + BULIBS_FILES + BFDLIB + LIBIBERTY
132$ link/exe=strings 'STRINGS_OBJS
133$!
134$ write sys$output "Building size.exe"
135$ SIZE_OBJS="size.obj" + BULIBS_FILES + BFDLIB + LIBIBERTY
136$ link/exe=size 'SIZE_OBJS
137$!
138$ write sys$output "Building addr2line.exe"
139$ ADDR2LINE_OBJS="addr2line.obj" + BULIBS_FILES + BFDLIB + LIBIBERTY
140$ link/exe=addr2line 'ADDR2LINE_OBJS
141$!
142$ write sys$output "Building objdump.exe"
143$ OBJDUMP_OBJS="objdump.obj,prdbg.obj" + DEBUG_FILES + BULIBS_FILES +-
144   BFDLIB + OPCODES + LIBIBERTY
145$ link/exe=objdump 'OBJDUMP_OBJS
146$EOD
147