# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.\n"""
- return constants.nlconvert(emit)
+ return emit
def autoconfSnippet(self, module, toplevel,
disable_libtool, disable_gettext, replace_auxdir, indentation):
Emit the contents of po/ makefile parameterization.
GLConfig: pobase, podomain.'''
- emit = ''
pobase = self.config['pobase']
podomain = self.config['podomain']
- top_subdir = relinverse(pobase)
+ emit = ''
emit += "## DO NOT EDIT! GENERATED AUTOMATICALLY!\n"
emit += "%s\n" % self.copyright_notice()
emit += "# Usually the message domain is the same as the package name.\n"
emit += "DOMAIN = %s-gnulib\n\n" % podomain
emit += "# These two variables depend on the location of this directory.\n"
emit += "subdir = %s\n" % pobase
- emit += "top_subdir = %s\n" % top_subdir
+ emit += "top_builddir = %s\n" % relinverse(pobase)
emit += """
# These options get passed to xgettext.
XGETTEXT_OPTIONS = \\
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no\n"""
- return constants.nlconvert(emit)
+ return emit
def po_POTFILES_in(self, files):
'''GLEmiter.po_POTFILES_in(files) -> str
Emit the file list to be passed to xgettext.
GLConfig: sourcebase.'''
- emit = ''
sourcebase = self.config['sourcebase'] + os.path.sep
- files = [ constants.substart('lib/', sourcebase, file)
- for file in files ]
- files = [ file
- for file in files
- if file.startswith(sourcebase) ]
+ emit = ''
emit += "## DO NOT EDIT! GENERATED AUTOMATICALLY!\n"
emit += "%s\n" % self.copyright_notice()
emit += "# List of files which contain translatable strings.\n"
- emit += '\n'.join(files)
- emit += '\n'
- return constants.nlconvert(emit)
+ for file in files:
+ if file.startswith('lib/'):
+ emit += '%s\n' % constants.substart('lib/', sourcebase, file)
+ return emit
def initmacro_start(self, macro_prefix_arg):
'''GLEmiter.initmacro_start(macro_prefix_arg) -> str
Emit the first few statements of the gl_INIT macro.'''
- emit = ''
if type(macro_prefix_arg) is not str:
raise TypeError('macro_prefix_arg must be a string, not %s'
% type(macro_prefix_arg).__name__)
module_indicator_prefix = self.config.getModuleIndicatorPrefix()
+ emit = ''
# Overriding AC_LIBOBJ and AC_REPLACE_FUNCS has the effect of storing
# platform-dependent object files in ${macro_prefix_arg}_LIBOBJS instead
# of LIBOBJS. The purpose is to allow several gnulib instantiations under
# flexibility).
# Furthermore it avoids an automake error like this when a Makefile.am
# that uses pieces of gnulib also uses $(LIBOBJ):
- # automatically discovered file `error.c' should not be explicitly
- # mentioned.
- emit += " m4_pushdef([AC_LIBOBJ],"
- emit += " m4_defn([%V1%_LIBOBJ]))\n"
- emit += " m4_pushdef([AC_REPLACE_FUNCS],"
- emit += " m4_defn([%V1%_REPLACE_FUNCS]))\n"
+ # automatically discovered file `error.c' should not be explicitly mentioned.
+ emit += " m4_pushdef([AC_LIBOBJ], m4_defn([%s_LIBOBJ]))\n" % macro_prefix_arg
+ emit += " m4_pushdef([AC_REPLACE_FUNCS], m4_defn([%s_REPLACE_FUNCS]))\n" % macro_prefix_arg
# Overriding AC_LIBSOURCES has the same purpose of avoiding the automake
# error when a Makefile.am that uses pieces of gnulib also uses $(LIBOBJ):
- # automatically discovered file `error.c' should not be explicitly
- # mentioned
+ # automatically discovered file `error.c' should not be explicitly mentioned
# We let automake know about the files to be distributed through the
# EXTRA_lib_SOURCES variable.
- emit += " m4_pushdef([AC_LIBSOURCES],"
- emit += " m4_defn([%V1%_LIBSOURCES]))\n"
+ emit += " m4_pushdef([AC_LIBSOURCES], m4_defn([%s_LIBSOURCES]))\n" % macro_prefix_arg
# Create data variables for checking the presence of files that are
# mentioned as AC_LIBSOURCES arguments. These are m4 variables, not shell
# variables, because we want the check to happen when the configure file is
# created, not when it is run. ${macro_prefix_arg}_LIBSOURCES_LIST is the
# list of files to check for. ${macro_prefix_arg}_LIBSOURCES_DIR is the
# subdirectory in which to expect them.
- emit += " m4_pushdef([%V1%_LIBSOURCES_LIST], [])\n"
- emit += " m4_pushdef([%V1%_LIBSOURCES_DIR], [])\n"
+ emit += " m4_pushdef([%s_LIBSOURCES_LIST], [])\n" % macro_prefix_arg
+ emit += " m4_pushdef([%s_LIBSOURCES_DIR], [])\n" % macro_prefix_arg
# Scope for m4 macros.
- emit += " m4_pushdef([GL_MACRO_PREFIX], [%V1%])"
+ emit += " m4_pushdef([GL_MACRO_PREFIX], [%s])\n" % macro_prefix_arg
# Scope the GNULIB_<modulename> variables.
- emit += " m4_pushdef([GL_MODULE_INDICATOR_PREFIX],"
- emit += " [" + module_indicator_prefix + "])"
+ emit += " m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [%s])\n" % module_indicator_prefix
emit += " gl_COMMON\n"
- emit = emit.replace('%V1%', macro_prefix_arg)
- return constants.nlconvert(emit)
+ return emit
def initmacro_end(self, macro_prefix_arg):
'''GLEmiter.initmacro_end(macro_prefix_arg) -> str
Emit the last few statements of the gl_INIT macro.'''
- emit = ''
if type(macro_prefix_arg) is not str:
raise TypeError('macro_prefix_arg must be a string, not %s'
% type(macro_prefix_arg).__name__)
+ emit = ''
# Check the presence of files that are mentioned as AC_LIBSOURCES
# arguments. The check is performed only when autoconf is run from the
# directory where the configure.ac resides; if it is run from a different
AC_SUBST([%V1%_LTLIBOBJS], [$%V1%_ltlibobjs])
])\n"""
emit = emit.replace('%V1%', macro_prefix_arg)
- return constants.nlconvert(emit)
+ return emit
def initmacro_done(self, macro_prefix_arg, sourcebase_arg):
'''GLEmiter.initmacro_done(macro_prefix_arg, sourcebase_arg) -> str
Emit a few statements after the gl_INIT macro.
GLConfig: sourcebase.'''
- emit = ''
if type(macro_prefix_arg) is not str:
raise TypeError('macro_prefix_arg must be a string, not %s'
% type(macro_prefix_arg).__name__)
if type(sourcebase_arg) is not str:
raise TypeError('sourcebase_arg must be a string, not %s'
% type(sourcebase_arg).__name__)
+ emit = ''
emit += """\
# Like AC_LIBOBJ, except that the module name goes
])\n"""
emit = emit.replace('%V1%', macro_prefix_arg)
emit = emit.replace('%V2%', sourcebase_arg)
- return constants.nlconvert(emit)
+ return emit
def lib_Makefile_am(self, destfile, modules,
moduletable, makefiletable, actioncmd, for_test):
if type(for_test) is not bool:
raise TypeError('for_test must be a bool, not %s'
% type(for_test).__name__)
- emit = ''
sourcebase = self.config['sourcebase']
libname = self.config['libname']
pobase = self.config['pobase']
module_indicator_prefix = self.config.getModuleIndicatorPrefix()
ac_version = self.config['ac_version']
destfile = os.path.normpath(destfile)
+ emit = ''
# When creating an includable Makefile.am snippet, augment variables with
# += instead of assigning them.
if type(for_test) is not bool:
raise TypeError('for_test must be a bool, not %s'
% type(for_test).__name__)
- emit = ''
auxdir = self.config['auxdir']
sourcebase = self.config['sourcebase']
libname = self.config['libname']
ac_version = self.config['ac_version']
libtests = self.config['libtests']
single_configure = self.config['single_configure']
+ emit = ''
if libtool:
libext = 'la'