2009-05-25 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Mon, 25 May 2009 13:03:24 +0000 (13:03 +0000)
committerTristan Gingold <gingold@adacore.com>
Mon, 25 May 2009 13:03:24 +0000 (13:03 +0000)
* makefile.vms-in: Fix CFLAGS, add addr2line.exe target.

* configure.com: Fix it: handle alloca and define TARGET in config.h.

binutils/ChangeLog
binutils/configure.com
binutils/makefile.vms-in

index 936e9c375bfac537962bfc0a4a475230b0bdaa54..7c4e3349a36c37ab7b29b524005fd3eb6e0ae36c 100644 (file)
@@ -1,3 +1,9 @@
+2009-05-25  Tristan Gingold  <gingold@adacore.com>
+
+       * makefile.vms-in: Fix CFLAGS, add addr2line.exe target.
+
+       * configure.com: Fix it: handle alloca and define TARGET in config.h.
+
 2009-05-22  Alan Modra  <amodra@bigpond.net.au>
 
        * Makefile.am: Run "make dep-am".
index 55c68791e4e4d624070cc8244de7ad0ad608599d..5ade2d4c89703c85cf8c3b5996657873559375a1 100644 (file)
@@ -8,12 +8,10 @@ $!
 $arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1)      ! vax==1, alpha==2
 $arch = f$element(arch_indx,"|","|VAX|Alpha|")
 $!
-$!
 $! Generate config.h
 $!
-$ create []config.h
-/* config.h.  Generated automatically by configure.  */
-/* config.in.  Generated automatically from configure.in by autoheader.  */
+$ create config.h
+/* config.h.  Generated automatically by configure.com  */
 /* Is the type time_t defined in <time.h>?  */
 #define HAVE_TIME_T_IN_TIME_H 1
 /* Is the type time_t defined in <sys/types.h>?  */
@@ -22,12 +20,8 @@ $ create []config.h
 #define HAVE_GOOD_UTIME_H 1
 /* Whether fprintf must be declared even if <stdio.h> is included.  */
 #define NEED_DECLARATION_FPRINTF 1
-/* Whether sbrk must be declared even if <unistd.h> is included.  */
-#undef NEED_DECLARATION_SBRK
 /* Do we need to use the b modifier when opening binary files?  */
 /* #undef USE_BINARY_FOPEN */
-/* Define if you have the sbrk function.  */
-/* #undef HAVE_SBRK 1 */
 /* Define if you have the utimes function.  */
 #define HAVE_UTIMES 1
 /* Define if you have the <fcntl.h> header file.  */
@@ -42,35 +36,25 @@ $ create []config.h
 #define HAVE_SYS_FILE_H 1
 /* Define if you have the <unistd.h> header file.  */
 #define HAVE_UNISTD_H 1
-$ write sys$output "Generated `config.h'"
-$!
-$!
-$! Edit VERSION in makefile.vms-in
-$!
-$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
-        []makefile.vms-in /output=[]makefile.vms
-$DECK
-!
-! Get VERSION from configure.in
-!
-   mfile := CREATE_BUFFER("mfile", "[-.bfd]CONFIGURE.IN");
-   rang := CREATE_RANGE(BEGINNING_OF(mfile), END_OF(mfile));
-   match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
-   IF match_pos <> 0 THEN;
-     POSITION(BEGINNING_OF(match_pos));
-     ERASE(match_pos);
-     vers := CURRENT_LINE-")";
-   ELSE;
-     vers := "unknown";
-   ENDIF;
-
-   file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
-   rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
-   match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
-   POSITION(BEGINNING_OF(match_pos));
-   ERASE(match_pos);
-   COPY_TEXT(vers);
-   WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
-   QUIT
-$  EOD
+/* Alloca.  */
+#ifdef __DECC
+#include <builtins.h>
+#define C_alloca(x) __ALLOCA(x)
+#endif
+$!
+$! Add TARGET.
+$!
+$ if arch .eqs. "Alpha"
+$ then
+$   target = "vms-alpha"
+$ else
+$   target = "vms-vax"
+$ endif
+$!
+$ open/append tfile config.h
+$ write tfile "#define TARGET """ + target + """"
+$ close tfile
+$ write sys$output "Created `config.h'"
+$!
+$ copy makefile.vms-in makefile.vms
 $ write sys$output "Created `makefile.vms'"
index 1b593f40608146abd641caccb433b7033e39f788..8e597c933df7ecd0f73b8dc8e9184e46fd56f7cc 100644 (file)
 # Distribution version, filled in by configure.com
 VERSION=@VERSION@
 
-ifeq ($(ARCH),ALPHA)
-TARGET=""vms-alpha""
-else
-TARGET=""vms-vax""
-endif
-
 ifeq ($(CC),gcc)
+DEFS=
 CFLAGS=/include=([],[-.include],[-.bfd])$(DEFS)
-DEFS=/define=("TARGET=$(TARGET)")
 LIBS=,gnu_cc_library:libgcc/lib,sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj
 else
-CFLAGS=/noopt/debug/include=([],[-.include],[-.bfd])$(DEFS)\
-/name=(as_is,shortened)\
-/warnings=disable=(missingreturn,longextern)\
-/prefix=(all,except=("getopt","optarg","optopt","optind","opterr"))
-DEFS=/define=("TARGET=$(TARGET)","const=","unlink=remove")
+DEFS=
+OPT=/noopt/debug
+CFLAGS=$(OPT)/include=([],[-.include],[-.bfd])$(DEFS)\
+ /name=(as_is,shortened)\
+ /prefix=(all,except=("getopt","optarg","optopt","optind","opterr"))
 LIBS=,sys$$library:vaxcrtl.olb/lib
 endif
 
@@ -51,9 +45,11 @@ STRINGSOBJS = $(ADDL_DEPS),strings.obj
 
 NMOBJS = $(ADDL_DEPS),nm.obj
 
+ADDR2LINEOBJS = $(ADDL_DEPS),addr2line.obj
+
 OBJDUMPOBJS = $(ADDL_DEPS),objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(OPCODES_DEP)
 
-all: config.h size.exe strings.exe objdump.exe nm.exe
+all: config.h size.exe strings.exe objdump.exe nm.exe addr2line.exe
 
 size.exe: $(SIZEOBJS)
        link/exe=$@ size.obj,$(ADDL_LIBS)$(LIBS)
@@ -64,13 +60,12 @@ strings.exe: $(STRINGSOBJS)
 nm.exe: $(NMOBJS)
        link/exe=$@ nm.obj,$(ADDL_LIBS)$(LIBS)
 
+addr2line.exe: $(ADDR2LINEOBJS)
+       link/exe=$@ addr2line.obj,$(ADDL_LIBS)$(LIBS)
+
 objdump.exe: $(OBJDUMPOBJS)
        link/exe=$@ objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(BFDLIB),$(OPCODES),$(ADDL_LIBS)$(LIBS)
 
-
-version.obj: version.c
-       $(CC) $(CFLAGS)/define=(VERSION="""$(VERSION)""") $<
-
 config.h:
        $$ @configure
        $(MAKE) -f makefile.vms "CC=$(CC)"