Class AbstractPGXS


  • public abstract class AbstractPGXS
    extends Object
    Class to act as a blueprint for platform specific build configurations in pljava-so/pom.xml
    • Constructor Detail

      • AbstractPGXS

        public AbstractPGXS()
    • Method Detail

      • compile

        public abstract int compile​(String compiler,
                                    List<String> files,
                                    Path targetPath,
                                    List<String> includes,
                                    Map<String,​String> defines,
                                    List<String> flags)
        Add instructions for compiling the pljava-so C files on your platform by implementing this method in your configuration block.
      • link

        public abstract int link​(String linker,
                                 List<String> flags,
                                 List<String> files,
                                 Path targetPath)
        Add instructions for linking and producing the pljava-so shared library artifact on your platform by implementing this method in your configuration block.
      • formatIncludes

        public List<String> formatIncludes​(List<String> includesList)
        Returns a list with all items prefixed with correct include flag symbol. This is the default implementation for formatting the list of includes, and prefixes the includes with -I. For compilers like MSVC that require different symbols, override this method in your configuration block.
      • formatDefines

        public List<String> formatDefines​(Map<String,​String> definesMap)
        Returns a list with all defines prefixed correctly. This is the default implementation for formatting the list of defines. Each item is prefixed with -D. If the define is associated with a value, adds equal symbol also followed by the value. If your linker expects a different format, override the method in your configuration block.
      • getPgConfigPropertyAsList

        public List<String> getPgConfigPropertyAsList​(String properties)
        Returns the input pg_config property as a list of individual flags split at whitespace, except when quoted, and the quotes removed.

        The assumed quoting convention is single straight quotes around regions to be protected, which do not have to be the entire argument. This method doesn't handle a value that contains a single quote as content; the intended convention for that case doesn't seem to be documented, and PostgreSQL's own build breaks in such a case, so there is little need, for now, to support it here. We don't know, for now, whether the convention implemented here is also right on Windows.