* Makefile.am: Add windmc tool.

* Makefile.in: Regenerate.
* configure.in: Add windmc tool.
* configure: Regenerate.
* mclex.c: New.
* mcparse.y: New.
* windmc.c: New.
* windmc.h: New.
* doc/Makefile.am: Add windmc tool.
* doc/Makefile.in: Regenerate.
* doc/binutils.texi: Add windmc documentation.
* NEWS: Mention new tool.
This commit is contained in:
Nick Clifton 2007-06-19 13:24:33 +00:00
parent 293a012441
commit 692ed3e78f
13 changed files with 2443 additions and 43 deletions

View File

@ -1,3 +1,18 @@
2007-06-19 Kai Tietz <kai.tietz@onevision.com>
* Makefile.am: Add windmc tool.
* Makefile.in: Regenerate.
* configure.in: Add windmc tool.
* configure: Regenerate.
* mclex.c: New.
* mcparse.y: New.
* windmc.c: New.
* windmc.h: New.
* doc/Makefile.am: Add windmc tool.
* doc/Makefile.in: Regenerate.
* doc/binutils.texi: Add windmc documentation.
* NEWS: Mention new tool.
2007-06-18 Andi Kleen <ak@suse.de>
* objdump.c: Include sys/mman.h
@ -28,7 +43,7 @@
* winduni.h: (wind_default_codepage, wind_current_codepage):
Export.
* doc/binutils.texi: Document new option.
* NEWS: Mention new feature.
* NEWS: Mention new features of windres.
2007-06-18 Brian D. Watt <bwatt@us.ibm.com>

View File

@ -48,18 +48,19 @@ ADDR2LINE_PROG=addr2line
NLMCONV_PROG=nlmconv
DLLTOOL_PROG=dlltool
WINDRES_PROG=windres
WINDMC_PROG=windmc
DLLWRAP_PROG=dllwrap
SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@
bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ @BUILD_WINDMC@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@
## We need a special rule to install the programs which are built with
## -new, and to rename cxxfilt to c++filt.
RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
noinst_PROGRAMS = $(RENAMED_PROGS) @BUILD_MISC@
EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG)
EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG)
# Stuff that goes in tooldir/ if appropriate.
TOOL_PROGS = nm-new strip-new ar ranlib dlltool objdump objcopy
@ -80,9 +81,10 @@ INCLUDES = -D_GNU_SOURCE \
HFILES = \
arsup.h binemul.h bucomm.h budbg.h \
coffgrok.h debug.h dlltool.h nlmconv.h \
windres.h winduni.h windint.h
windres.h winduni.h windint.h \
windmc.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h
CFILES = \
addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \
@ -95,11 +97,12 @@ CFILES = \
rclex.c rdcoff.c rddbg.c readelf.c rename.c \
resbin.c rescoff.c resrc.c resres.c \
size.c srconv.c stabs.c strings.c sysdump.c version.c \
windres.c winduni.c wrstabs.c
windres.c winduni.c wrstabs.c \
windmc.c mclex.c
GENERATED_CFILES = \
arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
defparse.c deflex.c nlmheader.c rcparse.c
defparse.c deflex.c nlmheader.c rcparse.c mcparse.c
DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
@ -198,6 +201,7 @@ sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBICONV) $(LIBIBERTY) $(BFDLIB)
windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBICONV) $(LIBIBERTY) $(BFDLIB)
addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
@ -290,6 +294,7 @@ arparse.h: arparse.c
defparse.h: defparse.c
nlmheader.h: nlmheader.c
rcparse.h: rcparse.c
mcparse.h: mcparse.c
sysinfo.h: sysinfo.c
# Disable -Werror, if it has been enabled, since old versions of bison/
@ -308,8 +313,12 @@ nlmheader.o:
$(COMPILE) -c $< $(NO_WERROR)
rcparse.o:
$(COMPILE) -c $< $(NO_WERROR)
mcparse.o:
$(COMPILE) -c $< $(NO_WERROR)
rclex.o:
$(COMPILE) -c $< $(NO_WERROR)
mclex.o:
$(COMPILE) -c $< $(NO_WERROR)
srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
@ -338,12 +347,17 @@ windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \
winduni.c resres.c $(BULIBS)
windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
windmc_SOURCES = windmc.c mcparse.y mclex.c \
winduni.c $(BULIBS)
windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
dllwrap_SOURCES = dllwrap.c version.c
dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL)
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
syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \
mcparse.h mcparse.c
diststuff: $(EXTRA_DIST) info
all: info
@ -626,6 +640,11 @@ windres.o: windres.c sysdep.h $(INCDIR)/ansidecl.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
$(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
bucomm.h windres.h winduni.h windint.h
windmc.o: windmc.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 \
$(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
bucomm.h windmc.h winduni.h windint.h
winduni.o: winduni.c sysdep.h $(INCDIR)/ansidecl.h \
../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h winduni.h $(INCDIR)/safe-ctype.h
@ -659,8 +678,17 @@ rcparse.o: rcparse.c sysdep.h $(INCDIR)/ansidecl.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
$(INCDIR)/ansidecl.h windres.h winduni.h windint.h \
$(INCDIR)/safe-ctype.h
mcparse.o: mcparse.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 \
$(INCDIR)/ansidecl.h windmc.h winduni.h \
$(INCDIR)/safe-ctype.h
rclex.o: rclex.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 $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h windres.h winduni.h windint.h rcparse.h
mclex.o: mclex.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 $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h windmc.h winduni.h mcparse.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY

View File

@ -37,23 +37,23 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
bin_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \
$(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) \
bin_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) \
$(am__EXEEXT_9) $(am__EXEEXT_10) $(am__EXEEXT_11) \
@BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \
$(am__EXEEXT_11) $(am__EXEEXT_12) @BUILD_DLLWRAP@ \
@BUILD_INSTALL_MISC@ $(am__empty)
noinst_PROGRAMS = $(am__EXEEXT_16) @BUILD_MISC@
@BUILD_WINDMC@ $(am__EXEEXT_12) $(am__EXEEXT_13) \
@BUILD_DLLWRAP@ @BUILD_INSTALL_MISC@ $(am__empty)
noinst_PROGRAMS = $(am__EXEEXT_17) @BUILD_MISC@
EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \
coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \
$(am__EXEEXT_4)
$(am__EXEEXT_4) $(am__EXEEXT_5)
DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.in $(srcdir)/../mkinstalldirs \
$(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \
defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \
arparse.h arparse.c arlex.c rcparse.h rcparse.c \
$(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \
arparse.h arparse.c arlex.c mcparse.h mcparse.c rcparse.h \
rcparse.c $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \
$(srcdir)/../config.guess $(srcdir)/../config.sub
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -81,21 +81,22 @@ CONFIG_CLEAN_FILES = po/Makefile.in
am__EXEEXT_1 = nlmconv$(EXEEXT)
am__EXEEXT_2 = dlltool$(EXEEXT)
am__EXEEXT_3 = windres$(EXEEXT)
am__EXEEXT_4 = dllwrap$(EXEEXT)
am__EXEEXT_5 = size$(EXEEXT)
am__EXEEXT_6 = objdump$(EXEEXT)
am__EXEEXT_7 = ar$(EXEEXT)
am__EXEEXT_8 = strings$(EXEEXT)
am__EXEEXT_9 = ranlib$(EXEEXT)
am__EXEEXT_10 = objcopy$(EXEEXT)
am__EXEEXT_11 = addr2line$(EXEEXT)
am__EXEEXT_12 = readelf$(EXEEXT)
am__EXEEXT_4 = windmc$(EXEEXT)
am__EXEEXT_5 = dllwrap$(EXEEXT)
am__EXEEXT_6 = size$(EXEEXT)
am__EXEEXT_7 = objdump$(EXEEXT)
am__EXEEXT_8 = ar$(EXEEXT)
am__EXEEXT_9 = strings$(EXEEXT)
am__EXEEXT_10 = ranlib$(EXEEXT)
am__EXEEXT_11 = objcopy$(EXEEXT)
am__EXEEXT_12 = addr2line$(EXEEXT)
am__EXEEXT_13 = readelf$(EXEEXT)
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
am__EXEEXT_13 = nm-new$(EXEEXT)
am__EXEEXT_14 = strip-new$(EXEEXT)
am__EXEEXT_15 = cxxfilt$(EXEEXT)
am__EXEEXT_16 = $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15)
am__EXEEXT_14 = nm-new$(EXEEXT)
am__EXEEXT_15 = strip-new$(EXEEXT)
am__EXEEXT_16 = cxxfilt$(EXEEXT)
am__EXEEXT_17 = $(am__EXEEXT_14) $(am__EXEEXT_15) $(am__EXEEXT_16)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT)
am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1)
@ -162,6 +163,9 @@ strip_new_LDADD = $(LDADD)
am_sysdump_OBJECTS = sysdump.$(OBJEXT) $(am__objects_1)
sysdump_OBJECTS = $(am_sysdump_OBJECTS)
sysdump_LDADD = $(LDADD)
am_windmc_OBJECTS = windmc.$(OBJEXT) mcparse.$(OBJEXT) mclex.$(OBJEXT) \
winduni.$(OBJEXT) $(am__objects_1)
windmc_OBJECTS = $(am_windmc_OBJECTS)
am_windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) \
rescoff.$(OBJEXT) resbin.$(OBJEXT) rcparse.$(OBJEXT) \
rclex.$(OBJEXT) winduni.$(OBJEXT) resres.$(OBJEXT) \
@ -189,7 +193,8 @@ SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(coffdump_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) $(windres_SOURCES)
$(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \
$(windres_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
@ -217,6 +222,7 @@ BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@
BUILD_MISC = @BUILD_MISC@
BUILD_NLMCONV = @BUILD_NLMCONV@
BUILD_SRCONV = @BUILD_SRCONV@
BUILD_WINDMC = @BUILD_WINDMC@
BUILD_WINDRES = @BUILD_WINDRES@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
@ -375,6 +381,7 @@ ADDR2LINE_PROG = addr2line
NLMCONV_PROG = nlmconv
DLLTOOL_PROG = dlltool
WINDRES_PROG = windres
WINDMC_PROG = windmc
DLLWRAP_PROG = dllwrap
SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
@ -395,9 +402,10 @@ INCLUDES = -D_GNU_SOURCE \
HFILES = \
arsup.h binemul.h bucomm.h budbg.h \
coffgrok.h debug.h dlltool.h nlmconv.h \
windres.h winduni.h windint.h
windres.h winduni.h windint.h \
windmc.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h
CFILES = \
addr2line.c ar.c arsup.c bin2c.c binemul.c bucomm.c \
coffdump.c coffgrok.c cxxfilt.c \
@ -409,11 +417,12 @@ CFILES = \
rclex.c rdcoff.c rddbg.c readelf.c rename.c \
resbin.c rescoff.c resrc.c resres.c \
size.c srconv.c stabs.c strings.c sysdump.c version.c \
windres.c winduni.c wrstabs.c
windres.c winduni.c wrstabs.c \
windmc.c mclex.c
GENERATED_CFILES = \
arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
defparse.c deflex.c nlmheader.c rcparse.c
defparse.c deflex.c nlmheader.c rcparse.c mcparse.c
DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
@ -460,6 +469,7 @@ sysdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
coffdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
dlltool_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
windres_DEPENDENCIES = $(LIBINTL_DEP) $(LIBICONV) $(LIBIBERTY) $(BFDLIB)
windmc_DEPENDENCIES = $(LIBINTL_DEP) $(LIBICONV) $(LIBIBERTY) $(BFDLIB)
addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
@ -493,10 +503,15 @@ windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.c \
winduni.c resres.c $(BULIBS)
windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
windmc_SOURCES = windmc.c mcparse.y mclex.c \
winduni.c $(BULIBS)
windmc_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(LIBINTL)
dllwrap_SOURCES = dllwrap.c version.c
dllwrap_LDADD = $(LIBIBERTY) $(LIBINTL)
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
syslex.c deflex.c defparse.h defparse.c rcparse.h rcparse.c \
mcparse.h mcparse.c
DISTCLEANFILES = sysroff.c sysroff.h site.exp site.bak
@ -516,15 +531,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
cd $(srcdir) && $(AUTOMAKE) --cygnus \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --cygnus Makefile
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@ -648,6 +663,9 @@ strip-new$(EXEEXT): $(strip_new_OBJECTS) $(strip_new_DEPENDENCIES)
sysdump$(EXEEXT): $(sysdump_OBJECTS) $(sysdump_DEPENDENCIES)
@rm -f sysdump$(EXEEXT)
$(LINK) $(sysdump_LDFLAGS) $(sysdump_OBJECTS) $(sysdump_LDADD) $(LIBS)
windmc$(EXEEXT): $(windmc_OBJECTS) $(windmc_DEPENDENCIES)
@rm -f windmc$(EXEEXT)
$(LINK) $(windmc_LDFLAGS) $(windmc_OBJECTS) $(windmc_LDADD) $(LIBS)
windres$(EXEEXT): $(windres_OBJECTS) $(windres_DEPENDENCIES)
@rm -f windres$(EXEEXT)
$(LINK) $(windres_LDFLAGS) $(windres_OBJECTS) $(windres_LDADD) $(LIBS)
@ -879,6 +897,8 @@ maintainer-clean-generic:
-rm -f deflex.c
-rm -f defparse.c
-rm -f defparse.h
-rm -f mcparse.c
-rm -f mcparse.h
-rm -f nlmheader.c
-rm -f nlmheader.h
-rm -f rcparse.c
@ -1060,6 +1080,7 @@ arparse.h: arparse.c
defparse.h: defparse.c
nlmheader.h: nlmheader.c
rcparse.h: rcparse.c
mcparse.h: mcparse.c
sysinfo.h: sysinfo.c
# Disable -Werror, if it has been enabled, since old versions of bison/
@ -1078,8 +1099,12 @@ nlmheader.o:
$(COMPILE) -c $< $(NO_WERROR)
rcparse.o:
$(COMPILE) -c $< $(NO_WERROR)
mcparse.o:
$(COMPILE) -c $< $(NO_WERROR)
rclex.o:
$(COMPILE) -c $< $(NO_WERROR)
mclex.o:
$(COMPILE) -c $< $(NO_WERROR)
dlltool.o:
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
@ -1365,6 +1390,11 @@ windres.o: windres.c sysdep.h $(INCDIR)/ansidecl.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
$(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
bucomm.h windres.h winduni.h windint.h
windmc.o: windmc.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 \
$(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \
bucomm.h windmc.h winduni.h windint.h
winduni.o: winduni.c sysdep.h $(INCDIR)/ansidecl.h \
../bfd/bfdver.h config.h $(INCDIR)/fopen-same.h ../bfd/bfd.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h winduni.h $(INCDIR)/safe-ctype.h
@ -1398,10 +1428,19 @@ rcparse.o: rcparse.c sysdep.h $(INCDIR)/ansidecl.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/libiberty.h \
$(INCDIR)/ansidecl.h windres.h winduni.h windint.h \
$(INCDIR)/safe-ctype.h
mcparse.o: mcparse.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 \
$(INCDIR)/ansidecl.h windmc.h winduni.h \
$(INCDIR)/safe-ctype.h
rclex.o: rclex.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 $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h windres.h winduni.h windint.h rcparse.h
mclex.o: mclex.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 $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h windmc.h winduni.h mcparse.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,6 +1,14 @@
-*- text -*-
* Add codepage support to the windres tool.
* A new tool "windmc" has been added for some targets. This is a message
compiler which attempts to be compatible with the MS version.
* Add codepage support to the windres tool. It now supports many new
resource types (e.g. MANIFEST, TOOLBAR, etc). The output generation
for binary files is done now via bfd itself. The endianess problems
for different hosts are solved. Dumps of .res files can now be
re-compiled by windres without lossing resources or compilation errors.
Some problems on dialog resource translations are corrected.
* Add --extract-symbol command line option to objcopy, which will
strip everything out of an ordinary object file or executable except

19
binutils/configure vendored
View File

@ -458,7 +458,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO CPP WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE HDEFINES CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME ALLOCA LIBICONV LTLIBICONV NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_DLLWRAP BUILD_MISC BUILD_INSTALL_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LIBTOOL SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO CPP WARN_CFLAGS NO_WERROR YACC LEX LEXLIB LEX_OUTPUT_ROOT USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE HDEFINES CC_FOR_BUILD EXEEXT_FOR_BUILD DEMANGLER_NAME ALLOCA LIBICONV LTLIBICONV NLMCONV_DEFS BUILD_NLMCONV BUILD_SRCONV BUILD_DLLTOOL DLLTOOL_DEFS BUILD_WINDRES BUILD_WINDMC BUILD_DLLWRAP BUILD_MISC BUILD_INSTALL_MISC OBJDUMP_DEFS EMULATION EMULATION_VECTOR datarootdir docdir htmldir LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -14417,6 +14417,7 @@ BUILD_DLLTOOL=
DLLTOOL_DEFS=
DLLTOOL_DEFAULT=
BUILD_WINDRES=
BUILD_WINDMC=
BUILD_DLLWRAP=
BUILD_MISC=
BUILD_INSTALL_MISC=
@ -14460,6 +14461,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
arm-wince-pe* | arm-*-wince)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -14468,6 +14470,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
arm-*-pe*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -14476,6 +14479,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
thumb-*-pe*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -14484,6 +14488,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
x86_64-*-mingw*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -14492,6 +14497,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
;;
i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
@ -14501,6 +14507,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
;;
i[3-7]86-*-interix)
@ -14522,6 +14529,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
powerpc*-*-linux* | powerpc*-*-elf*)
BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
@ -14533,6 +14541,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
spu-*-*)
BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
@ -14544,6 +14553,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
mcore-*-pe)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -14552,6 +14562,7 @@ do
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
mcore-*-elf)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -14573,6 +14584,11 @@ if test "${with_windres+set}" = set; then
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
fi
if test "${with_windmc+set}" = set; then
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
fi
@ -15637,6 +15653,7 @@ s,@BUILD_SRCONV@,$BUILD_SRCONV,;t t
s,@BUILD_DLLTOOL@,$BUILD_DLLTOOL,;t t
s,@DLLTOOL_DEFS@,$DLLTOOL_DEFS,;t t
s,@BUILD_WINDRES@,$BUILD_WINDRES,;t t
s,@BUILD_WINDMC@,$BUILD_WINDMC,;t t
s,@BUILD_DLLWRAP@,$BUILD_DLLWRAP,;t t
s,@BUILD_MISC@,$BUILD_MISC,;t t
s,@BUILD_INSTALL_MISC@,$BUILD_INSTALL_MISC,;t t

View File

@ -211,6 +211,7 @@ BUILD_DLLTOOL=
DLLTOOL_DEFS=
DLLTOOL_DEFAULT=
BUILD_WINDRES=
BUILD_WINDMC=
BUILD_DLLWRAP=
BUILD_MISC=
BUILD_INSTALL_MISC=
@ -256,6 +257,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
arm-wince-pe* | arm-*-wince)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -264,6 +266,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
arm-*-pe*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -272,6 +275,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
thumb-*-pe*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -280,6 +284,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
x86_64-*-mingw*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -288,6 +293,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
;;
changequote(,)dnl
@ -299,6 +305,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
;;
changequote(,)dnl
@ -324,6 +331,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
powerpc*-*-linux* | powerpc*-*-elf*)
BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
@ -335,6 +343,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
spu-*-*)
BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
@ -346,6 +355,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
mcore-*-pe)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -354,6 +364,7 @@ changequote([,])dnl
fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
;;
mcore-*-elf)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -375,12 +386,17 @@ if test "${with_windres+set}" = set; then
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
fi
if test "${with_windmc+set}" = set; then
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
fi
AC_SUBST(NLMCONV_DEFS)
AC_SUBST(BUILD_NLMCONV)
AC_SUBST(BUILD_SRCONV)
AC_SUBST(BUILD_DLLTOOL)
AC_SUBST(DLLTOOL_DEFS)
AC_SUBST(BUILD_WINDRES)
AC_SUBST(BUILD_WINDMC)
AC_SUBST(BUILD_DLLWRAP)
AC_SUBST(BUILD_MISC)
AC_SUBST(BUILD_INSTALL_MISC)

View File

@ -28,6 +28,7 @@ man_MANS = \
strings.1 \
strip.1 \
windres.1 \
windmc.1 \
$(DEMANGLER_NAME).1
info_TEXINFOS = binutils.texi
@ -130,6 +131,13 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f windres.pod
windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod
-($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f windmc.pod
cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod

View File

@ -93,6 +93,7 @@ BUILD_INSTALL_MISC = @BUILD_INSTALL_MISC@
BUILD_MISC = @BUILD_MISC@
BUILD_NLMCONV = @BUILD_NLMCONV@
BUILD_SRCONV = @BUILD_SRCONV@
BUILD_WINDMC = @BUILD_WINDMC@
BUILD_WINDRES = @BUILD_WINDRES@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
@ -249,6 +250,7 @@ man_MANS = \
strings.1 \
strip.1 \
windres.1 \
windmc.1 \
$(DEMANGLER_NAME).1
info_TEXINFOS = binutils.texi
@ -280,9 +282,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --cygnus doc/Makefile
$(AUTOMAKE) --foreign doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@ -679,6 +681,13 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f windres.pod
windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod
-($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
rm -f windmc.pod
cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS)
touch $@
-$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod

View File

@ -25,6 +25,7 @@ START-INFO-DIR-ENTRY
* addr2line: (binutils)addr2line. Convert addresses to file and line
* nlmconv: (binutils)nlmconv. Converts object code into an NLM
* windres: (binutils)windres. Manipulate Windows resources
* windmc: (binutils)windmc. Generator for Windows message resources
* dlltool: (binutils)dlltool. Create files needed to build and use DLLs
END-INFO-DIR-ENTRY
@end format
@ -145,6 +146,9 @@ Convert object code into a Netware Loadable Module
@item windres
Manipulate Windows resources
@item windmc
Genertor for Windows message resources
@item dlltool
Create the files needed to build and use Dynamic Link Libraries
@end table
@ -169,6 +173,7 @@ section entitled "GNU Free Documentation License".
* addr2line:: Convert addresses to file and line
* nlmconv:: Converts object code into an NLM
* windres:: Manipulate Windows resources
* windmc:: Generator for Windows message resources
* dlltool:: Create files needed to build and use DLLs
* Common Options:: Command-line options for all utilities
* Selecting The Target System:: How these utilities determine the target.
@ -2869,6 +2874,168 @@ the Info entries for @file{binutils}.
@c man end
@end ignore
@node windmc
@chapter windmc
@command{windmc} may be used to generator Windows message resources.
@quotation
@emph{Warning:} @command{windmc} is not always built as part of the binary
utilities, since it is only useful for Windows targets.
@end quotation
@c man title windmc generates Windows message resources.
@smallexample
@c man begin SYNOPSIS windres
windmc [options] input-file
@c man end
@end smallexample
@c man begin DESCRIPTION windmc
@command{windmc} reads message definitions from an input file (.mc) and
translate them into a set of output files. The output files may be of
four kinds:
@table @code
@item h
A C header file containing the message definitions.
@item rc
A resource file compilable by the @command{windres} tool.
@item bin
One or more binary files containing the resource data for a specific
message language.
@item dbg
A C include file that maps message id's to their symbolic name.
@end table
The exact description of these different formats is available in
documentation from Microsoft.
When @command{windmc} converts from the @code{mc} format to the @code{bin}
format, @code{rc}, @code{h}, and optional @code{dbg} it is acting like the
Windows Message Compiler.
@c man end
@c man begin OPTIONS windmc
@table @env
@item -a
@itemx --ascii_in
Specifies that the input file specified is ANSI. This is the default
behaviour.
@item -A
@itemx --ascii_out
Specifies that messages in the output @code{bin} files should be in ANSI
format.
@item -b
@itemx --binprefix
Specifies that @code{bin} filenames should have to be prefixed by the
basename of the source file.
@item -c
@itemx --customflag
Sets the customer bit in all message id's.
@item -C @var{codepage}
@itemx --codepage_in @var{codepage}
Sets the default codepage to be used to convert input file to UTF16. The
default is ocdepage 1252.
@item -d
@itemx --decimal_values
Outputs the constants in the header file in decimal. Default is using
hexadecimal output.
@item -e @var{ext}
@itemx --extension @var{ext}
The extension for the header file. The default is .h extension.
@item -F @var{target}
@itemx --target @var{target}
Specify the BFD format to use for a bin file as output. This
is a BFD target name; you can use the @option{--help} option to see a list
of supported targets. Normally @command{windmc} will use the default
format, which is the first one listed by the @option{--help} option.
@ifclear man
@ref{Target Selection}.
@end ifclear
@item -h @var{path}
@itemx --headerdir @var{path}
The target directory of the generated header file. The default is the
current directory.
@item -H
@itemx --help
Displays a list of command line options and then exits.
@item -m @var{characters}
@itemx --maxlength @var{characters}
Instructs @command{windmc} to generate a warning if the length
of any message exceeds the number specified.
@item -n
@itemx --nullterminate
Terminate message text in @code{bin} files by zero. By default they are
terminated by CR/LF.
@item -o
@itemx --hresult_use
Not yet implemented. Instructs @code{windmc} to generate an OLE2 header
file, using HRESULT definitions. Status codes are used if the flag is not
specified.
@item -O @var{codepage}
@itemx --codepage_out @var{codepage}
Sets the default codepage to be used to output text files. The default
is ocdepage 1252.
@item -r @var{path}
@itemx --rcdir @var{path}
The target directory for the generated @code{rc} script and the generated
@code{bin} files that the resource compiler script includes. The default
is the current directory.
@item -u
@itemx --unicode_in
Specifies that the input file is UTF16.
@item -U
@itemx --unicode_out
Specifies that messages in the output @code{bin} file should be in UTF16
format. This is the default behaviour.
@item -v
@item --verbose
Enable verbose mode. This tells you what the preprocessor is if you
didn't specify one.
@item -V
@item --version
Prints the version number for @command{windres}.
@item -x @var{path}
@itemx --xdgb @var{path}
The path of the @code{dbg} C include file that maps message id's to the
symbolic name. No such file is generated without specifying the switch.
@end table
@c man end
@ignore
@c man begin SEEALSO windmc
the Info entries for @file{binutils}.
@c man end
@end ignore
@node windres
@chapter windres

441
binutils/mclex.c Normal file
View File

@ -0,0 +1,441 @@
/* mclex.c -- lexer for Windows mc files parser.
Copyright 2007
Free Software Foundation, Inc.
Written by Kai Tietz, Onevision.
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 2 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. */
/* This is a lexer used by the Windows rc file parser.
It basically just recognized a bunch of keywords. */
#include "sysdep.h"
#include "bfd.h"
#include "bucomm.h"
#include "libiberty.h"
#include "safe-ctype.h"
#include "windmc.h"
#include "mcparse.h"
#include <assert.h>
/* Exported globals. */
bfd_boolean mclex_want_nl = FALSE;
bfd_boolean mclex_want_line = FALSE;
bfd_boolean mclex_want_filename = FALSE;
/* Local globals. */
static unichar *input_stream = NULL;
static unichar *input_stream_pos = NULL;
static int input_line = 1;
static const char *input_filename = NULL;
void
mc_set_content (const unichar *src)
{
if (!src)
return;
input_stream = input_stream_pos = unichar_dup (src);
}
void
mc_set_inputfile (const char *name)
{
if (! name || *name == 0)
input_filename = "-";
else
{
const char *s1 = strrchr (name, '/');
const char *s2 = strrchr (name, '\\');
if (! s1)
s1 = s2;
if (s1 && s2 && s1 < s2)
s1 = s2;
if (! s1)
s1 = name;
else
s1++;
s1 = xstrdup (s1);
input_filename = s1;
}
}
static void
show_msg (const char *kind, const char *msg, va_list argp)
{
fprintf (stderr, "In %s at line %d: %s: ", input_filename, input_line, kind);
vfprintf (stderr, msg, argp);
fprintf (stderr, ".\n");
}
void
mc_warn (const char *s, ...)
{
va_list argp;
va_start (argp, s);
show_msg ("warning", s, argp);
va_end (argp);
}
void
mc_fatal (const char *s, ...)
{
va_list argp;
va_start (argp, s);
show_msg ("fatal", s, argp);
va_end (argp);
xexit (1);
}
int
yyerror (const char *s, ...)
{
va_list argp;
va_start (argp, s);
show_msg ("parser", s, argp);
va_end (argp);
return 1;
}
static unichar *
get_diff (unichar *end, unichar *start)
{
unichar *ret;
unichar save = *end;
*end = 0;
ret = unichar_dup (start);
*end = save;
return ret;
}
static rc_uint_type
parse_digit (unichar ch)
{
rc_uint_type base = 10, v = 0, c;
if (ch == '0')
{
base = 8;
switch (input_stream_pos[0])
{
case 'x': case 'X': base = 16; input_stream_pos++; break;
case 'o': case 'O': base = 8; input_stream_pos++; break;
case 'b': case 'B': base = 2; input_stream_pos++; break;
}
}
else
v = (rc_uint_type) (ch - '0');
while ((ch = input_stream_pos[0]) != 0)
{
if (ch >= 'A' && ch <= 'F')
c = (rc_uint_type) (ch - 'A') + 10;
else if (ch >= 'a' && ch <= 'f')
c = (rc_uint_type) (ch - 'a') + 10;
else if (ch >= '0' && ch <= '9')
c = (rc_uint_type) (ch - '0');
else
break;
v *= base;
v += c;
++input_stream_pos;
}
if (input_stream_pos[0] == 'U' || input_stream_pos[0] == 'u')
input_stream_pos++;
if (input_stream_pos[0] == 'L' || input_stream_pos[0] == 'l')
input_stream_pos++;
if (input_stream_pos[0] == 'L' || input_stream_pos[0] == 'l')
input_stream_pos++;
return v;
}
static mc_keyword *keyword_top = NULL;
const mc_keyword *
enum_facility (int e)
{
mc_keyword *h = keyword_top;
while (h != NULL)
{
while (h && strcmp (h->group_name, "facility") != 0)
h = h->next;
if (e == 0)
return h;
--e;
if (h)
h = h->next;
}
return h;
}
const mc_keyword *
enum_severity (int e)
{
mc_keyword *h = keyword_top;
while (h != NULL)
{
while (h && strcmp (h->group_name, "severity") != 0)
h = h->next;
if (e == 0)
return h;
--e;
if (h)
h = h->next;
}
return h;
}
static void
mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv)
{
unichar *usz, *usv = NULL;
rc_uint_type usz_len;
unicode_from_codepage (&usz_len, &usz, sz, CP_ACP);
if (sv)
unicode_from_codepage (&usz_len, &usv, sv, CP_ACP);
mc_add_keyword (usz, rid, grp, nv, usv);
}
void
mc_add_keyword (unichar *usz, int rid, const char *grp, rc_uint_type nv, unichar *sv)
{
mc_keyword *p, *c, *n;
size_t len = unichar_len (usz);
c = keyword_top;
p = NULL;
while (c != NULL)
{
if (c->len > len)
break;
if (c->len == len)
{
int e = memcmp (usz, c->usz, len * sizeof (unichar));
if (e < 0)
break;
if (! e)
{
if (! strcmp (grp, "keyword") || strcmp (c->group_name, grp) != 0)
fatal (_("Duplicate symbol entered into keyword list."));
c->rid = rid;
c->nval = nv;
c->sval = (!sv ? NULL : unichar_dup (sv));
if (! strcmp (grp, "language"))
{
const wind_language_t *lag = wind_find_language_by_id ((unsigned) nv);
if (lag == NULL)
fatal ("Language ident 0x%lx is not resolvable.\n", (long) nv);
memcpy (&c->lang_info, lag, sizeof (*lag));
}
return;
}
}
c = (p = c)->next;
}
n = xmalloc (sizeof (mc_keyword));
n->next = c;
n->len = len;
n->group_name = grp;
n->usz = usz;
n->rid = rid;
n->nval = nv;
n->sval = (!sv ? NULL : unichar_dup (sv));
if (! strcmp (grp, "language"))
{
const wind_language_t *lag = wind_find_language_by_id ((unsigned) nv);
if (lag == NULL)
fatal ("Language ident 0x%lx is not resolvable.\n", (long) nv);
memcpy (&n->lang_info, lag, sizeof (*lag));
}
if (! p)
keyword_top = n;
else
p->next = n;
}
static int
mc_token (const unichar *t, size_t len)
{
static int was_init = 0;
mc_keyword *k;
if (! was_init)
{
was_init = 1;
mc_add_keyword_ascii ("OutputBase", MCOUTPUTBASE, "keyword", 0, NULL);
mc_add_keyword_ascii ("MessageIdTypedef", MCMESSAGEIDTYPEDEF, "keyword", 0, NULL);
mc_add_keyword_ascii ("SeverityNames", MCSEVERITYNAMES, "keyword", 0, NULL);
mc_add_keyword_ascii ("FacilityNames", MCFACILITYNAMES, "keyword", 0, NULL);
mc_add_keyword_ascii ("LanguageNames", MCLANGUAGENAMES, "keyword", 0, NULL);
mc_add_keyword_ascii ("MessageId", MCMESSAGEID, "keyword", 0, NULL);
mc_add_keyword_ascii ("Severity", MCSEVERITY, "keyword", 0, NULL);
mc_add_keyword_ascii ("Facility", MCFACILITY, "keyword", 0, NULL);
mc_add_keyword_ascii ("SymbolicName", MCSYMBOLICNAME, "keyword", 0, NULL);
mc_add_keyword_ascii ("Language", MCLANGUAGE, "keyword", 0, NULL);
mc_add_keyword_ascii ("Success", MCTOKEN, "severity", 0, NULL);
mc_add_keyword_ascii ("Informational", MCTOKEN, "severity", 1, NULL);
mc_add_keyword_ascii ("Warning", MCTOKEN, "severity", 2, NULL);
mc_add_keyword_ascii ("Error", MCTOKEN, "severity", 3, NULL);
mc_add_keyword_ascii ("System", MCTOKEN, "facility", 0xff, NULL);
mc_add_keyword_ascii ("Application", MCTOKEN, "facility", 0xfff, NULL);
mc_add_keyword_ascii ("English", MCTOKEN, "language", 0x409, "MSG00001");
}
k = keyword_top;
if (!len || !t || *t == 0)
return -1;
while (k != NULL)
{
if (k->len > len)
break;
if (k->len == len)
{
if (! memcmp (k->usz, t, len * sizeof (unichar)))
{
if (k->rid == MCTOKEN)
yylval.tok = k;
return k->rid;
}
}
k = k->next;
}
return -1;
}
int
yylex (void)
{
unichar *start_token;
unichar ch;
if (! input_stream_pos)
{
fatal ("Input stream not setuped.\n");
return -1;
}
if (mclex_want_line)
{
start_token = input_stream_pos;
if (input_stream_pos[0] == '.'
&& (input_stream_pos[1] == '\n'
|| (input_stream_pos[1] == '\r' && input_stream_pos[2] == '\n')))
{
mclex_want_line = FALSE;
while (input_stream_pos[0] != 0 && input_stream_pos[0] != '\n')
++input_stream_pos;
if (input_stream_pos[0] == '\n')
++input_stream_pos;
return MCENDLINE;
}
while (input_stream_pos[0] != 0 && input_stream_pos[0] != '\n')
++input_stream_pos;
if (input_stream_pos[0] == '\n')
++input_stream_pos;
yylval.ustr = get_diff (input_stream_pos, start_token);
return MCLINE;
}
while ((ch = input_stream_pos[0]) <= 0x20)
{
if (ch == 0)
return -1;
++input_stream_pos;
if (ch == '\n')
input_line += 1;
if (mclex_want_nl && ch == '\n')
{
mclex_want_nl = FALSE;
return NL;
}
}
start_token = input_stream_pos;
++input_stream_pos;
if (mclex_want_filename)
{
mclex_want_filename = FALSE;
if (ch == '"')
{
start_token++;
while ((ch = input_stream_pos[0]) != 0)
{
if (ch == '"')
break;
++input_stream_pos;
}
yylval.ustr = get_diff (input_stream_pos, start_token);
if (ch == '"')
++input_stream_pos;
}
else
{
while ((ch = input_stream_pos[0]) != 0)
{
if (ch <= 0x20 || ch == ')')
break;
++input_stream_pos;
}
yylval.ustr = get_diff (input_stream_pos, start_token);
}
return MCFILENAME;
}
switch (ch)
{
case ';':
++start_token;
while (input_stream_pos[0] != '\n' && input_stream_pos[0] != 0)
++input_stream_pos;
if (input_stream_pos[0] == '\n')
input_stream_pos++;
yylval.ustr = get_diff (input_stream_pos, start_token);
return MCCOMMENT;
case '=':
return '=';
case '(':
return '(';
case ')':
return ')';
case '+':
return '+';
case ':':
return ':';
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
yylval.ival = parse_digit (ch);
return MCNUMBER;
default:
if (ch >= 0x40)
{
int ret;
while (input_stream_pos[0] >= 0x40 || (input_stream_pos[0] >= '0' && input_stream_pos[0] <= '9'))
++input_stream_pos;
ret = mc_token (start_token, (size_t) (input_stream_pos - start_token));
if (ret != -1)
return ret;
yylval.ustr = get_diff (input_stream_pos, start_token);
return MCIDENT;
}
yyerror ("illegal character 0x%x.", ch);
}
return -1;
}

356
binutils/mcparse.y Normal file
View File

@ -0,0 +1,356 @@
%{ /* mcparse.y -- parser for Windows mc files
Copyright 2007
Free Software Foundation, Inc.
Parser for Windows mc files
Written by Kai Tietz, Onevision.
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 2 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. */
/* This is a parser for Windows rc files. It is based on the parser
by Gunther Ebert <gunther.ebert@ixos-leipzig.de>. */
#include "sysdep.h"
#include "bfd.h"
#include "bucomm.h"
#include "libiberty.h"
#include "windmc.h"
#include "safe-ctype.h"
static rc_uint_type mc_last_id = 0;
static rc_uint_type mc_sefa_val = 0;
static unichar *mc_last_symbol = NULL;
static const mc_keyword *mc_cur_severity = NULL;
static const mc_keyword *mc_cur_facility = NULL;
static mc_node *cur_node = NULL;
%}
%union
{
rc_uint_type ival;
unichar *ustr;
const mc_keyword *tok;
mc_node *nod;
};
%start input
%token NL
%token<ustr> MCIDENT MCFILENAME MCLINE MCCOMMENT
%token<tok> MCTOKEN
%token MCENDLINE
%token MCLANGUAGENAMES MCFACILITYNAMES MCSEVERITYNAMES MCOUTPUTBASE MCMESSAGEIDTYPEDEF
%token MCLANGUAGE MCMESSAGEID MCSEVERITY MCFACILITY MCSYMBOLICNAME
%token <ival> MCNUMBER
%type<ival> id vid sefasy_def
%type<ustr> alias_name token lines comments
%type<tok> lang
%%
input: entities
;
entities:
/* empty */
| entities entity
;
entity: global_section
| message
| comments
{
cur_node = mc_add_node ();
cur_node->user_text = $1;
}
| error { mc_fatal ("syntax error"); }
;
global_section:
MCSEVERITYNAMES '=' '(' severitymaps ')'
| MCSEVERITYNAMES '=' '(' severitymaps error { mc_fatal ("missing ')' in SeverityNames"); }
| MCSEVERITYNAMES '=' error { mc_fatal ("missing '(' in SeverityNames"); }
| MCSEVERITYNAMES error { mc_fatal ("missing '=' for SeverityNames"); }
| MCLANGUAGENAMES '=' '(' langmaps ')'
| MCLANGUAGENAMES '=' '(' langmaps error { mc_fatal ("missing ')' in LanguageNames"); }
| MCLANGUAGENAMES '=' error { mc_fatal ("missing '(' in LanguageNames"); }
| MCLANGUAGENAMES error { mc_fatal ("missing '=' for LanguageNames"); }
| MCFACILITYNAMES '=' '(' facilitymaps ')'
| MCFACILITYNAMES '=' '(' facilitymaps error { mc_fatal ("missing ')' in FacilityNames"); }
| MCFACILITYNAMES '=' error { mc_fatal ("missing '(' in FacilityNames"); }
| MCFACILITYNAMES error { mc_fatal ("missing '=' for FacilityNames"); }
| MCOUTPUTBASE '=' MCNUMBER
{
if ($3 != 10 && $3 != 16)
mc_fatal ("OutputBase allows 10 or 16 as value");
mcset_out_values_are_decimal = ($3 == 10 ? 1 : 0);
}
| MCMESSAGEIDTYPEDEF '=' MCIDENT
{
mcset_msg_id_typedef = $3;
}
| MCMESSAGEIDTYPEDEF '=' error
{
mc_fatal ("MessageIdTypedef expects an identifier");
}
| MCMESSAGEIDTYPEDEF error
{
mc_fatal ("missing '=' for MessageIdTypedef");
}
;
severitymaps:
severitymap
| severitymaps severitymap
| error { mc_fatal ("severity ident missing"); }
;
severitymap:
token '=' MCNUMBER alias_name
{
mc_add_keyword ($1, MCTOKEN, "severity", $3, $4);
}
| token '=' error { mc_fatal ("severity number missing"); }
| token error { mc_fatal ("severity missing '='"); }
;
facilitymaps:
facilitymap
| facilitymaps facilitymap
| error { mc_fatal ("missing ident in FacilityNames"); }
;
facilitymap:
token '=' MCNUMBER alias_name
{
mc_add_keyword ($1, MCTOKEN, "facility", $3, $4);
}
| token '=' error { mc_fatal ("facility number missing"); }
| token error { mc_fatal ("facility missing '='"); }
;
langmaps:
langmap
| langmaps langmap
| error { mc_fatal ("missing ident in LanguageNames"); }
;
langmap:
token '=' MCNUMBER lex_want_filename ':' MCFILENAME
{
mc_add_keyword ($1, MCTOKEN, "language", $3, $6);
}
| token '=' MCNUMBER lex_want_filename ':' error { mc_fatal ("missing filename in LanguageNames"); }
| token '=' MCNUMBER error { mc_fatal ("missing ':' in LanguageNames"); }
| token '=' error { mc_fatal ("missing language code in LanguageNames"); }
| token error { mc_fatal ("missing '=' for LanguageNames"); }
;
alias_name:
/* empty */
{
$$ = NULL;
}
| ':' MCIDENT
{
$$ = $2;
}
| ':' error { mc_fatal ("illegal token in identifier"); $$ = NULL; }
;
message:
id sefasy_def
{
cur_node = mc_add_node ();
cur_node->symbol = mc_last_symbol;
cur_node->facility = mc_cur_facility;
cur_node->severity = mc_cur_severity;
cur_node->id = ($1 & 0xffffUL);
cur_node->vid = ($1 & 0xffffUL) | mc_sefa_val;
mc_last_id = $1;
}
lang_entities
;
id: MCMESSAGEID '=' vid { $$ = $3; }
| MCMESSAGEID '=' error { mc_fatal ("missing number in MessageId"); $$ = 0; }
| MCMESSAGEID error { mc_fatal ("missing '=' for MessageId"); $$ = 0; }
;
vid: /* empty */
{
$$ = ++mc_last_id;
}
| MCNUMBER
{
$$ = $1;
}
| '+' MCNUMBER
{
$$ = mc_last_id + $2;
}
| '+' error { mc_fatal ("missing number after MessageId '+'"); }
;
sefasy_def:
/* empty */
{
$$ = 0;
mc_sefa_val = (mcset_custom_bit ? 1 : 0) << 29;
mc_last_symbol = NULL;
mc_cur_severity = NULL;
mc_cur_facility = NULL;
}
| sefasy_def severity
{
if ($1 & 1)
mc_warn (_("duplicate definition of Severity"));
$$ = $1 | 1;
}
| sefasy_def facility
{
if ($1 & 2)
mc_warn (_("duplicate definition of Facility"));
$$ = $1 | 2;
}
| sefasy_def symbol
{
if ($1 & 4)
mc_warn (_("duplicate definition of SymbolicName"));
$$ = $1 | 4;
}
;
severity: MCSEVERITY '=' MCTOKEN
{
mc_sefa_val &= ~ (0x3UL << 30);
mc_sefa_val |= (($3->nval & 0x3UL) << 30);
mc_cur_severity = $3;
}
;
facility: MCFACILITY '=' MCTOKEN
{
mc_sefa_val &= ~ (0xfffUL << 16);
mc_sefa_val |= (($3->nval & 0xfffUL) << 16);
mc_cur_facility = $3;
}
;
symbol: MCSYMBOLICNAME '=' MCIDENT
{
mc_last_symbol = $3;
}
;
lang_entities:
lang_entity
| lang_entities lang_entity
;
lang_entity:
lang lex_want_line lines MCENDLINE
{
mc_node_lang *h;
h = mc_add_node_lang (cur_node, $1, cur_node->vid);
h->message = $3;
if (mcset_max_message_length != 0 && unichar_len (h->message) > mcset_max_message_length)
mc_warn ("message length to long");
}
;
lines: MCLINE
{
$$ = $1;
}
| lines MCLINE
{
unichar *h;
rc_uint_type l1,l2;
l1 = unichar_len ($1);
l2 = unichar_len ($2);
h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar));
if (l1) memcpy (h, $1, l1 * sizeof (unichar));
if (l2) memcpy (&h[l1], $2, l2 * sizeof (unichar));
h[l1 + l2] = 0;
$$ = h;
}
| error { mc_fatal ("missing end of message text"); $$ = NULL; }
| lines error { mc_fatal ("missing end of message text"); $$ = $1; }
;
comments: MCCOMMENT { $$ = $1; }
| comments MCCOMMENT
{
unichar *h;
rc_uint_type l1,l2;
l1 = unichar_len ($1);
l2 = unichar_len ($2);
h = (unichar *) res_alloc ((l1 + l2 + 1) * sizeof (unichar));
if (l1) memcpy (h, $1, l1 * sizeof (unichar));
if (l2) memcpy (&h[l1], $2, l2 * sizeof (unichar));
h[l1 + l2] = 0;
$$ = h;
}
;
lang: MCLANGUAGE lex_want_nl '=' MCTOKEN NL
{
$$ = $4;
}
| MCLANGUAGE lex_want_nl '=' MCIDENT NL
{
$$ = NULL;
mc_fatal (_("undeclared language identifier"));
}
| MCLANGUAGE lex_want_nl '=' token error
{
$$ = NULL;
mc_fatal ("missing newline after Language");
}
| MCLANGUAGE lex_want_nl '=' error
{
$$ = NULL;
mc_fatal ("missing ident for Language");
}
| MCLANGUAGE error
{
$$ = NULL;
mc_fatal ("missing '=' for Language");
}
;
token: MCIDENT { $$ = $1; }
| MCTOKEN { $$ = $1->usz; }
;
lex_want_nl:
/* Empty */ { mclex_want_nl = 1; }
;
lex_want_line:
/* Empty */ { mclex_want_line = 1; }
;
lex_want_filename:
/* Empty */ { mclex_want_filename = 1; }
;
%%
/* Something else. */

1197
binutils/windmc.c Normal file

File diff suppressed because it is too large Load Diff

99
binutils/windmc.h Normal file
View File

@ -0,0 +1,99 @@
/* windmc.h -- header file for windmc program.
Copyright 2007
Free Software Foundation, Inc.
Written by Kai Tietz, Onevision.
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 2 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. */
#include "ansidecl.h"
/* This is the header file for the windmc program. It defines
structures and declares functions used within the program. */
#include "winduni.h"
#ifndef WINDMC_HXX
#define WINDMC_HXX
/* Global flag variables (set by windmc.c file. */
extern int mcset_custom_bit;
extern int mcset_out_values_are_decimal;
extern rc_uint_type mcset_max_message_length;
extern unichar *mcset_msg_id_typedef;
/* Lexer keyword definition and internal memory structures. */
typedef struct mc_keyword
{
struct mc_keyword *next;
const char *group_name;
size_t len;
unichar *usz;
int rid;
rc_uint_type nval;
unichar *sval;
wind_language_t lang_info;
} mc_keyword;
typedef struct mc_node_lang
{
struct mc_node_lang *next;
rc_uint_type vid;
const mc_keyword *lang;
unichar *message;
} mc_node_lang;
typedef struct mc_node
{
struct mc_node *next;
unichar *user_text;
const mc_keyword *facility;
const mc_keyword *severity;
unichar *symbol;
rc_uint_type id;
rc_uint_type vid;
mc_node_lang *sub;
} mc_node;
extern mc_node *mc_nodes;
void mc_add_keyword (unichar *, int, const char *, rc_uint_type, unichar *);
const mc_keyword *enum_facility (int);
const mc_keyword *enum_severity (int);
mc_node_lang *mc_add_node_lang (mc_node *, const mc_keyword *, rc_uint_type);
mc_node *mc_add_node (void);
/* Standard yacc/flex stuff. */
int yyerror (const char *, ...);
int yylex (void);
int yyparse (void);
/* mclex.c */
void mc_set_inputfile (const char *);
void mc_set_content (const unichar *);
/* Lexer control variables. Used by mcparser.y file. */
extern bfd_boolean mclex_want_nl;
extern bfd_boolean mclex_want_line;
extern bfd_boolean mclex_want_filename;
void mc_fatal (const char *, ...);
void mc_warn (const char *, ...);
#endif