freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Integrating Docwriter into FreeType


From: Werner LEMBERG
Subject: Re: [ft-devel] Integrating Docwriter into FreeType
Date: Tue, 31 Jul 2018 11:47:48 +0200 (CEST)

> Thanks for the explanation and the scripts. Running
> 
>   ./autogen.sh
>   make
> 
> on a clean environment (without docwriter installed) would now give:
> 
>   (...)
>   checking for library containing clock_gettime... none required
>   checking for python... python
>   checking for pip... pip

Ah, here should be

    checking for `docwriter' Python module... no

I missed that.  So the code should be something like

  have_docwriter=no
  if test "x$PYTHON" != "xmissing"; then
    AC_CHECK_PROGS([PIP], [pip2 pip3], [missing])

    if test "x$PIP" != "xmissing"; then
      AC_MSG_CHECKING([for \`docwriter' Python module])
      $PIP show -q docwriter
      if test "x$?" = "x0"; then
        have_docwriter=yes
        AC_MSG_RESULT([yes])
      else
        AC_MSG_RESULT([no])
      fi
    fi
  fi

>   configure: creating ./config.status
>   (...)
>   configure:
> 
>   Library configuration:
>     external zlib: yes (autoconf test)
>     bzip2:         no
>     libpng:        yes (libpng-config)
>     harfbuzz:      no
> 
>   configure:
>     Warning: `make refdoc' will fail since pip package `docwriter'
>     is not installed. To install, run `pip install docwriter', or to
>     use a python virtual environment, run `make refdoc-venv' (Requires
>     pip package `virtualenv').

Nice!  Please use two spaces after `.'.

> Also, is there a way to store the $PYTHON variable (python/python2/
> python3) so that I can use it in `freetype.mk' while invoking
> docwriter?

Not directly.  The `builds/unix/configure' script creates two files,
`unix-cc.mk' (from `unix-cc.in') and `unix-def.mk' (from
`unix-def.in').  In those files, address@hidden@' gets replaced with `$FOO' as
set up in `configure.ac'.[*] You can thus add a line

  PYTHON := @PYTHON@

to `unix-def.in' (which fits better than `unix-cc.in') to have $PYTHON
available.  Note that you also need to define `$PYTHON' for other
platforms; the simplest thing is probably to add the line

  PYTHON ?= python

at the top of `builds/detect.mk' (`?=' only sets the value if it is
not set already, allowing it to be overridden on the command line).


    Werner


[*] To be fully correct, you would need to call `AC_SUBST([FOO])' to
    make this substition work, but this is automatically done for
    `AC_CHECK_PROGS'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]