freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Two freetype-2.3.9 problems


From: mpsuzuki
Subject: Re: [ft-devel] Two freetype-2.3.9 problems
Date: Tue, 26 May 2009 23:45:48 +0900

Hi,

I'm quite sorry for long inactive status. Attached is a proposal
patch to improve non-autoconf configure in the top directory
(freetype-2.x.y/configure) to filter "--srcdir" before invoking
autoconf configure (builds/unix/configure).

In my understanding, "--srcdir" option is not essential for most
builders of FreeType2. The configure in the top directory finds
the source directory automatically, so, even when the builder
compiles FreeType2 package out of the source tree, "--srcdir" is
not essential. For example:


        $ gzip -cd < freetype-2.3.9.tar.gz | tar xf -
        $ mkdir ft2-build-dir
        $ ls -FC
        freetype-2.3.9/ ft2-build-dir/
        $ cd ft2-build-dir
        $ ../freetype-2.3.9/configure
        Copying `modules.cfg'
        Generating `Makefile'

        FreeType build system -- automatic system detection

        The following settings are used:

          platform                    unix
          compiler                    cc
          configuration directory     /tmp/freetype-2.3.9/builds/unix
          configuration rules         /tmp/freetype-2.3.9/builds/unix/unix.mk

        If this does not correspond to your system or settings please remove 
the file
        `config.mk' from this directory then read the INSTALL file for help.

        Otherwise, simply type `make' again to build the library,
        or `make refdoc' to build the API reference (the latter needs python).

        ...

As you can find in "configuration directory" etc, the source tree
is automatically detected.

If the locations of FreeType2 source tree, configure script, and
building directory are different, "--srcdir" is required to tell
the correct source tree to configure script. However, I don't know
this is popular case.

In such case, what is the problem? In current FreeType2, non-autoconf
configure in the top directory invokes autoconf configure in builds/
unix/. All options passed to the configure in the top directory are
transparently passed to builds/unix/configure.

Usually, autoconf configure is expected that it is located in the top
directory of the source tree, and "--srcdir" option is used to specify
the directory that autoconf configure script is located. In the case
of FreeType2, autoconf configure is NOT located in the top directory,
so passing "--srcdir" option from non-autoconf configure to
builds/unix/configure without modification is not good idea.

The attached patch modifies the value of "--srcdir" option. It adds
"builds/unix/" to tell the location of the autoconf configure.
Other options are passed to builds/unix/configure transparently.

--

BTW, after short tests of this patch, I'm afraid that some make
files of FreeType2 are not transparent to the pathnames including
white space.

If the compilation is executed in the source tree, the relative
paths under the source tree are used, so there's no pathnames
including white spaces. Therefore, no problem arises.

At present, I'm not good at writing makefiles which can stand
the pathnames including white space (and other special characters),
I want to separate this issue from "--srcdir=" support.

Werner, how do you think about the support of the pathnames
including white spaces?

Regards,
mpsuzuki

diff --git a/ChangeLog b/ChangeLog
index 2776d70..1a3976e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-05-26  suzuki toshiya  <address@hidden>
+
+       Filter --srcdir= option before invoking builds/unix/configure
+
+       * configure: when builds/unix/configure is invoked with --srcdir
+       option, the option should take "builds/unix" directory instead
+       of the top source directory. Thus configure in the top directory
+       should modify --srcdir= option when builds/unix/configure is
+       invoked.
+
 2009-05-22  Werner Lemberg  <address@hidden>
 
        Improve b/w rasterizer.
diff --git a/configure b/configure
old mode 100644
new mode 100755
index b59d35d..43a701f
--- a/configure
+++ b/configure
@@ -67,15 +67,28 @@ ft2_dir=`(dirname "$0") 2>/dev/null                         
||
 abs_curr_dir=`pwd`
 abs_ft2_dir=`cd "$ft2_dir" && pwd`
 
+# "--srcdir=" option can override abs_ft2_dir.
+
+if [ $# -gt 0 ]; then
+   for x in "$@"; do
+      echo $x
+      case x"$x" in
+      x--srcdir=* )
+        abs_ft2_dir=`echo $x | sed 's/^--srcdir=//'` ;;
+      * ) ;;
+      esac
+   done
+fi
+
 # build a dummy Makefile if we are not building in the source tree
 
 if test "$abs_curr_dir" != "$abs_ft2_dir"; then
   mkdir reference
   echo "Copying \`modules.cfg'"
-  cp $abs_ft2_dir/modules.cfg $abs_curr_dir
+  cp "$abs_ft2_dir/modules.cfg" "$abs_curr_dir"
   echo "Generating \`Makefile'"
-  echo "TOP_DIR   := $abs_ft2_dir"               > Makefile
-  echo "OBJ_DIR   := $abs_curr_dir"             >> Makefile
+  echo $abs_ft2_dir  | sed 's/ /\\ /;s/^/TOP_DIR   := /'  > Makefile
+  echo $abs_curr_dir | sed 's/ /\\ /;s/^/OBJ_DIR   := /' >> Makefile
   echo "OBJ_BUILD := \$(OBJ_DIR)"               >> Makefile
   echo "DOC_DIR   := \$(OBJ_DIR)/reference"     >> Makefile
   echo "LIBTOOL   := \$(OBJ_DIR)/libtool"       >> Makefile
@@ -96,7 +109,10 @@ CFG=
 case $# in
 0) ;;
 *) for x in "$@"; do
-     CFG="$CFG '$x'"
+     case x"$x" in
+     x--srcdir=* ) CFG="$CFG '$x'/builds/unix" ;;
+     *) CFG="$CFG '$x'" ;;
+     esac
    done ;;
 esac
 CFG=$CFG $GNUMAKE setup unix







On Sat, 25 Apr 2009 11:17:59 +0200 (CEST)
Werner LEMBERG <address@hidden> wrote:

>
>> (1) You can't invoke freetype's configure script (top-level wrapper)
>> with an argument '--srcdir=<wherever>', because that isn't properly
>> adjusted when invoking the real configure script in builds/unix
>> (same for other configure arguments such as '--cache-file=' and
>> maybe more).
>> 
>> Since such configure arguments are automatically generated (via
>> AC_CONFIG_SUBDIRS), that makes it very awkward to use freetype as a
>> subpackage in a larger build system (as we have to do TeX Live).
>> 
>> Do you see any easy solution for that?  I don't think one can
>> directly invoke the builds/unix/configure script -- or can one?
>
>I must admit that I have never used --srcdir before, so I wasn't aware
>of the problem.  I'm still unsure how exactly it should work.  Can you
>give an example, please?
>
>
>    Werner
>
>
>PS: I've asked Suzuki-san to take care of the other problem.
>
>
>_______________________________________________
>Freetype-devel mailing list
>address@hidden
>http://lists.nongnu.org/mailman/listinfo/freetype-devel




reply via email to

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