diff -Naur binutils-2.18/Makefile.tpl binutils-2.18-fat/Makefile.tpl --- binutils-2.18/Makefile.tpl 2007-08-06 13:00:29.000000000 -0700 +++ binutils-2.18-fat/Makefile.tpl 2007-11-23 00:14:20.906250000 -0800 @@ -1591,6 +1591,14 @@ @serialization_dependencies@ # -------------------------------- +# fat binutils +# -------------------------------- + +binutils-fat: all + OBJS_AND_DEFS=`find | grep '\.o$$' | sed -e 's,^.*/main_\(.*\)\.o,-D\1_IS_ENABLED,'` ; \ + $(CC) -Ibfd -I$(srcdir)/bfd -I$(srcdir)/include $(CFLAGS) $$OBJS_AND_DEFS $(srcdir)/main_fat.c $(LDFLAGS) -o $@ + +# -------------------------------- # Regenerating top level configury # -------------------------------- diff -Naur binutils-2.18/main_fat.c binutils-2.18-fat/main_fat.c --- binutils-2.18/main_fat.c 1969-12-31 16:00:00.000000000 -0800 +++ binutils-2.18-fat/main_fat.c 2007-11-22 23:41:00.609375000 -0800 @@ -0,0 +1,192 @@ +#include +#include +#include + +static int starts_with(const char *string, const char *start) { + while (*string && *start && *string++ == *start) + if (*++start == 0) + return 1; + return 0; +} + +static int ends_with(const char *string, const char *end) { + const int strlen_end = strlen(end); + const int strlen_string = strlen(string); + if (strlen_string < strlen_end) + return 0; + return 0==strcmp(string + strlen_string - strlen_end, end); +} + +/* --------------------------------------------------------------------------------------------- */ +int is_strip = 0; +int is_ranlib = 0; +int is_readelf = 0; +int is_windres = 0; + +/* --------------------------------------------------------------------------------------------- */ +enum dwarf_section_display_enum { dummy } ; + +extern int readelf_load_debug_section(enum dwarf_section_display_enum debug, void *file); +extern int objdump_load_debug_section(enum dwarf_section_display_enum debug, void *file); +extern int readelf_free_debug_section(enum dwarf_section_display_enum debug); +extern int objdump_free_debug_section(enum dwarf_section_display_enum debug); + +int load_debug_section(enum dwarf_section_display_enum debug, void *file); +int load_debug_section(enum dwarf_section_display_enum debug, void *file) { +#ifdef readelf_IS_ENABLED + if ( is_readelf) return readelf_load_debug_section(debug, file); +#endif +#ifdef objdump_IS_ENABLED + if (!is_readelf) return objdump_load_debug_section(debug, file); +#endif + return 0; +} + +void free_debug_section(enum dwarf_section_display_enum debug); +void free_debug_section(enum dwarf_section_display_enum debug) { +#ifdef readelf_IS_ENABLED + if ( is_readelf) readelf_free_debug_section(debug); +#endif +#ifdef objdump_IS_ENABLED + if (!is_readelf) objdump_free_debug_section(debug); +#endif +} + +/* --------------------------------------------------------------------------------------------- */ +#if __GNUC__ >= 2 +#define BFD64 +#endif +#include "bfd.h" +typedef bfd_size_type rc_uint_type; + +extern void *windres_res_alloc(rc_uint_type bytes); +extern void *windmc_res_alloc(rc_uint_type bytes); + +void *res_alloc(rc_uint_type bytes); +void *res_alloc(rc_uint_type bytes) { +#ifdef windres_IS_ENABLED + if ( is_windres) return windres_res_alloc(bytes); +#endif +#ifdef windmc_IS_ENABLED + if (!is_windres) return windmc_res_alloc(bytes); +#endif + return 0; +} + +/* --------------------------------------------------------------------------------------------- */ + +int main(int argc, char **argv) { + + char *p, *prog = argv[0]; + for (p=prog; *p; p++) + if (*p=='/' || *p=='\\') + prog = p+1; + + if (argc>1) { + if (starts_with(prog, "binutils") + || ends_with(prog, "binutils") + || ends_with(prog, "binutils-fat") + || ends_with(prog, "binutils.exe") + || ends_with(prog, "binutils-fat.exe")) { + int new_argc; + char **new_argv = (char**)malloc((argc+1) * sizeof(char*)); + for (new_argc=0; new_argc= 2 +#define BFD64 +#endif +#include "bfd.h" +typedef bfd_size_type rc_uint_type; + +#define RES_ALLOC_SHIM(X) \ + extern \ + int X##_res_alloc(rc_uint_type bytes); \ + int res_alloc(rc_uint_type bytes); \ + int res_alloc(rc_uint_type bytes) \ + { return X##_res_alloc(bytes); } + +#ifdef IS_main_windres +RES_ALLOC_SHIM(windres) +#endif + +#ifdef IS_main_windmc +RES_ALLOC_SHIM(windmc) +#endif diff -Naur binutils-2.18/binutils/Makefile.am binutils-2.18-fat/binutils/Makefile.am --- binutils-2.18/binutils/Makefile.am 2007-08-06 12:55:08.000000000 -0700 +++ binutils-2.18-fat/binutils/Makefile.am 2007-11-22 23:41:00.515625000 -0800 @@ -355,6 +337,106 @@ dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL) +#################################################################################### + +nodist_ar_SOURCES = main_ar.c +nodist_ranlib_SOURCES = main_ranlib.c +nodist_objcopy_SOURCES = main_objcopy.c +nodist_strip_new_SOURCES = main_strip.c +nodist_strings_SOURCES = main_strings.c +nodist_readelf_SOURCES = main_readelf.c +nodist_size_SOURCES = main_size.c +nodist_nm_new_SOURCES = main_nm.c +nodist_objdump_SOURCES = main_objdump.c +nodist_cxxfilt_SOURCES = main_cxxfilt.c +nodist_addr2line_SOURCES = main_addr2line.c +nodist_nlmconv_SOURCES = main_nlmconv.c +nodist_dlltool_SOURCES = main_dlltool.c +nodist_windres_SOURCES = main_windres.c +nodist_windmc_SOURCES = main_windmc.c +nodist_dllwrap_SOURCES = main_dllwrap.c +nodist_srconv_SOURCES = main_srconv.c +nodist_sysdump_SOURCES = main_sysdump.c +nodist_coffdump_SOURCES = main_coffdump.c + +main_ar.c main_ranlib.c main_objcopy.c main_strip.c main_strings.c main_readelf.c \ +main_size.c main_nm.c main_objdump.c main_cxxfilt.c main_addr2line.c main_nlmconv.c \ +main_dlltool.c main_windres.c main_windmc.c main_dllwrap.c main_srconv.c main_sysdump.c \ +main_coffdump.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(ar_OBJECTS): APP_STEM=ar +$(ranlib_OBJECTS): APP_STEM=ar +$(objcopy_OBJECTS): APP_STEM=objcopy +$(strip_new_OBJECTS): APP_STEM=objcopy + +$(size_OBJECTS): APP_STEM=size +$(nm_new_OBJECTS): APP_STEM=nm +$(windmc_OBJECTS): APP_STEM=windmc +$(srconv_OBJECTS): APP_STEM=srconv +$(strings_OBJECTS): APP_STEM=strings +$(readelf_OBJECTS): APP_STEM=readelf +$(objdump_OBJECTS): APP_STEM=objdump +$(cxxfilt_OBJECTS): APP_STEM=cxxfilt +$(nlmconv_OBJECTS): APP_STEM=nlmconv +$(dlltool_OBJECTS): APP_STEM=dlltool +$(windres_OBJECTS): APP_STEM=windres +$(sysdump_OBJECTS): APP_STEM=sysdump +$(dllwrap_OBJECTS): APP_STEM=dllwrap +$(coffdump_OBJECTS): APP_STEM=coffdump +$(addr2line_OBJECTS): APP_STEM=addr2line + +bucomm.o version.o winduni.o filemode.o dwarf.o: AM_CPPFLAGS= + +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + +#################################################################################### EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \ diff -Naur binutils-2.18/gas/Makefile.am binutils-2.18-fat/gas/Makefile.am --- binutils-2.18/gas/Makefile.am 2007-08-28 10:19:35.000000000 -0700 +++ binutils-2.18-fat/gas/Makefile.am 2007-11-22 23:41:00.578125000 -0800 @@ -514,6 +514,65 @@ as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ $(extra_objects) $(GASLIBS) $(LIBINTL_DEP) +#################################################################################### + +nodist_as_new_SOURCES = main_as.c + +main_as.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(as_new_OBJECTS): APP_STEM=as + +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + +#################################################################################### + # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. $(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \ diff -Naur binutils-2.18/gprof/Makefile.am binutils-2.18-fat/gprof/Makefile.am --- binutils-2.18/gprof/Makefile.am 2007-08-12 18:51:51.000000000 -0700 +++ binutils-2.18-fat/gprof/Makefile.am 2007-11-22 23:41:00.593750000 -0800 @@ -32,6 +32,65 @@ gprof_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL_DEP) gprof_LDADD = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL) +#################################################################################### + +nodist_gprof_SOURCES = main_gprof.c + +main_gprof.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(gprof_OBJECTS): APP_STEM=gprof + +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + +#################################################################################### + noinst_HEADERS = \ basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \ corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \ diff -Naur binutils-2.18/ld/Makefile.am binutils-2.18-fat/ld/Makefile.am --- binutils-2.18/ld/Makefile.am 2007-08-06 13:00:17.000000000 -0700 +++ binutils-2.18-fat/ld/Makefile.am 2007-11-22 23:41:00.593750000 -0800 @@ -1700,6 +1700,67 @@ ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP) ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) +#################################################################################### + +nodist_ld_new_SOURCES = main_ld.c + +main_ld.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(ld_new_OBJECTS): APP_STEM=ld + +deffilep.o pe-dll.o pep-dll.o: AM_CPPFLAGS= + +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + +#################################################################################### + # The generated emulation files mostly have the same dependencies. $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \ ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \ ################################################# # removing now-unused is/not/maybe-ranlib/strip # ################################################# diff -Naur binutils-2.18/binutils/Makefile.am binutils-2.18-fat/binutils/Makefile.am --- binutils-2.18/binutils/Makefile.am 2007-08-06 12:55:08.000000000 -0700 +++ binutils-2.18-fat/binutils/Makefile.am 2007-11-22 23:41:00.515625000 -0800 @@ -91,8 +91,8 @@ coffdump.c coffgrok.c cxxfilt.c \ dwarf.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.c filemode.c \ - ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ - nlmconv.c nm.c not-ranlib.c not-strip.c \ + ieee.c \ + nlmconv.c nm.c \ objcopy.c objdump.c prdbg.c \ rclex.c rdcoff.c rddbg.c readelf.c rename.c \ resbin.c rescoff.c resrc.c resres.c \ @@ -211,14 +211,14 @@ size_SOURCES = size.c $(BULIBS) -objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) +objcopy_SOURCES = objcopy.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) strings_SOURCES = strings.c $(BULIBS) readelf_SOURCES = readelf.c version.c unwind-ia64.c dwarf.c readelf_LDADD = $(LIBINTL) $(LIBIBERTY) -strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) +strip_new_SOURCES = objcopy.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) nm_new_SOURCES = nm.c $(BULIBS) @@ -230,34 +230,16 @@ cxxfilt_SOURCES = cxxfilt.c $(BULIBS) -ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ +ar_SOURCES = arparse.y arlex.l ar.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) -ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \ +ranlib_SOURCES = ar.c arparse.y arlex.l arsup.c rename.c \ binemul.c emul_$(EMULATION).c $(BULIBS) ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) addr2line_SOURCES = addr2line.c $(BULIBS) -# The following is commented out for the conversion to automake. -# This rule creates a single binary that switches between ar and ranlib -# by looking at argv[0]. Use this kludge to save some disk space. -# However, you have to install things by hand. -# (That is after 'make install', replace the installed ranlib by a link to ar.) -# Alternatively, you can install ranlib.sh as ranlib. -# ar_with_ranlib: $(ADDL_DEPS) ar.o maybe-ranlib.o -# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) -# -rm -f $(RANLIB_PROG) -# -ln $(AR_PROG) $(RANLIB_PROG) -# -# objcopy and strip in one binary that uses argv[0] to decide its action. -# -#objcopy_with_strip: $(ADDL_DEPS) objcopy.o maybe-strip.o -# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS) -# -rm -f $(STRIP_PROG) -# -ln $(OBJCOPY_PROG) $(STRIP_PROG) - sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c @@ -619,10 +619,6 @@ config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/ieee.h $(INCDIR)/libiberty.h \ $(INCDIR)/ansidecl.h debug.h budbg.h $(INCDIR)/filenames.h -is-ranlib.o: is-ranlib.c -is-strip.o: is-strip.c -maybe-ranlib.o: maybe-ranlib.c -maybe-strip.o: maybe-strip.c nlmconv.o: nlmconv.c sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ @@ -637,8 +637,6 @@ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \ bucomm.h -not-ranlib.o: not-ranlib.c -not-strip.o: not-strip.c objcopy.o: objcopy.c sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ diff -Naur binutils-2.18/binutils/is-ranlib.c binutils-2.18-fat/binutils/is-ranlib.c --- binutils-2.18/binutils/is-ranlib.c 2007-08-06 12:55:18.000000000 -0700 +++ binutils-2.18-fat/binutils/is-ranlib.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,22 +0,0 @@ -/* Copyright 2007 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Linked with ar.o to flag that this program is 'ranlib' (not 'ar'). */ - -int is_ranlib = 1; diff -Naur binutils-2.18/binutils/is-strip.c binutils-2.18-fat/binutils/is-strip.c --- binutils-2.18/binutils/is-strip.c 2007-08-06 12:55:18.000000000 -0700 +++ binutils-2.18-fat/binutils/is-strip.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,23 +0,0 @@ -/* Copyright 2007 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Linked with objcopy.o to flag that this program is 'strip' (not - 'objcopy'). */ - -int is_strip = 1; diff -Naur binutils-2.18/binutils/maybe-ranlib.c binutils-2.18-fat/binutils/maybe-ranlib.c --- binutils-2.18/binutils/maybe-ranlib.c 2007-08-06 12:55:18.000000000 -0700 +++ binutils-2.18-fat/binutils/maybe-ranlib.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,23 +0,0 @@ -/* Copyright 2007 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Linked with ar.o to flag that this program decides at runtime - (using argv[0] if it is is 'ar' or 'ranlib'. */ - -int is_ranlib = -1; diff -Naur binutils-2.18/binutils/maybe-strip.c binutils-2.18-fat/binutils/maybe-strip.c --- binutils-2.18/binutils/maybe-strip.c 2007-08-06 12:55:18.000000000 -0700 +++ binutils-2.18-fat/binutils/maybe-strip.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,23 +0,0 @@ -/* Copyright 2007 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Linked with objcopy.o to flag that this program decides at runtime - (using argv[0] if it is is 'strip' or 'objcopy'. */ - -int is_strip = -1; diff -Naur binutils-2.18/binutils/not-ranlib.c binutils-2.18-fat/binutils/not-ranlib.c --- binutils-2.18/binutils/not-ranlib.c 2007-08-06 12:56:13.000000000 -0700 +++ binutils-2.18-fat/binutils/not-ranlib.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,22 +0,0 @@ -/* Copyright 2007 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Linked with ar.o to flag that this program is 'ar' (not 'ranlib'). */ - -int is_ranlib = 0; diff -Naur binutils-2.18/binutils/not-strip.c binutils-2.18-fat/binutils/not-strip.c --- binutils-2.18/binutils/not-strip.c 2007-08-06 12:56:13.000000000 -0700 +++ binutils-2.18-fat/binutils/not-strip.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,23 +0,0 @@ -/* Copyright 2007 Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -/* Linked with objcopy.o to flag that this program is 'objcopy' (not - 'strip'). */ - -int is_strip = 0; #################################################################### # including patches for automake outputs as a convenience to users # #################################################################### diff -Naur binutils-2.18/Makefile.in binutils-2.18-fat/Makefile.in --- binutils-2.18/Makefile.in 2007-08-28 13:21:41.000000000 -0700 +++ binutils-2.18-fat/Makefile.in 2007-11-23 00:15:35.734375000 -0800 @@ -49462,6 +49462,14 @@ @serialization_dependencies@ # -------------------------------- +# fat binutils +# -------------------------------- + +binutils-fat: all + OBJS_AND_DEFS=`find | grep '\.o$$' | sed -e 's,^.*/main_\(.*\)\.o,-D\1_IS_ENABLED,'` ; \ + $(CC) -Ibfd -I$(srcdir)/bfd -I$(srcdir)/include $(CFLAGS) $$OBJS_AND_DEFS $(srcdir)/main_fat.c $(LDFLAGS) -o $@ + +# -------------------------------- # Regenerating top level configury # -------------------------------- diff -Naur binutils-2.18/binutils/Makefile.in binutils-2.18-fat/binutils/Makefile.in --- binutils-2.18/binutils/Makefile.in 2007-08-06 13:29:53.000000000 -0700 +++ binutils-2.18-fat/binutils/Makefile.in 2007-11-22 23:41:00.562500000 -0800 @@ -100,77 +100,98 @@ PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1) -addr2line_OBJECTS = $(am_addr2line_OBJECTS) +nodist_addr2line_OBJECTS = main_addr2line.$(OBJEXT) +addr2line_OBJECTS = $(am_addr2line_OBJECTS) \ + $(nodist_addr2line_OBJECTS) addr2line_LDADD = $(LDADD) am__DEPENDENCIES_1 = ../bfd/libbfd.la am__DEPENDENCIES_2 = ../libiberty/libiberty.a am__DEPENDENCIES_3 = am_ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \ - not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ - binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) -ar_OBJECTS = $(am_ar_OBJECTS) + arsup.$(OBJEXT) rename.$(OBJEXT) binemul.$(OBJEXT) \ + emul_$(EMULATION).$(OBJEXT) $(am__objects_1) +nodist_ar_OBJECTS = main_ar.$(OBJEXT) +ar_OBJECTS = $(am_ar_OBJECTS) $(nodist_ar_OBJECTS) am_coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \ $(am__objects_1) -coffdump_OBJECTS = $(am_coffdump_OBJECTS) +nodist_coffdump_OBJECTS = main_coffdump.$(OBJEXT) +coffdump_OBJECTS = $(am_coffdump_OBJECTS) $(nodist_coffdump_OBJECTS) coffdump_LDADD = $(LDADD) am_cxxfilt_OBJECTS = cxxfilt.$(OBJEXT) $(am__objects_1) -cxxfilt_OBJECTS = $(am_cxxfilt_OBJECTS) +nodist_cxxfilt_OBJECTS = main_cxxfilt.$(OBJEXT) +cxxfilt_OBJECTS = $(am_cxxfilt_OBJECTS) $(nodist_cxxfilt_OBJECTS) cxxfilt_LDADD = $(LDADD) am_dlltool_OBJECTS = dlltool.$(OBJEXT) defparse.$(OBJEXT) \ deflex.$(OBJEXT) $(am__objects_1) -dlltool_OBJECTS = $(am_dlltool_OBJECTS) +nodist_dlltool_OBJECTS = main_dlltool.$(OBJEXT) +dlltool_OBJECTS = $(am_dlltool_OBJECTS) $(nodist_dlltool_OBJECTS) am_dllwrap_OBJECTS = dllwrap.$(OBJEXT) version.$(OBJEXT) -dllwrap_OBJECTS = $(am_dllwrap_OBJECTS) +nodist_dllwrap_OBJECTS = main_dllwrap.$(OBJEXT) +dllwrap_OBJECTS = $(am_dllwrap_OBJECTS) $(nodist_dllwrap_OBJECTS) am_nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \ $(am__objects_1) -nlmconv_OBJECTS = $(am_nlmconv_OBJECTS) +nodist_nlmconv_OBJECTS = main_nlmconv.$(OBJEXT) +nlmconv_OBJECTS = $(am_nlmconv_OBJECTS) $(nodist_nlmconv_OBJECTS) nlmconv_LDADD = $(LDADD) am_nm_new_OBJECTS = nm.$(OBJEXT) $(am__objects_1) -nm_new_OBJECTS = $(am_nm_new_OBJECTS) +nodist_nm_new_OBJECTS = main_nm.$(OBJEXT) +nm_new_OBJECTS = $(am_nm_new_OBJECTS) $(nodist_nm_new_OBJECTS) nm_new_LDADD = $(LDADD) am__objects_2 = rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ ieee.$(OBJEXT) rdcoff.$(OBJEXT) am__objects_3 = $(am__objects_2) wrstabs.$(OBJEXT) -am_objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \ - rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) -objcopy_OBJECTS = $(am_objcopy_OBJECTS) +am_objcopy_OBJECTS = objcopy.$(OBJEXT) rename.$(OBJEXT) \ + $(am__objects_3) $(am__objects_1) +nodist_objcopy_OBJECTS = main_objcopy.$(OBJEXT) +objcopy_OBJECTS = $(am_objcopy_OBJECTS) $(nodist_objcopy_OBJECTS) objcopy_LDADD = $(LDADD) am_objdump_OBJECTS = objdump.$(OBJEXT) dwarf.$(OBJEXT) prdbg.$(OBJEXT) \ $(am__objects_2) $(am__objects_1) -objdump_OBJECTS = $(am_objdump_OBJECTS) +nodist_objdump_OBJECTS = main_objdump.$(OBJEXT) +objdump_OBJECTS = $(am_objdump_OBJECTS) $(nodist_objdump_OBJECTS) am__DEPENDENCIES_4 = ../opcodes/libopcodes.la -am_ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \ - arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \ - binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1) -ranlib_OBJECTS = $(am_ranlib_OBJECTS) +am_ranlib_OBJECTS = ar.$(OBJEXT) arparse.$(OBJEXT) arlex.$(OBJEXT) \ + arsup.$(OBJEXT) rename.$(OBJEXT) binemul.$(OBJEXT) \ + emul_$(EMULATION).$(OBJEXT) $(am__objects_1) +nodist_ranlib_OBJECTS = main_ranlib.$(OBJEXT) +ranlib_OBJECTS = $(am_ranlib_OBJECTS) $(nodist_ranlib_OBJECTS) am_readelf_OBJECTS = readelf.$(OBJEXT) version.$(OBJEXT) \ unwind-ia64.$(OBJEXT) dwarf.$(OBJEXT) -readelf_OBJECTS = $(am_readelf_OBJECTS) +nodist_readelf_OBJECTS = main_readelf.$(OBJEXT) +readelf_OBJECTS = $(am_readelf_OBJECTS) $(nodist_readelf_OBJECTS) am_size_OBJECTS = size.$(OBJEXT) $(am__objects_1) -size_OBJECTS = $(am_size_OBJECTS) +nodist_size_OBJECTS = main_size.$(OBJEXT) +size_OBJECTS = $(am_size_OBJECTS) $(nodist_size_OBJECTS) size_LDADD = $(LDADD) am_srconv_OBJECTS = srconv.$(OBJEXT) coffgrok.$(OBJEXT) \ $(am__objects_1) -srconv_OBJECTS = $(am_srconv_OBJECTS) +nodist_srconv_OBJECTS = main_srconv.$(OBJEXT) +srconv_OBJECTS = $(am_srconv_OBJECTS) $(nodist_srconv_OBJECTS) srconv_LDADD = $(LDADD) am_strings_OBJECTS = strings.$(OBJEXT) $(am__objects_1) -strings_OBJECTS = $(am_strings_OBJECTS) +nodist_strings_OBJECTS = main_strings.$(OBJEXT) +strings_OBJECTS = $(am_strings_OBJECTS) $(nodist_strings_OBJECTS) strings_LDADD = $(LDADD) -am_strip_new_OBJECTS = objcopy.$(OBJEXT) is-strip.$(OBJEXT) \ - rename.$(OBJEXT) $(am__objects_3) $(am__objects_1) -strip_new_OBJECTS = $(am_strip_new_OBJECTS) +am_strip_new_OBJECTS = objcopy.$(OBJEXT) rename.$(OBJEXT) \ + $(am__objects_3) $(am__objects_1) +nodist_strip_new_OBJECTS = main_strip.$(OBJEXT) +strip_new_OBJECTS = $(am_strip_new_OBJECTS) \ + $(nodist_strip_new_OBJECTS) strip_new_LDADD = $(LDADD) am_sysdump_OBJECTS = sysdump.$(OBJEXT) $(am__objects_1) -sysdump_OBJECTS = $(am_sysdump_OBJECTS) +nodist_sysdump_OBJECTS = main_sysdump.$(OBJEXT) +sysdump_OBJECTS = $(am_sysdump_OBJECTS) $(nodist_sysdump_OBJECTS) sysdump_LDADD = $(LDADD) am_windmc_OBJECTS = windmc.$(OBJEXT) mcparse.$(OBJEXT) mclex.$(OBJEXT) \ winduni.$(OBJEXT) $(am__objects_1) -windmc_OBJECTS = $(am_windmc_OBJECTS) +nodist_windmc_OBJECTS = main_windmc.$(OBJEXT) +windmc_OBJECTS = $(am_windmc_OBJECTS) $(nodist_windmc_OBJECTS) am_windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) \ rescoff.$(OBJEXT) resbin.$(OBJEXT) rcparse.$(OBJEXT) \ rclex.$(OBJEXT) winduni.$(OBJEXT) resres.$(OBJEXT) \ $(am__objects_1) -windres_OBJECTS = $(am_windres_OBJECTS) +nodist_windres_OBJECTS = main_windres.$(OBJEXT) +windres_OBJECTS = $(am_windres_OBJECTS) $(nodist_windres_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = @@ -188,13 +209,25 @@ YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ $(AM_YFLAGS) -SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(coffdump_SOURCES) \ - $(cxxfilt_SOURCES) $(dlltool_SOURCES) $(dllwrap_SOURCES) \ - $(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \ - $(objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \ - $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \ - $(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \ - $(windres_SOURCES) +SOURCES = $(addr2line_SOURCES) $(nodist_addr2line_SOURCES) \ + $(ar_SOURCES) $(nodist_ar_SOURCES) $(coffdump_SOURCES) \ + $(nodist_coffdump_SOURCES) $(cxxfilt_SOURCES) \ + $(nodist_cxxfilt_SOURCES) $(dlltool_SOURCES) \ + $(nodist_dlltool_SOURCES) $(dllwrap_SOURCES) \ + $(nodist_dllwrap_SOURCES) $(nlmconv_SOURCES) \ + $(nodist_nlmconv_SOURCES) $(nm_new_SOURCES) \ + $(nodist_nm_new_SOURCES) $(objcopy_SOURCES) \ + $(nodist_objcopy_SOURCES) $(objdump_SOURCES) \ + $(nodist_objdump_SOURCES) $(ranlib_SOURCES) \ + $(nodist_ranlib_SOURCES) $(readelf_SOURCES) \ + $(nodist_readelf_SOURCES) $(size_SOURCES) \ + $(nodist_size_SOURCES) $(srconv_SOURCES) \ + $(nodist_srconv_SOURCES) $(strings_SOURCES) \ + $(nodist_strings_SOURCES) $(strip_new_SOURCES) \ + $(nodist_strip_new_SOURCES) $(sysdump_SOURCES) \ + $(nodist_sysdump_SOURCES) $(windmc_SOURCES) \ + $(nodist_windmc_SOURCES) $(windres_SOURCES) \ + $(nodist_windres_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -411,8 +444,8 @@ coffdump.c coffgrok.c cxxfilt.c \ dwarf.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.c filemode.c \ - ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ - nlmconv.c nm.c not-ranlib.c not-strip.c \ + ieee.c \ + nlmconv.c nm.c \ objcopy.c objdump.c prdbg.c \ rclex.c rdcoff.c rddbg.c readelf.c rename.c \ resbin.c rescoff.c resrc.c resres.c \ @@ -476,20 +509,20 @@ dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL) size_SOURCES = size.c $(BULIBS) -objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) +objcopy_SOURCES = objcopy.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) strings_SOURCES = strings.c $(BULIBS) readelf_SOURCES = readelf.c version.c unwind-ia64.c dwarf.c readelf_LDADD = $(LIBINTL) $(LIBIBERTY) -strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) +strip_new_SOURCES = objcopy.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) nm_new_SOURCES = nm.c $(BULIBS) objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) cxxfilt_SOURCES = cxxfilt.c $(BULIBS) -ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ +ar_SOURCES = arparse.y arlex.l ar.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) -ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \ +ranlib_SOURCES = ar.c arparse.y arlex.l arsup.c rename.c \ binemul.c emul_$(EMULATION).c $(BULIBS) ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) @@ -510,6 +543,40 @@ windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL) $(LIBICONV) dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL) + +#################################################################################### +nodist_ar_SOURCES = main_ar.c +nodist_ranlib_SOURCES = main_ranlib.c +nodist_objcopy_SOURCES = main_objcopy.c +nodist_strip_new_SOURCES = main_strip.c +nodist_strings_SOURCES = main_strings.c +nodist_readelf_SOURCES = main_readelf.c +nodist_size_SOURCES = main_size.c +nodist_nm_new_SOURCES = main_nm.c +nodist_objdump_SOURCES = main_objdump.c +nodist_cxxfilt_SOURCES = main_cxxfilt.c +nodist_addr2line_SOURCES = main_addr2line.c +nodist_nlmconv_SOURCES = main_nlmconv.c +nodist_dlltool_SOURCES = main_dlltool.c +nodist_windres_SOURCES = main_windres.c +nodist_windmc_SOURCES = main_windmc.c +nodist_dllwrap_SOURCES = main_dllwrap.c +nodist_srconv_SOURCES = main_srconv.c +nodist_sysdump_SOURCES = main_sysdump.c +nodist_coffdump_SOURCES = main_coffdump.c +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + + +#################################################################################### EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \ mcparse.h mcparse.c @@ -1026,24 +1093,6 @@ objdump.o:objdump.c $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c -# The following is commented out for the conversion to automake. -# This rule creates a single binary that switches between ar and ranlib -# by looking at argv[0]. Use this kludge to save some disk space. -# However, you have to install things by hand. -# (That is after 'make install', replace the installed ranlib by a link to ar.) -# Alternatively, you can install ranlib.sh as ranlib. -# ar_with_ranlib: $(ADDL_DEPS) ar.o maybe-ranlib.o -# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS) -# -rm -f $(RANLIB_PROG) -# -ln $(AR_PROG) $(RANLIB_PROG) -# -# objcopy and strip in one binary that uses argv[0] to decide its action. -# -#objcopy_with_strip: $(ADDL_DEPS) objcopy.o maybe-strip.o -# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS) -# -rm -f $(STRIP_PROG) -# -ln $(OBJCOPY_PROG) $(STRIP_PROG) - sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info ./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c ./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c @@ -1119,6 +1168,72 @@ ldname=`echo ld | sed '$(transform)'`; \ $(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c +main_ar.c main_ranlib.c main_objcopy.c main_strip.c main_strings.c main_readelf.c \ +main_size.c main_nm.c main_objdump.c main_cxxfilt.c main_addr2line.c main_nlmconv.c \ +main_dlltool.c main_windres.c main_windmc.c main_dllwrap.c main_srconv.c main_sysdump.c \ +main_coffdump.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(ar_OBJECTS): APP_STEM=ar +$(ranlib_OBJECTS): APP_STEM=ar +$(objcopy_OBJECTS): APP_STEM=objcopy +$(strip_new_OBJECTS): APP_STEM=objcopy + +$(size_OBJECTS): APP_STEM=size +$(nm_new_OBJECTS): APP_STEM=nm +$(windmc_OBJECTS): APP_STEM=windmc +$(srconv_OBJECTS): APP_STEM=srconv +$(strings_OBJECTS): APP_STEM=strings +$(readelf_OBJECTS): APP_STEM=readelf +$(objdump_OBJECTS): APP_STEM=objdump +$(cxxfilt_OBJECTS): APP_STEM=cxxfilt +$(nlmconv_OBJECTS): APP_STEM=nlmconv +$(dlltool_OBJECTS): APP_STEM=dlltool +$(windres_OBJECTS): APP_STEM=windres +$(sysdump_OBJECTS): APP_STEM=sysdump +$(dllwrap_OBJECTS): APP_STEM=dllwrap +$(coffdump_OBJECTS): APP_STEM=coffdump +$(addr2line_OBJECTS): APP_STEM=addr2line + +bucomm.o version.o winduni.o filemode.o dwarf.o: AM_CPPFLAGS= + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + diststuff: $(EXTRA_DIST) info all: info @@ -1269,10 +1384,6 @@ config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/ieee.h $(INCDIR)/libiberty.h \ $(INCDIR)/ansidecl.h debug.h budbg.h $(INCDIR)/filenames.h -is-ranlib.o: is-ranlib.c -is-strip.o: is-strip.c -maybe-ranlib.o: maybe-ranlib.c -maybe-strip.o: maybe-strip.c nlmconv.o: nlmconv.c sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \ @@ -1287,8 +1398,6 @@ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/common.h \ bucomm.h -not-ranlib.o: not-ranlib.c -not-strip.o: not-strip.c objcopy.o: objcopy.c sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/progress.h \ diff -Naur binutils-2.18/gas/Makefile.in binutils-2.18-fat/gas/Makefile.in --- binutils-2.18/gas/Makefile.in 2007-08-28 10:19:35.000000000 -0700 +++ binutils-2.18-fat/gas/Makefile.in 2007-11-22 23:41:00.593750000 -0800 @@ -80,7 +80,8 @@ sb.$(OBJEXT) stabs.$(OBJEXT) subsegs.$(OBJEXT) \ symbols.$(OBJEXT) write.$(OBJEXT) am_as_new_OBJECTS = $(am__objects_1) -as_new_OBJECTS = $(am_as_new_OBJECTS) +nodist_as_new_OBJECTS = main_as.$(OBJEXT) +as_new_OBJECTS = $(am_as_new_OBJECTS) $(nodist_as_new_OBJECTS) am__DEPENDENCIES_1 = tc-@target_cpu_type@.o am__DEPENDENCIES_2 = obj-@obj_format@.o am__DEPENDENCIES_3 = atof-@atof@.o @@ -108,7 +109,7 @@ $(AM_YFLAGS) YLWRAP = $(top_srcdir)/../ylwrap SOURCES = $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) \ - $(itbl_test_SOURCES) + $(nodist_as_new_SOURCES) $(itbl_test_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -746,6 +747,20 @@ as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ $(extra_objects) $(GASLIBS) $(LIBINTL_DEP) + +#################################################################################### +nodist_as_new_SOURCES = main_as.c +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + EXPECT = expect RUNTEST = runtest RUNTESTFLAGS = @@ -2514,6 +2529,50 @@ diststuff: $(EXTRA_DIST) info all: info +main_as.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(as_new_OBJECTS): APP_STEM=as + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + +#################################################################################### + # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. $(OBJS): ../bfd/bfd.h $(INCDIR)/symcat.h \ diff -Naur binutils-2.18/gprof/Makefile.in binutils-2.18-fat/gprof/Makefile.in --- binutils-2.18/gprof/Makefile.in 2007-08-12 18:51:51.000000000 -0700 +++ binutils-2.18-fat/gprof/Makefile.in 2007-11-22 23:41:00.593750000 -0800 @@ -76,7 +76,8 @@ tahoe.$(OBJEXT) sparc.$(OBJEXT) mips.$(OBJEXT) am_gprof_OBJECTS = $(am__objects_1) flat_bl.$(OBJEXT) \ bsd_callg_bl.$(OBJEXT) fsf_callg_bl.$(OBJEXT) -gprof_OBJECTS = $(am_gprof_OBJECTS) +nodist_gprof_OBJECTS = main_gprof.$(OBJEXT) +gprof_OBJECTS = $(am_gprof_OBJECTS) $(nodist_gprof_OBJECTS) am__DEPENDENCIES_1 = DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = @@ -89,7 +90,7 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(gprof_SOURCES) +SOURCES = $(gprof_SOURCES) $(nodist_gprof_SOURCES) INFO_DEPS = gprof.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo @@ -258,6 +259,22 @@ gprof_SOURCES = $(sources) flat_bl.c bsd_callg_bl.c fsf_callg_bl.c gprof_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL_DEP) gprof_LDADD = ../bfd/libbfd.la ../libiberty/libiberty.a $(LIBINTL) + +#################################################################################### +nodist_gprof_SOURCES = main_gprof.c +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + + +#################################################################################### noinst_HEADERS = \ basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \ corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \ @@ -813,6 +830,48 @@ uninstall-man1 +main_gprof.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(gprof_OBJECTS): APP_STEM=gprof + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + diststuff: $(BUILT_SOURCES) info $(man_MANS) # This empty rule is a hack against gmake patched by Apple. diff -Naur binutils-2.18/ld/Makefile.in binutils-2.18-fat/ld/Makefile.in --- binutils-2.18/ld/Makefile.in 2007-08-06 13:29:54.000000000 -0700 +++ binutils-2.18-fat/ld/Makefile.in 2007-11-22 23:41:00.609375000 -0800 @@ -76,7 +76,8 @@ ldmain.$(OBJEXT) ldwrite.$(OBJEXT) ldexp.$(OBJEXT) \ ldemul.$(OBJEXT) ldver.$(OBJEXT) ldmisc.$(OBJEXT) \ ldfile.$(OBJEXT) ldcref.$(OBJEXT) sha1.$(OBJEXT) -ld_new_OBJECTS = $(am_ld_new_OBJECTS) +nodist_ld_new_OBJECTS = main_ld.$(OBJEXT) +ld_new_OBJECTS = $(am_ld_new_OBJECTS) $(nodist_ld_new_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = ../bfd/libbfd.la am__DEPENDENCIES_3 = ../libiberty/libiberty.a @@ -97,7 +98,8 @@ LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ $(AM_YFLAGS) YLWRAP = $(top_srcdir)/../ylwrap -SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES) +SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES) \ + $(nodist_ld_new_SOURCES) INFO_DEPS = ld.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo @@ -707,6 +709,20 @@ ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP) ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) + +#################################################################################### +nodist_ld_new_SOURCES = main_ld.c +AM_CPPFLAGS = \ + -DIS_$* \ + -Dmain=$(APP_STEM)_main \ + -Dreal_main=$(APP_STEM)_main \ + -Dverbose=$(APP_STEM)_verbose \ + -Dres_alloc=$(APP_STEM)_res_alloc \ + -Dload_debug_section=$(APP_STEM)_load_debug_section \ + -Dfree_debug_section=$(APP_STEM)_free_debug_section \ + -Dtarget_is_bigendian=$(APP_STEM)_target_is_bigendian \ + $$YYREMAPS + MAINTAINERCLEANFILES = configdoc.texi ld.info # We want to reconfigure if configure.host or configure.tgt changes. We @@ -2518,6 +2534,52 @@ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS} ${GENSCRIPTS} z8002 "$(tdir_z8002)" +main_ld.c: $(srcdir)/../main_notfat.c + cp $< $@ + +$(ld_new_OBJECTS): APP_STEM=ld + +deffilep.o pe-dll.o pep-dll.o: AM_CPPFLAGS= + +export YYREMAPS = \ + -Dyywrap()=1 \ + -DYY_SKIP_YYWRAP \ + -Dyyin=$(APP_STEM)_yyin \ + -Dyylex=$(APP_STEM)_yylex \ + -Dyyout=$(APP_STEM)_yyout \ + -Dyyleng=$(APP_STEM)_yyleng \ + -Dyyfree=$(APP_STEM)_yyfree \ + -Dyytext=$(APP_STEM)_yytext \ + -Dyyerror=$(APP_STEM)_yyerror \ + -Dyyparse=$(APP_STEM)_yyparse \ + -Dyyalloc=$(APP_STEM)_yyalloc \ + -Dyylineno=$(APP_STEM)_yylineno \ + -Dyyget_in=$(APP_STEM)_yyget_in \ + -Dyyset_in=$(APP_STEM)_yyset_in \ + -Dyyset_out=$(APP_STEM)_yyset_out \ + -Dyyrealloc=$(APP_STEM)_yyrealloc \ + -Dyyrestart=$(APP_STEM)_yyrestart \ + -Dyyget_out=$(APP_STEM)_yyget_out \ + -Dyyget_leng=$(APP_STEM)_yyget_leng \ + -Dyyget_text=$(APP_STEM)_yyget_text \ + -Dyyget_debug=$(APP_STEM)_yyget_debug \ + -Dyyset_debug=$(APP_STEM)_yyset_debug \ + -Dyyset_lineno=$(APP_STEM)_yyset_lineno \ + -Dyyget_lineno=$(APP_STEM)_yyget_lineno \ + -Dyy_flex_debug=$(APP_STEM)_yy_flex_debug \ + -Dyy_scan_bytes=$(APP_STEM)_yy_scan_bytes \ + -Dyylex_destroy=$(APP_STEM)_yylex_destroy \ + -Dyy_scan_string=$(APP_STEM)_yy_scan_string \ + -Dyy_scan_buffer=$(APP_STEM)_yy_scan_buffer \ + -Dyy_flush_buffer=$(APP_STEM)_yy_flush_buffer \ + -Dyy_create_buffer=$(APP_STEM)_yy_create_buffer \ + -Dyy_delete_buffer=$(APP_STEM)_yy_delete_buffer \ + -Dyypop_buffer_state=$(APP_STEM)_yypop_buffer_state \ + -Dyypush_buffer_state=$(APP_STEM)_yypush_buffer_state \ + -Dyy_switch_to_buffer=$(APP_STEM)_yy_switch_to_buffer + +#################################################################################### + # The generated emulation files mostly have the same dependencies. $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \ ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \