gl/m4/gnulib-cache.m4
author J. Ali Harlow <ali@juiblex.co.uk>
Sat Oct 04 18:12:58 2014 +0100 (2014-10-04)
changeset 454 56ff755c268c
parent 438 fab0b8a61dcb
permissions -rw-r--r--
Only export symbols starting with razor_ in dynamic library.

Apart from being good practice to avoid clashes with higher-level
libraries and the application, this also fixes an obscure bug: The
gnulib library is used both by librazor (the dynamic library) and
by razor (the executable). In doing so, we want to have two separate
copies of the library despite the code duplication this involves.
Without the explicit limit to export only razor_ symbols, the razor
executable under mingw64 was picking up the getopt_long function
from librazor and the optind variable from libgnu which meant that
it did not see optind changing. Hiding librazor's copy of getopt
causes the linker to find libgnu's copy and everything works.

Note that under mingw librazor-#.dll still contains undocumented
(private) razor_ symbols but these will do no harm as long as nobody
tries to use them.
     1 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
     2 #
     3 # This file is free software; you can redistribute it and/or modify
     4 # it under the terms of the GNU General Public License as published by
     5 # the Free Software Foundation; either version 3 of the License, or
     6 # (at your option) any later version.
     7 #
     8 # This file is distributed in the hope that it will be useful,
     9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11 # GNU General Public License for more details.
    12 #
    13 # You should have received a copy of the GNU General Public License
    14 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
    15 #
    16 # As a special exception to the GNU General Public License,
    17 # this file may be distributed as part of a program that
    18 # contains a configuration script generated by Autoconf, under
    19 # the same distribution terms as the rest of that program.
    20 #
    21 # Generated by gnulib-tool.
    22 #
    23 # This file represents the specification of how gnulib-tool is used.
    24 # It acts as a cache: It is written and read by gnulib-tool.
    25 # In projects that use version control, this file is meant to be put under
    26 # version control, like the configure.ac and various Makefile.am files.
    27 
    28 
    29 # Specification in the form of a command-line invocation:
    30 #   gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --libtool --macro-prefix=gl fnmatch fnmatch-posix fsync getopt-gnu mkdir mkdtemp
    31 
    32 # Specification in the form of a few gnulib-tool.m4 macro invocations:
    33 gl_LOCAL_DIR([])
    34 gl_MODULES([
    35   fnmatch
    36   fnmatch-posix
    37   fsync
    38   getopt-gnu
    39   mkdir
    40   mkdtemp
    41 ])
    42 gl_AVOID([])
    43 gl_SOURCE_BASE([gl])
    44 gl_M4_BASE([gl/m4])
    45 gl_PO_BASE([])
    46 gl_DOC_BASE([doc])
    47 gl_TESTS_BASE([tests])
    48 gl_LIB([libgnu])
    49 gl_MAKEFILE_NAME([])
    50 gl_LIBTOOL
    51 gl_MACRO_PREFIX([gl])
    52 gl_PO_DOMAIN([])
    53 gl_WITNESS_C_MACRO([])