From b46f4955dd2e46ac0fb2ae46eba28878fadfc543 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 2 Aug 2018 23:33:18 +0200 Subject: [PATCH] Use `gnulib' in LGPL mode. This allows ttfautohint + gnulib as a shared library to be linked with non-GPLed code. --- COPYING | 2 +- bootstrap.conf | 6 ++++-- frontend/info.cpp | 11 +++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/COPYING b/COPYING index 9d8fe14..c4a0c21 100644 --- a/COPYING +++ b/COPYING @@ -63,7 +63,7 @@ All files of the following directories are distributed with the source bundle of the ttfautohint library to configure and build the library with GNU tools, but which aren't part of it due to a different license. - GPL only: + LGPL only: gnulib EOF diff --git a/bootstrap.conf b/bootstrap.conf index aa91eb9..7fd48be 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -27,13 +27,12 @@ checkout_only_file=INSTALL.git # gnulib modules used by this package. gnulib_modules=" - dirname + dirname-lgpl fcntl-h getopt-gnu git-version-gen isatty memmem-simple - progname stdarg stdbool stdint @@ -45,6 +44,9 @@ gnulib_modules=" vasprintf " +gnulib_tool_option_extras="--lgpl" + + # Additional xgettext options to use. Use "\\\newline" to break lines. XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\ --from-code=UTF-8\\\ diff --git a/frontend/info.cpp b/frontend/info.cpp index 69bb680..d480064 100644 --- a/frontend/info.cpp +++ b/frontend/info.cpp @@ -15,8 +15,9 @@ #include #include #include -// the next header file is from gnulib defining function `base_name', -// which is a replacement for `basename' that works on Windows also +// the next header file is from gnulib defining function `last_component', +// which is a replacement for `basename' (but just returning a pointer +// without allocating a string) that works on Windows also #include "dirname.h" #include "info.h" @@ -99,15 +100,13 @@ build_version_string(Info_Data* idata) d = sdscatprintf(d, " -f %s", idata->fallback_script); if (idata->control_name) { - char* bn = base_name(idata->control_name); + char* bn = last_component(idata->control_name); d = sdscatprintf(d, " -m \"%s\"", bn ? bn : idata->control_name); - free(bn); } if (idata->reference_name) { - char* bn = base_name(idata->reference_name); + char* bn = last_component(idata->reference_name); d = sdscatprintf(d, " -R \"%s\"", bn ? bn : idata->reference_name); - free(bn); d = sdscatprintf(d, " -Z %d", idata->reference_index); } -- 2.11.4.GIT