configure.com 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. $! configure.com
  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.
  5. $!
  6. $! Copyright (C) 2012-2022 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. $!
  23. $ arch=F$GETSYI("ARCH_NAME")
  24. $ arch=F$EDIT(arch,"LOWERCASE")
  25. $ if arch.eqs."alpha"
  26. $ then
  27. $ format = "evax"
  28. $ env = "generic"
  29. $ target_alias = "alpha-dec-openvms"
  30. $ target_canonical = "alpha-dec-openvms"
  31. $ endif
  32. $ if arch.eqs."ia64"
  33. $ then
  34. $ format = "elf"
  35. $ env = "vms"
  36. $ target_alias = "ia64-openvms"
  37. $ target_canonical = "ia64-unknown-openvms"
  38. $ endif
  39. $!
  40. $!
  41. $ write sys$output "Generate targ-cpu.[ch]"
  42. $!
  43. $! Target specific information
  44. $ open/write outfile targ-cpu.h
  45. $ write outfile "#include ""tc-''arch'.h"""
  46. $ close outfile
  47. $! Target specific information
  48. $ open/write outfile targ-cpu.c
  49. $ write outfile "#include ""tc-''arch'.c"""
  50. $ close outfile
  51. $!
  52. $ write sys$output "Generate targ-env.h"
  53. $!
  54. $ open/write outfile targ-env.h
  55. $ write outfile "#include ""te-''env'.h"""
  56. $ close outfile
  57. $!
  58. $ write sys$output "Generate obj-format.[ch]"
  59. $!
  60. $! Code to handle the object file format.
  61. $ open/write outfile obj-format.h
  62. $ write outfile "#include ""obj-''format'.h"""
  63. $ close outfile
  64. $ open/write outfile obj-format.c
  65. $ write outfile "#include ""obj-''format'.c"""
  66. $ close outfile
  67. $!
  68. $ write sys$output "Generate atof-targ.c"
  69. $!
  70. $ create atof-targ.c
  71. #include "atof-ieee.c"
  72. $!
  73. $ write sys$output "Generate gas/config.h"
  74. $!
  75. $ create config-vms.in
  76. /* config.h. Generated by configure.com. */
  77. /* Define to 1 if using `alloca.c'. */
  78. #undef C_ALLOCA
  79. /* Default architecture. */
  80. #undef DEFAULT_ARCH
  81. /* Default emulation. */
  82. #define DEFAULT_EMULATION ""
  83. /* Supported emulations. */
  84. #define EMULATIONS
  85. /* Define if you want run-time sanity checks. */
  86. #undef ENABLE_CHECKING
  87. /* Define to 1 if translation of program messages to the user's native
  88. language is requested. */
  89. #undef ENABLE_NLS
  90. /* Define to 1 if you have `alloca', as a function or macro. */
  91. #define HAVE_ALLOCA 1
  92. #include <builtins.h>
  93. #define C_alloca(x) __ALLOCA(x)
  94. /* Define to 1 if you have the `basename' function. */
  95. #define HAVE_DECL_BASENAME 1
  96. /* Is the prototype for getopt in <unistd.h> in the expected format? */
  97. #define HAVE_DECL_GETOPT 1
  98. /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
  99. don't. */
  100. #undef HAVE_DECL_VSNPRINTF
  101. /* Define to 1 if you have the declaration of `snprintf', and to 0 if you
  102. don't. */
  103. #define HAVE_DECL_SNPRINTF 1
  104. /* Define to 1 if you have the <errno.h> header file. */
  105. #define HAVE_ERRNO_H 1
  106. /* Define to 1 if you have the <limits.h> header file. */
  107. #undef HAVE_LIMITS_H
  108. /* Define to 1 if you have the `remove' function. */
  109. #define HAVE_REMOVE 1
  110. /* Define to 1 if you have the <stdarg.h> header file. */
  111. #define HAVE_STDARG_H 1
  112. /* Define to 1 if you have the <stdint.h> header file. */
  113. #undef HAVE_STDINT_H
  114. /* Define to 1 if you have the <stdlib.h> header file. */
  115. #define HAVE_STDLIB_H 1
  116. /* Define to 1 if you have the <strings.h> header file. */
  117. #define HAVE_STRINGS_H 1
  118. /* Define to 1 if you have the <string.h> header file. */
  119. #define HAVE_STRING_H 1
  120. /* Define to 1 if you have the <sys/stat.h> header file. */
  121. #undef HAVE_SYS_STAT_H
  122. /* Define to 1 if you have the <sys/types.h> header file. */
  123. #define HAVE_SYS_TYPES_H
  124. /* Define to 1 if you have the <unistd.h> header file. */
  125. #define HAVE_UNISTD_H
  126. /* Define to 1 if you have the `unlink' function. */
  127. #undef HAVE_UNLINK
  128. /* Name of package */
  129. #define PACKAGE "gas"
  130. /* Define to the address where bug reports for this package should be sent. */
  131. #define PACKAGE_BUGREPORT ""
  132. /* Define to the full name of this package. */
  133. #define PACKAGE_NAME ""
  134. /* Define to the full name and version of this package. */
  135. #define PACKAGE_STRING ""
  136. /* Define to the one symbol short name of this package. */
  137. #define PACKAGE_TARNAME ""
  138. /* Define to the version of this package. */
  139. #define PACKAGE_VERSION ""
  140. /* Define to 1 if you have the ANSI C header files. */
  141. #define STDC_HEADERS 1
  142. /* Target OS. */
  143. #define TARGET_OS "openvms"
  144. /* Target vendor. */
  145. #define TARGET_VENDOR "dec"
  146. /* Define to 1 if your processor stores words with the most significant byte
  147. first (like Motorola and SPARC, unlike Intel and VAX). */
  148. #define WORDS_BIGENDIAN 1
  149. /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
  150. `char[]'. */
  151. #undef YYTEXT_POINTER
  152. /* Version number of package */
  153. $!
  154. $! Get VERSION from ../bfd/version.m4
  155. $!
  156. $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input
  157. $DECK
  158. set (success, off);
  159. mfile := CREATE_BUFFER("mfile", "[-.bfd]version.m4");
  160. match_pos := SEARCH_QUIETLY('m4_define([BFD_VERSION], [', FORWARD, EXACT, mfile);
  161. IF match_pos <> 0 THEN;
  162. POSITION(BEGINNING_OF(match_pos));
  163. ERASE(match_pos);
  164. vers := CURRENT_LINE-"])";
  165. ELSE;
  166. vers := "unknown";
  167. ENDIF;
  168. file := CREATE_BUFFER("file", "config-vms.in");
  169. POSITION(END_OF(file));
  170. COPY_TEXT("#define VERSION """);
  171. COPY_TEXT(vers);
  172. COPY_TEXT("""");
  173. WRITE_FILE(file, "config.h");
  174. QUIT
  175. $EOD
  176. $del/nolog config-vms.in;
  177. $ open/append outfile config.h
  178. $ write outfile ""
  179. $ write outfile "/* Target alias. */"
  180. $ write outfile "#define TARGET_ALIAS ""''target_alias'"""
  181. $ write outfile ""
  182. $ write outfile "/* Canonical target. */"
  183. $ write outfile "#define TARGET_CANONICAL ""''target_canonical'"""
  184. $ write outfile ""
  185. $ write outfile "/* Target CPU. */"
  186. $ write outfile "#define TARGET_CPU ""'arch'"""
  187. $ close outfile
  188. $!
  189. $ write sys$output "Generate gas/build.com"
  190. $!
  191. $ create build.com
  192. $DECK
  193. $ DEFS=""
  194. $ OPT="/noopt/debug"
  195. $ CFLAGS=OPT + "/include=([],""../include"",[-.bfd],""../"",[.config])" +-
  196. "/name=(as_is,shortened)" +-
  197. "/prefix=(all,exc=(""getopt"",""optarg"",""optopt"",""optind"",""opterr""))"
  198. $ FILES="obj-format,atof-targ,app,as,atof-generic,cond,depend,"+-
  199. "expr,flonum-konst,flonum-copy,flonum-mult,frags,hash,input-file,"+-
  200. "input-scrub,literal,messages,output-file,read,subsegs,symbols,write,"+-
  201. "listing,ecoff,stabs,sb,macro,ehopt,dw2gencfi,dwarf2dbg,remap"
  202. $ LIBBFD = ",[-.bfd]libbfd.olb/lib"
  203. $ LIBIBERTY = ",[-.libiberty]libiberty.olb/lib"
  204. $ LIBOPCODES = ",[-.opcodes]libopcodes.olb/lib"
  205. $!
  206. $ AS_OBJS="targ-cpu," + FILES
  207. $!
  208. $ write sys$output "CFLAGS=",CFLAGS
  209. $!
  210. $EOD
  211. $!
  212. $ if arch.eqs."ia64"
  213. $ then
  214. $ open/append outfile build.com
  215. $ write outfile "$ write sys$output ""Compiling te-vms.c"""
  216. $ write outfile "$ cc 'CFLAGS /obj=te-vms.obj [.config]te-vms.c + " +-
  217. "sys$library:sys$lib_c.tlb/lib"
  218. $ write outfile "$ AS_OBJS=AS_OBJS + "",te-vms.obj"""
  219. $ close outfile
  220. $ endif
  221. $!
  222. $ append sys$input build.com
  223. $DECK
  224. $ if p1.nes."LINK"
  225. $ then
  226. $ write sys$output "Compiling targ-cpu.c (/noopt)"
  227. $ cc 'CFLAGS /noopt targ-cpu
  228. $ NUM = 0
  229. $ LOOP:
  230. $ F = F$ELEMENT(NUM,",",FILES)
  231. $ IF F.EQS."," THEN GOTO END
  232. $ write sys$output "Compiling ", F, ".c"
  233. $ cc 'CFLAGS 'F.c
  234. $ NUM = NUM + 1
  235. $ GOTO LOOP
  236. $ END:
  237. $ endif
  238. $ purge
  239. $!
  240. $ write sys$output "Building as.exe"
  241. $ AS_OBJS=AS_OBJS + LIBOPCODES + LIBBFD + LIBIBERTY
  242. $ link/exe=as 'AS_OBJS
  243. $EOD
  244. $exit