Re: Build libfreetype with custom, embedded environment fails
Erich Ente <[email protected]> Tue, 31 Mar 2026 11:14:25 +0200
| Newsgroups | gmane.comp.fonts.freetype.user |
|---|---|
| Message-ID | <CAPykt4azYuS8JznHgXqP6eO_V4TWjYOm5WzEK1O4BVzaH+zbZg@mail.gmail.com> |
Hi Guy,
thank you for your feedback. Unfortunately the problem here is, I can use
neither configure nor make. so whatever these scripts are doing and
defining in the compile-environment, has to be done manually. And here it
seems I miss something dramatically important - resulting in the errors
described above...
Am Mi., 25. M=C3=A4rz 2026 um 12:50 Uhr schrieb Guy Turcotte <turgu666@gmai=
l.com
>:
> I managed to get freetype embedded into a ESP32 controller using the
> distribution as-is with some changes to get only the truetype support (TT=
F
> and OTF). The compiler used is based on the GNU C compiler and my
> development environment is based on Linus.
>
> The procedure I used is as follow:
>
> 1. Retrieve the FreeType source code (me I'm using the last stable releas=
e
> 2.14.3)
> 2. Modify the freetype-2.14.3/modules.cfg and
> freetype-2.14.3/include/freetype/config/ftoption.h to only get the parts
> required. See my own attached version of these files.
> 3. Make a folder that will receive the content of the compiled library:
> here I'm using lib_freetype
> 4. in a shell change current folder to the freetype-2.14.3
>
> 5. Execute the following (this must be *taylored* to your environment, in
> particule, the --host option):
>
> $ ./configure --host=3Dxtensa-esp32-elf --prefix=3D$HOME/lib_freetype
> --disable-shared --enable-static --without-png --without-zlib
> --without-harfbuzz CFLAGS=3D"-mlongcalls"
>
> 6. $ make
> 7. $ make install
>
> In lib_freetype you then get everything required to integrate to your
> application: the library, include files, etc.
>
> Hope this help
>
> Guy
> On 2026-03-25 02:27, Erich Ente wrote:
>
> Hi everybody,
>
> I'm trying to build the original and official libfreetype for a embedded
> platform (to be more accurate: a bare-metal application which is built wi=
th
> the CodeComposerStudio by Texas Instruments). As libfreetype is ANSI-C
> based, this should be no problem (unfortunately it is).
>
> All the predefined build-struff like the cmake and other scripts/Makefile=
s
> can not be used as they do not fit to the CCS environment, so I tried to
> set it up from scratch. What I have done so far:
>
> -
>
> copied the freetype-2.10.0 folder into my working directory
> -
>
> in src/ I have removed all subdirectories except base, psnames, sfnt,
> truetype in order to get a minimalistic library which supports TTF onl=
y
> -
>
> the include/ directory was left untouched
> -
>
> in my project settings I have added a include-path which points to
> include/
> -
>
> in my project settings I have added a definition FT2_BUILD_LIBRARY in
> order to let it build a linkable library
>
> Unfortunately something seems to be missing as I have a lot of undefined
> stuff here:
>
> -
>
> FT_ERR_PREFIX is undefined in fterrors.c
> -
>
> FT_Error_String( FT_Error error_code ) in fterrors.h causes an error
> -
>
> FT_EXPORT in fterrors.h is undefined
> -
>
> the whole FT_NOERRORDEF_ stuff in fterrdef.h is undefined
> -
>
> when I ensure FT_ERR_PREFIX being defined for FT_NOERRORDEF_, it
> complains about all the errorcodes (such as Cannot_Open_Resource) not =
being
> defined in fterrdef.h
>
> So it seems, something important is missing. Any hints/ideas what is wron=
g
> here?
>
> Thanks!
>
> PS: this is the output of the compiler:
>
>
> Compilation failure
>
> base/subdir_rules.mk:7: recipe for target 'base/fterrors.obj' failed
> "/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/fr=
eetype/fterrdef.h",
> line 60: error #68: expected a "}"
> "/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/fr=
eetype/fterrors.h",
> line 204: warning #12-D: parsing restarts here after previous syntax
> error
> "/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/fr=
eetype/fterrdef.h",
> line 60: warning #1916-D: definition at end of file not followed by a
> semicolon or a declarator
> "/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/fr=
eetype/fterrors.h",
> line 274: error #142-D: unnamed prototyped parameters not allowed when
> body is present
> "/home/universe/AM335X_StarterWare_02_00_01_01/freetype-2.10.0/include/fr=
eetype/fterrors.h",
> line 275: error #131: expected a "{"
> "../base/fterrors.c", line 27: warning #12-D: parsing restarts here
> after previous syntax error
> "../base/fterrors.c", line 28: error #20: identifier "error_code" is unde=
fined
> "../base/fterrors.c", line 29: error #110: expression preceding
> parentheses of apparent call must have (pointer-to-) function type
> "../base/fterrors.c", line 29: error #20: identifier "FT_Err_" is undefin=
ed
> "../base/fterrors.c", line 29: error #20: identifier "Max" is undefined
> "../base/fterrors.c", line 30: error #20: identifier "NULL" is undefined
> 8 errors detected in the compilation of "../base/fterrors.c".
> gmake: *** [base/fterrors.obj] Error 1
> Building file: "../base/ftdbgmem.c"
>
>