Tue Apr 1 16:24:28 1997 Klaus Kaempf <kkaempf@progis.de>
authorIan Lance Taylor <ian@airs.com>
Tue, 1 Apr 1997 21:26:16 +0000 (21:26 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 1 Apr 1997 21:26:16 +0000 (21:26 +0000)
* config-gas.com: Update to handle both vax and alpha.
* makefile.vms: Update to use config-gas.
* conf-a-gas.com: Remove file.

gas/.Sanitize
gas/ChangeLog
gas/conf-a-gas.com [deleted file]
gas/config-gas.com
gas/makefile.vms

index 907ff76..88eb4ac 100644 (file)
@@ -41,7 +41,6 @@ bignum-copy.c
 bignum.h
 bit_fix.h
 cond.c
-conf-a-gas.com
 conf.in
 config
 config-gas.com
index e1404b9..8e52f1b 100644 (file)
@@ -1,3 +1,9 @@
+Tue Apr  1 16:24:28 1997  Klaus Kaempf  <kkaempf@progis.de>
+
+       * config-gas.com: Update to handle both vax and alpha.
+       * makefile.vms: Update to use config-gas.
+       * conf-a-gas.com: Remove file.
+
 Tue Apr  1 16:08:21 1997  Ian Lance Taylor  <ian@cygnus.com>
 
        * Makefile.in: Remove unnecessary itbl-parse.h, ibtl-parse.c, and
diff --git a/gas/conf-a-gas.com b/gas/conf-a-gas.com
deleted file mode 100644 (file)
index ca5dd94..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-$!
-$! This file sets things up to build gas on a openVMS/Alpha system to generate
-$! object files for a openVMS/Alpha system.
-$! We do not use the configure script, since there is no /bin/sh to execute it.
-$!
-$! If you are running this file, then obviously the host is alpha-dec-vms.
-$!
-$gas_host="vms"
-$!
-$cpu_type="alpha"
-$emulation="generic"
-$obj_format="evax"
-$atof="ieee"
-$!
-$      DELETE  = "delete/noConfirm"
-$      ECHO    = "write sys$output"
-$!
-$! Target specific information
-$call link targ-cpu.c  [.config]tc-'cpu_type'.c
-$call link targ-cpu.h  [.config]tc-'cpu_type'.h
-$call link targ-env.h  [.config]te-'emulation'.h
-$!
-$! Code to handle the object file format.
-$call link obj-format.h        [.config]obj-'obj_format'.h
-$call link obj-format.c        [.config]obj-'obj_format'.c
-$!
-$! Code to handle floating point.
-$call link atof-targ.c [.config]atof-'atof'.c
-$!
-$!
-$! Create the file version.opt, which helps identify the executable.
-$!
-$if f$trnlnm("IFILE$").nes."" then  close/noLog ifile$
-$search Makefile.in "VERSION="/Exact/Output=config-gas-tmp.tmp
-$open ifile$ config-gas-tmp.tmp
-$read ifile$ line
-$close ifile$
-$DELETE config-gas-tmp.tmp;*
-$! Discard "VERSION=" and "\n" parts.
-$ijk=f$locate("=",line)+1
-$line=f$extract(ijk,f$length(line)-ijk,line)
-$! [what "\n" part??  this seems to be useless, but is benign]
-$ijk=f$locate("\n",line)
-$line=f$extract(0,ijk,line)
-$!
-$ if f$search("version.opt").nes."" then DELETE version.opt;*
-$copy _NL: version.opt
-$open/Append ifile$ version.opt
-$write ifile$ "identification="+""""+line+""""
-$close ifile$
-$!
-$! Now write config.h.
-$!
-$ if f$search("config.h").nes."" then DELETE config.h;*
-$copy _NL: config.h
-$open/Append ifile$ config.h
-$write ifile$ "/* config.h.  Generated by config-gas.com. */
-$write ifile$ "#ifndef GAS_VERSION"
-$write ifile$ "#define GAS_VERSION      """,line,""""
-$write ifile$ "#endif"
-$write ifile$ "/*--*/"
-$append [.config]vms-a-conf.h ifile$:
-$close ifile$
-$ECHO "Created config.h."
-$!
-$! Check for, and possibly make, header file <unistd.h>.
-$!
-$ if f$search("tmp-chk-h.*").nes."" then  DELETE tmp-chk-h.*;*
-$!can't use simple `#include HDR' with `gcc /Define="HDR=<foo.h>"'
-$!because the 2.6.[0-3] preprocessor handles it wrong (VMS-specific gcc bug)
-$ create tmp-chk-h.c
-int tmp_chk_h; /* guarantee non-empty output */
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_UNIXIO_H
-#include <unixio.h>
-#endif
-#ifdef HAVE_UNIXLIB_H
-#include <unixlib.h>
-#endif
-$ on warning then  continue
-$ CHECK = "call tmp_chk_h"
-$ CHECK "HAVE_STDIO_H"
-$ if .not.$status
-$ then type sys$input:
-
-? could not compile <stdio.h>.
-  Since gcc is not set up correctly, gas configuration cannot proceed.
-
-$      DELETE tmp-chk-h.c;*
-$      exit %x002C
-$ endif
-$!
-$ CHECK "HAVE_UNISTD_H"
-$ if .not.$status
-$ then
-$  if f$trnlnm("HFILE$").nes."" then  close/noLog hfile$
-$  CHECK "HAVE_UNIXIO_H"
-$  got_unixio = ($status .and. 1)
-$  CHECK "HAVE_UNIXLIB_H"
-$  got_unixlib = ($status .and. 1)
-$  create []unistd.h   !with rudimentary contents
-/* <unistd.h> substitute for building gas */
-#ifndef UNISTD_H
-#define UNISTD_H
-
-$  open/Append hfile$ []unistd.h
-$  if got_unixio
-$  then  write hfile$ "#include <unixio.h>"
-$  else  append sys$input: hfile$:
-/* some of the routines normally prototyped in <unixio.h> */
-extern int creat(), open(), close(), read(), write();
-extern int access(), dup(), dup2(), fstat(), stat();
-extern long lseek();
-$  endif
-$  write hfile$ ""
-$  if got_unixlib
-$  then  write hfile$ "#include <unixlib.h>"
-$  else  append sys$input: hfile$:
-/* some of the routines normally prototyped in <unixlib.h> */
-extern char *sbrk(), *getcwd(), *cuserid();
-extern int brk(), chdir(), chmod(), chown(), mkdir();
-extern unsigned getuid(), umask();
-$  endif
-$  append sys$input: hfile$:
-
-#endif /*UNISTD_H*/
-$  close hfile$
-$  ECHO "Created ""[]unistd.h""."
-$ endif !gcc '#include <unistd.h>' failed
-$ DELETE tmp-chk-h.c;*
-$
-$tmp_chk_h: subroutine
-$  set noOn
-$  hname = f$edit("<" + (p1 - "HAVE_" - "_H") + ".h>","LOWERCASE")
-$  write sys$output "Checking for ''hname'."
-$  if f$search("tmp-chk-h.obj").nes."" then  DELETE tmp-chk-h.obj;*
-$  define/noLog sys$error _NL: !can't use /User_Mode here due to gcc
-$  define/noLog sys$output _NL:        ! driver's use of multiple image activation
-$  gcc /Include=([],[-.include]) /Define=("''p1'") tmp-chk-h.c
-$!can't just check $status; gcc 2.6.[0-3] preprocessor doesn't set it correctly
-$  ok = (($status.and.1).and.(f$search("tmp-chk-h.obj").nes."")) .or. %x10000000
-$  deassign sys$error  !restore, more or less
-$  deassign sys$output
-$  if ok then  DELETE tmp-chk-h.obj;*
-$  exit ok
-$ endsubroutine !tmp_chk_h
-$
-$!
-$! Done
-$!
-$ if f$search("config.status") .nes. "" then DELETE config.status;*
-$ create config.status
-Links are now set up for use with an Alpha running openVMS.
-$ type config.status
-$exit
-$!
-$!
-$link:
-$subroutine
-$  if f$search(p1).nes."" then DELETE 'p1';*
-$  copy 'p2' 'p1'
-$  ECHO "Copied ''f$edit(p2,"LOWERCASE")' to ''f$edit(p1,"LOWERCASE")'."
-$endsubroutine
index 2bfc576..afb0642 100644 (file)
@@ -3,15 +3,23 @@ $! This file sets things up to build gas on a VMS system to generate object
 $! files for a VMS system.  We do not use the configure script, since we
 $! do not have /bin/sh to execute it.
 $!
-$! If you are running this file, then obviously the host is vax-dec-vms.
-$! [That's no longer obvious, but there's not much we can do about alpha yet.]
 $!
 $gas_host="vms"
 $!
+$arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1)      ! vax==1, alpha==2
+$arch = f$element(arch_indx,"|","|VAX|Alpha|")
+$if arch .eqs. "VAX"
+$then
 $cpu_type="vax"
-$emulation="generic"
 $obj_format="vms"
 $atof="vax"
+$else
+$ cpu_type="alpha"
+$ obj_format="evax"
+$ atof="ieee"
+$endif
+$
+$emulation="generic"
 $!
 $      DELETE  = "delete/noConfirm"
 $      ECHO    = "write sys$output"
@@ -60,7 +68,12 @@ $write ifile$ "#ifndef GAS_VERSION"
 $write ifile$ "#define GAS_VERSION      """,line,""""
 $write ifile$ "#endif"
 $write ifile$ "/*--*/"
+$if arch .eqs. "VAX"
+$then
 $append [.config]vms-conf.h ifile$:
+$else
+$ append [.config]vms-a-conf.h ifile$:
+$endif
 $close ifile$
 $ECHO "Created config.h."
 $!
@@ -155,9 +168,10 @@ $!
 $! Done
 $!
 $ if f$search("config.status") .nes. "" then DELETE config.status;*
-$ create config.status
-Links are now set up for use with a vax running VMS.
-$ type config.status
+$ open/write cfile []config.status
+$ write cfile "Links are now set up for use with a "+arch+" running VMS."
+$ close cfile
+$ type []config.status
 $exit
 $!
 $!
index bc7c028..1c46a0d 100644 (file)
@@ -6,10 +6,9 @@
 
 ifeq ($(CC),gcc)
 DEFS=
-CFLAGS=/cc1="-fno-exceptions -g0"/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS)
+CFLAGS=/include=([],[-.bfd],[.config],[-.include],[-])$(DEFS)
 LFLAGS=
-LIBS=,GNU:[000000]LIBGCC2/lib,GNU:[000000]LIBGCCLIB/lib,\
-       sys$$library:vaxcrtl.olb/lib,GNU:[000000]crt0.obj
+LIBS=,GNU:[000000]libgcc/lib,sys$$library:vaxcrtl.olb/lib,GNU:[000000]crt0.obj
 else
 DEFS=/define=("table_size_of_flonum_powers_of_ten"="tabsiz_flonum_powers_of_ten",\
 "_bfd_generic_get_section_contents_in_window"="_bfd_generic_get_win_section_cont",\
@@ -30,6 +29,7 @@ LIBIBERTY = [-.libiberty]libiberty.olb
 LIBBFD = [-.bfd]libbfd.olb
 LIBOPCODES = [-.opcodes]libopcodes.olb
 
+all: config.status [-.bfd]bfd.h as.exe gasp.exe
 
 as.exe: $(OBJS) $(LIBOPCODES) $(LIBBFD) $(LIBIBERTY)
        link$(LFLAGS)/exe=$@ $(OBJS),$(LIBOPCODES)/lib,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS)
@@ -37,6 +37,9 @@ as.exe: $(OBJS) $(LIBOPCODES) $(LIBBFD) $(LIBIBERTY)
 gasp.exe: gasp.obj $(LIBBFD) $(LIBIBERTY)
        link$(LFLAGS)/exe=$@ gasp.obj,$(LIBBFD)/lib,$(LIBIBERTY)/lib$(LIBS)
 
+config.status:
+       $$ @config-gas
+
 targ-cpu.c: [.config]tc-alpha.c
        copy $< $@
 targ-cpu.h: [.config]tc-alpha.h
@@ -51,3 +54,20 @@ atof-targ.c: [.config]atof-ieee.c
        copy $< $@
 
 targ-cpu.obj: targ-cpu.c targ-cpu.h [.config]atof-vax.c
+
+[-.bfd]bfd.h:
+       $(CD) [-.bfd]
+       gmake -f makefile.vms
+       $(CD) [-.gas]
+
+clean:
+       $$ purge
+       $(RM) *.obj;
+       $(RM) *.exe;
+       $(RM) atof-targ.c;
+       $(RM) obj-format.c;
+       $(RM) obj-format.h;
+       $(RM) targ-env.h;
+       $(RM) targ-cpu.h;
+       $(RM) targ-cpu.c;
+       $(RM) config.status;