[ft-devel] Re: autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
> Just I've finished a preliminary patch to enable cross- > building by GNU autoconf, I attached it. Great! Thanks for your work. > However, often I find people doing wrong style as: [...] Don't worry. We just have to document the right way, perhaps in a new file called `INSTALL.CROSS'. > I'm unfamiliar with the naming convension in .mk files, so I want > comments by David or Werner about the variable names like > "CCraw_build" "E_BUILD". Just go on. Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] Re: autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
Dear Sirs, On Thu, 12 Oct 2006 08:15:20 +0200 (CEST) Werner LEMBERG <[EMAIL PROTECTED]> wrote: >> However, often I find people doing wrong style as: [...] > >Don't worry. We just have to document the right way, perhaps in a new >file called `INSTALL.CROSS'. I see, I will add freetype2/doc/CROSSDEV.GNU for 8.3 naming convention - at present, cross-building is only for Unix-like systems, such platform specific document is out of 8.3 convention? I think the name INSTALL.CROSS is better and easier to know what it is. >> I'm unfamiliar with the naming convension in .mk files, so I want >> comments by David or Werner about the variable names like >> "CCraw_build" "E_BUILD". > >Just go on. Thank you, within 48 hours, I will commit my patch and document. Regards, mpsuzuki ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] Re: autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
> I see, I will add freetype2/doc/CROSSDEV.GNU for 8.3 > naming convention - at present, cross-building is only > for Unix-like systems, such platform specific document > is out of 8.3 convention? I think the name INSTALL.CROSS > is better and easier to know what it is. Well, I think today it is sufficient just to obey that names stripped to 8.3 stay unique. So INSTALL.CROSS is just fine. Werner ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel
[ft-devel] Re: autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
Dear Werner, On Thu, 12 Oct 2006 16:25:34 +0200 (CEST) Werner LEMBERG <[EMAIL PROTECTED]> wrote: >> I see, I will add freetype2/doc/CROSSDEV.GNU for 8.3 >> naming convention - at present, cross-building is only >> for Unix-like systems, such platform specific document >> is out of 8.3 convention? I think the name INSTALL.CROSS >> is better and easier to know what it is. > >Well, I think today it is sufficient just to obey that names stripped >to 8.3 stay unique. So INSTALL.CROSS is just fine. I see. Following is my manuscript for INSTALL.CROSS, Please give me comment. I thought I should refer some reliable document to guide cross building by GNU autoconf, but I could not hit upon - most of cross-building howto-documents (and automated scripts) are strenuously written from scratch, soon left over, and obsoleted. For a document in freetype2 package, I thought refering nothing is better than refering a document which can be obsoleted in future. Regards, mpsuzuki This document contains instructions on how to cross-build the FreeType library on Unix systems, for example, building binaries for Linux/MIPS on FreeBSD/i386. Before this document, see INSTALL.UNIX for required tools and basic self-building procedure. 1. Required Tools - As self-building on Unix system, GNU Make 3.78.1 or newer is required. INSTALL.UNIX contains how to check the installed `make'. GNU C compiler to cross-build for target system is required. At present, non-GNU cross compiler is not tested. The cross compiler is expected to be installed with system-prefix. For example, when your building system is FreeBSD/i386 and the target system is Linux/MIPS, the cross compiler should be installed with name: "mips-ip22-linuxelf-gcc". Also C compiler for self-build is required. Non-GNU self compiler is acceptable, but not tested yet. This is used to build a tool that is executed in building procedure. 2. Configuration 2-1. Building and target system --- To configure for cross-build, the options `--host=' and `--build=' must be passed to configure. For example, when your building system is FreeBSD/i386 and the target system is Linux/MIPS, ./configure \ --build=i386-unknown-freebsd \ --host=mips-ip22-linuxelf \ [other options] It should be noted that `--host=' specifies the system that built binaries are executed, not the system of "host to cross-build". In legacy GNU autoconf, the options `--host=' and `--target=' are used, it is broken and obsoleted. Either explicit CC specification like `env CC=mips-ip22-linux-gcc ./configure' or `env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure' do not work, such configuration makes configure confused to find cross and native C compilers. 2-2. Prefix to install FreeType2 Setting `--prefix=' properly is important. The prefix to install FreeType2 is written in freetype-config and freetype2.pc. If the built FreeType2 is used as a part of cross-building system, the prefix is expected to be different from self-building system. For example, configuration with `--prefix=/usr/local' will install unexecutable binaries into system wide `/usr/local', thus it causes a confusion in configuration of the application using FreeType2. Configure to install cross-building system tree (for example, `--prefix=/usr/local/mips-ip22-linux/') is better. On the other hand, if the built FreeType2 is used a part of target system, the prefix to install should reflect file system structure of the target system. 3. Build If the configuration finishes successfuly, invoking GNU make builds FreeType2, like, make or gmake 4. Install -- Invoking GNU make for the target `install', built FreeType2 is directly installed into the directory configured by `--prefix='. As noted in 2-2, sometimes FreeType2 is configured to be installed system directory of the target system, and should not be installed into the cross-building system. In such case, a make variable `DESTDIR' is useful to change the root directory in installation. For example, invoking make with `DESTDIR=' option, like make DESTDIR=/mnt/target_system_root/ install the built FreeType2 files are installed into `/mnt/target_system_root//lib' etc. 5. TODO --- Cross building between Cygwin (or MSys) and Unix must be tested. -- Copyright 2006 by suzuki toshiya David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modif
[ft-devel] Re: autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
> I see. Following is my manuscript for INSTALL.CROSS, Please give me > comment. Below is a revised version. Werner == This document contains instructions on how to cross-build the FreeType library on Unix systems, for example, building binaries for Linux/MIPS on FreeBSD/i386. Before reading this document, please consult INSTALL.UNIX for required tools and the basic self-building procedure. 1. Required Tools - For self-building the FreeType library on a Unix system, GNU Make 3.78.1 or newer is required. INSTALL.UNIX contains hints how to check the installed `make'. The GNU C compiler to cross-build the target system is required. At present, using non-GNU cross compiler is not tested. The cross compiler is expected to be installed with a system prefix. For example, if your building system is FreeBSD/i386 and the target system is Linux/MIPS, the cross compiler should be installed with the name `mips-ip22-linuxelf-gcc'. A C compiler for a self-build is required also, to build a tool that is executed during the building procedure. Non-GNU self compilers are acceptable, but such a setup is not tested yet. 2. Configuration 2.1. Building and target system To configure for cross-build, the options `--host=' and `--build=' must be passed to configure. For example, if your building system is FreeBSD/i386 and the target system is Linux/MIPS, say ./configure \ --build=i386-unknown-freebsd \ --host=mips-ip22-linuxelf \ [other options] It should be noted that `--host=' specifies the system where the built binaries will be executed, not the system where the build actually happens. Older versions of GNU autoconf use the option pair `--host=' and `--target='. This is broken and doesn't work. Similarly, an explicit CC specification like env CC=mips-ip22-linux-gcc ./configure or env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure doesn't work either; such a configuration confuses the `configure' script while trying to find the cross and native C compilers. 2.2. The prefix to install FreeType2 Setting `--prefix=' properly is important. The prefix to install FreeType2 is written into the freetype-config script and freetype2.pc configuration file. If the built FreeType 2 library is used as a part of the cross-building system, the prefix is expected to be different from the self-building system. For example, configuration with `--prefix=/usr/local' installs binaries into the system wide `/usr/local' directory which then can't be executed. This causes confusion in configuration of all applications which use FreeType 2. Instead, use a prefix to install the cross-build into a separate systemtree, for example, `--prefix=/usr/local/mips-ip22-linux/'. On the other hand, if the built FreeType2 is used as a part of the target system, the prefix to install should reflect the file system structure of the target system. 3. Building command --- If the configuration finishes successfuly, invoking GNU make builds FreeType2. Just say make or gmake depending on the name the GNU make binary actually has. 4. Installation --- Saying make install as usual to install FreeType2 into the directory tree specified by the argument of the `--prefix' option. As noted in section 2.2, FreeType 2 is sometimes configured to be installed into the system directory of the target system, and should not be installed in the cross-building system. In such cases, the make variable `DESTDIR' is useful to change the root directory in the installation. For example, after make DESTDIR=/mnt/target_system_root/ install the built FreeType2 library files are installed into the directory `/mnt/target_system_root//lib'. 5. TODO --- Cross building between Cygwin (or MSys) and Unix must be tested. -- Copyright 2006 by suzuki toshiya David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, and distributed under the terms of the FreeType project license, LICENSE.TXT. By continuing to use, modify, or distribute this file you indicate that you have read the license and understand and accept it fully. --- end of INSTALL.CROSS --- ___ Freetype-devel mailing list Freetype-devel@nongnu.org http://
[ft-devel] Re: autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
Dear Sir, Thank you for improvement and formatting, just I've committed cross-building patch to CVS! Regards, mpsuzuki On Sat, 14 Oct 2006 08:30:38 +0200 (CEST) Werner LEMBERG <[EMAIL PROTECTED]> wrote: > >> I see. Following is my manuscript for INSTALL.CROSS, Please give me >> comment. > >Below is a revised version. > > >Werner > > >== > > >This document contains instructions on how to cross-build the FreeType >library on Unix systems, for example, building binaries for Linux/MIPS >on FreeBSD/i386. Before reading this document, please consult >INSTALL.UNIX for required tools and the basic self-building procedure. > > > 1. Required Tools > - > >For self-building the FreeType library on a Unix system, GNU Make >3.78.1 or newer is required. INSTALL.UNIX contains hints how to >check the installed `make'. > >The GNU C compiler to cross-build the target system is required. >At present, using non-GNU cross compiler is not tested. The cross >compiler is expected to be installed with a system prefix. For >example, if your building system is FreeBSD/i386 and the target >system is Linux/MIPS, the cross compiler should be installed with >the name `mips-ip22-linuxelf-gcc'. > >A C compiler for a self-build is required also, to build a tool >that is executed during the building procedure. Non-GNU self >compilers are acceptable, but such a setup is not tested yet. > > > 2. Configuration > > >2.1. Building and target system > > To configure for cross-build, the options `--host=' and > `--build=' must be passed to configure. For example, if > your building system is FreeBSD/i386 and the target system is > Linux/MIPS, say > >./configure \ > --build=i386-unknown-freebsd \ > --host=mips-ip22-linuxelf \ > [other options] > > It should be noted that `--host=' specifies the system > where the built binaries will be executed, not the system where > the build actually happens. Older versions of GNU autoconf use > the option pair `--host=' and `--target='. This is broken and > doesn't work. Similarly, an explicit CC specification like > >env CC=mips-ip22-linux-gcc ./configure > > or > >env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure > > doesn't work either; such a configuration confuses the > `configure' script while trying to find the cross and native C > compilers. > > >2.2. The prefix to install FreeType2 > > Setting `--prefix=' properly is important. The prefix > to install FreeType2 is written into the freetype-config script > and freetype2.pc configuration file. > > If the built FreeType 2 library is used as a part of the > cross-building system, the prefix is expected to be different > from the self-building system. For example, configuration with > `--prefix=/usr/local' installs binaries into the system wide > `/usr/local' directory which then can't be executed. This > causes confusion in configuration of all applications which use > FreeType 2. Instead, use a prefix to install the cross-build > into a separate systemtree, for example, > `--prefix=/usr/local/mips-ip22-linux/'. > > On the other hand, if the built FreeType2 is used as a part of > the target system, the prefix to install should reflect the file > system structure of the target system. > > > 3. Building command > --- > >If the configuration finishes successfuly, invoking GNU make builds >FreeType2. Just say > > make > >or > > gmake > >depending on the name the GNU make binary actually has. > > > 4. Installation > --- > >Saying > > make install > >as usual to install FreeType2 into the directory tree specified by >the argument of the `--prefix' option. > >As noted in section 2.2, FreeType 2 is sometimes configured to be >installed into the system directory of the target system, and >should not be installed in the cross-building system. In such >cases, the make variable `DESTDIR' is useful to change the root >directory in the installation. For example, after > > make DESTDIR=/mnt/target_system_root/ install > >the built FreeType2 library files are installed into the directory >`/mnt/target_system_root//lib'. > > > 5. TODO > --- > >Cross building between Cygwin (or MSys) and Unix must be tested. > > >-- > >Copyright 2006 by suzuki toshiya >David Turner, Robert Wilhelm, and Werner Lemberg. > > >This file is part of the FreeType project, and may only be used, >modified, and distributed
[ft-devel] Re: autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
Hi there, Sorry to resurrect an ancient thread, but I ran into a similar problem when attempting to cross-compile freetype2 v2.4.6 using LTIB. In the hopes of saving someone else the trouble, I'm including my solution in the form of the attached patch which explains the problem and shows my hacky fix to allow it to build under LTIB. -Aaron # 2011-Nov-07 # This patch provides a workaround for config problems caused by LTIB's env setup. # In a nutshell, two issues were occurring: # 1) Freetype2's configure script was ignoring --build=XXX options and guessing the wrong compiler triplet for the build machine when called in LTIB environment # FIX: remove call to builds/unix/config.guess in favor of '/usr/bin/gcc -dumpmachine' # 2) The [triplet]-gcc file was adding some command switchs and somehow using the path to find "the true gcc" when compiling. Since the LTIB environment places its own spoof dirs first in the path, [triplet]-gcc wound up calling the cross compiler. # FIX: modify the variable holding the native compiler call (CC_BUILD) to set the environment to something resonable when using [triplet]-gcc as determined by the above fix. (env PATH=/usr/bin XXX) # Note that the problem is caused by bad env settings -- using the configure to set up a "proper" no-spoof cross-compile works fine. diff -uNr freetype-2.4.6/builds/unix/configure freetype-2.4.6-modified//builds/unix/configure --- freetype-2.4.6/builds/unix/configure 2011-07-29 00:39:28.0 -0400 +++ freetype-2.4.6-modified//builds/unix/configure 2011-11-07 14:49:43.138435856 -0500 @@ -2457,18 +2457,19 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi +#if ${ac_cv_build+:} false; then : +# $as_echo_n "(cached) " >&6 +#else +# ac_build_alias=$build_alias +#test "x$ac_build_alias" = x && +# ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +#test "x$ac_build_alias" = x && +# as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +#ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || +# as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5# +# +#fi +ac_cv_build=`/usr/bin/gcc -dumpmachine` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in @@ -3577,7 +3578,7 @@ fi fi fi -CC_BUILD=$ac_cv_prog_CC_BUILD +CC_BUILD="env PATH=/usr/bin $ac_cv_prog_CC_BUILD" if test -n "$CC_BUILD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5 $as_echo "$CC_BUILD" >&6; } @@ -3594,6 +3595,8 @@ rm -f a.* b.* a_out.exe conftest.* echo > conftest.c "int main() { return 0;}" ${CC_BUILD} conftest.c || as_fn_error $? "native C compiler is not working" "$LINENO" 5 + #touch a.out + #chmod +x a.out rm -f conftest.c if test -x a.out -o -x b.out -o -x conftest; then EXEEXT_BUILD="" ___ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel