diff --git a/COPYING b/COPYING index 1947b344..be3cec08 100644 --- a/COPYING +++ b/COPYING @@ -1,27 +1,39 @@ +Yasm is Copyright (c) 2001-2006 Peter Johnson and other Yasm developers. + +Yasm developers and/or contributors include: + Peter Johnson + Michael Urman + Stanislav Karchebny + Brian Gladman + ----------------------------------- -YASM licensing overview and summary +Yasm licensing overview and summary ----------------------------------- -Note: This document does not provide legal advice nor is it the actual license -of any part of YASM. See the individual licenses for complete details. -Consult a laywer for legal advice. +Note: This document does not provide legal advice nor is it the actual +license of any part of Yasm. See the individual licenses for complete +details. Consult a lawyer for legal advice. -The primary license of YASM is the 2-clause BSD license. Please use this +The primary license of Yasm is the 2-clause BSD license. Please use this license if you plan on submitting code to the project. +Yasm has absolutely no warranty; not even for merchantibility or fitness +for a particular purpose. + ------- Libyasm ------- -Libyasm is 2-clause or 3-clause BSD licensed, with the exception of bitvect, -which is triple-licensed under the Artistic license, GPL, and LGPL. Libyasm -is thus GPL and LGPL compatible. In addition, this also means that libyasm -is free for binary-only distribution as long as the terms of the 3-clause BSD -license and Artistic license (as it applies to bitvect) are fulfilled. +Libyasm is 2-clause or 3-clause BSD licensed, with the exception of +bitvect, which is triple-licensed under the Artistic license, GPL, and +LGPL. Libyasm is thus GPL and LGPL compatible. In addition, this also +means that libyasm is free for binary-only distribution as long as the +terms of the 3-clause BSD license and Artistic license (as it applies to +bitvect) are fulfilled. ------- Modules ------- -Most of the modules are 2-clause BSD licensed, with the exception of: +The modules are 2-clause or 3-clause BSD licensed, with the exception of: preprocs/nasm - LGPL licensed --------- @@ -32,9 +44,10 @@ The frontends are 2-clause BSD licensed. ------------- License Texts ------------- -The full text of all licenses are provided in separate files in this -distribution. Each file may include the entire license (in the case of the BSD -and Artistic licenses), or may reference the GPL or LGPL license file. +The full text of all licenses are provided in separate files in the source +distribution. Each source file may include the entire license (in the case +of the BSD and Artistic licenses), or may reference the GPL or LGPL license +file. BSD.txt - 2-clause and 3-clause BSD licenses Artistic.txt - Artistic license diff --git a/Makefile.am b/Makefile.am index bec47ba4..f1c46d6b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ AM_CFLAGS = @MORE_CFLAGS@ bin_PROGRAMS = dist_man_MANS = TESTS = -noinst_PROGRAMS = +noinst_PROGRAMS = genstring check_PROGRAMS = test_hd @@ -19,6 +19,7 @@ include_HEADERS = libyasm.h noinst_HEADERS = util.h BUILT_SOURCES = + # configure.lineno doesn't clean up after itself? CLEANFILES = configure.lineno EXTRA_DIST = config/config.rpath @@ -106,3 +107,12 @@ if BUILD_MAN MAINTAINERCLEANFILES = $(dist_man_MANS) endif +# genstring build +genstring_SOURCES = +EXTRA_DIST += genstring.c +genstring_LDADD = genstring.$(OBJEXT) +genstring_LINK = $(CCLD_FOR_BUILD) -o $@ + +genstring.$(OBJEXT): genstring.c + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ `test -f genstring.c || echo '$(srcdir)/'`genstring.c + diff --git a/frontends/yasm/Makefile.inc b/frontends/yasm/Makefile.inc index 54311363..1e0a8362 100644 --- a/frontends/yasm/Makefile.inc +++ b/frontends/yasm/Makefile.inc @@ -12,6 +12,14 @@ yasm_SOURCES = frontends/yasm/yasm.c yasm_SOURCES += frontends/yasm/yasm-options.c yasm_SOURCES += frontends/yasm/yasm-options.h +$(srcdir)/frontends/yasm/yasm.c: license.c + +license.c: $(srcdir)/COPYING genstring$(EXEEXT) + $(top_builddir)/genstring$(EXEEXT) license_msg $@ $(srcdir)/COPYING + +BUILT_SOURCES += license.c +CLEANFILES += license.c + yasm_LDADD = libyasm.a $(INTLLIBS) EXTRA_DIST += frontends/yasm/yasm.xml diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index de31f283..b7bc7e41 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -38,6 +38,7 @@ #include "yasm-options.h" +#include "license.c" #define DEFAULT_OBJFMT_MODULE "bin" @@ -118,13 +119,16 @@ static void print_list_keyword_desc(const char *name, const char *keyword); /* values for special_options */ #define SPECIAL_SHOW_HELP 0x01 #define SPECIAL_SHOW_VERSION 0x02 -#define SPECIAL_LISTED 0x04 +#define SPECIAL_SHOW_LICENSE 0x04 +#define SPECIAL_LISTED 0x08 /* command line options */ static opt_option options[] = { { 0, "version", 0, opt_special_handler, SPECIAL_SHOW_VERSION, N_("show version text"), NULL }, + { 0, "license", 0, opt_special_handler, SPECIAL_SHOW_LICENSE, + N_("show license text"), NULL }, { 'h', "help", 0, opt_special_handler, SPECIAL_SHOW_HELP, N_("show help text"), NULL }, { 'a', "arch", 1, opt_arch_handler, 0, @@ -237,8 +241,12 @@ main(int argc, char *argv[]) help_msg(help_head, help_tail, options, NELEMS(options)); return EXIT_SUCCESS; case SPECIAL_SHOW_VERSION: - for (i=0; i +#include +#include + +#define MAXLINE 1024 + +int +main(int argc, char *argv[]) +{ + FILE *in, *out; + int i; + char *str; + char *strp; + char *charp; + size_t len; + + if (argc < 4) { + fprintf(stderr, "Usage: %s [ ...]\n", + argv[0]); + return EXIT_FAILURE; + } + + out = fopen(argv[2], "wt"); + + if (!out) { + fprintf(stderr, "Could not open `%s'.\n", argv[2]); + return EXIT_FAILURE; + } + + str = malloc(MAXLINE); + + fprintf(out, "/* This file auto-generated from %s by genstring.c" + " - don't edit it */\n\n" + "static const char *%s[] = {\n", argv[3], argv[1]); + + for (i=3; i 0 && (strp[len-1] == ' ' || strp[len-1] == '\t' || + strp[len-1] == '\n')) { + strp[len-1] = '\0'; + len--; + } + + /* output as string to output file */ + fprintf(out, " \""); + while (*strp != '\0') { + if (*strp == '\\' || *strp == '"') + fputc('\\', out); + fputc(*strp, out); + strp++; + } + fprintf(out, "\",\n"); + } + + fclose(in); + } + + fprintf(out, "};\n"); + fclose(out); + + free(str); + + return EXIT_SUCCESS; +}