freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] autoconf-based cross-building patch ([ft] FT2 Cross-compile E


From: mpsuzuki
Subject: [ft-devel] autoconf-based cross-building patch ([ft] FT2 Cross-compile Error)
Date: Thu, 12 Oct 2006 15:02:12 +0900

Dear Sirs,

Since my previous notice as "I will do within 1 or 2 months"
for cross-building issue (reported in freetype list), 1.8 month
has already passed. Sorry for long lating.

Just I've finished a preliminary patch to enable cross-
building by GNU autoconf, I attached it.

# After applying the patch, I can build freetype2 on Linux/i386
# for Linux/MIPS, aslike,
#
#       $ ./configure \
#               --build=i386-pc-linux-gnu \
#               --host=mips-ip22-linuxelf-gnu
#       $ make
#
# is OK. However, often I find people doing wrong style as:
#
#       $ env CC=/usr/local/mips-ip22-linuxelf-gnu/bin/gcc \
#               ./configure
#
# or
#
#       $ env CC=/usr/local/bin/mips-ip22-linuxelf-gcc \
#               ./configure
#
# There are too many people doing such, so I'm afraid there are
# some building systems (or script tools) doing such. I don't
# have working solution for such people.

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".

Regards,
mpsuzuki


--- orig/builds/unix/configure.raw
+++ mod/builds/unix/configure.raw
@@ -25,6 +25,8 @@
 
 # checks for system type
 
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
 
@@ -32,6 +34,42 @@
 
 AC_PROG_CC
 AC_PROG_CPP
+AC_SUBST(EXEEXT)
+
+
+# checks for native programs to generate building tool
+
+if test ${cross_compiling} = yes; then
+  AC_CHECK_PROG(CC_BUILD, ${build}-gcc, ${build-gcc})
+  test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, gcc, gcc)
+  test -z "${CC_BUILD}" && AC_CHECK_PROG(CC_BUILD, cc, cc, , , /usr/ucb/cc)
+  test -z "${CC_BUILD}" && AC_MSG_ERROR([cannot find native C compiler])
+
+  AC_MSG_CHECKING([for suffix of native executables])
+  rm -f a.* b.* a_out.exe conftest.*
+  echo > conftest.c "int main() { return 0;}"
+  ${CC_BUILD} conftest.c || AC_MSG_ERROR([native C compiler is not working])
+  rm -f conftest.c
+  if test -x a.out -o -x b.out -o -x conftest; then
+    EXEEXT_BUILD=""
+  elif test -x a_out.exe -o -x conftest.exe; then
+    EXEEXT_BUILD=".exe"
+  elif test -x conftest.* ; then
+    EXEEXT_BUILD=`echo conftest.* | sed -n '1s/^.*\.//g'`
+  fi
+  AC_MSG_RESULT($EXEEXT_BUILD)
+else
+  CC_BUILD=${CC}
+  EXEEXT_BUILD=${EXEEXT}
+fi
+
+
+if test ! -z ${EXEEXT_BUILD}; then
+  EXEEXT_BUILD=."${EXEEXT_BUILD}"
+fi
+AC_SUBST(CC_BUILD)
+AC_SUBST(EXEEXT_BUILD)
+
 
 
 # get compiler flags right


--- orig/builds/unix/unix-cc.in
+++ mod/builds/unix/unix-cc.in
@@ -25,6 +25,12 @@
 SO := o
 
 
+# The executable file extension. Although most Unix platform use no extension,
+# we copy the extension detected by autoconf, useful for cross building on
+# Unix system for non-Unix system.
+#
+E  := @EXEEXT@
+
 # The library file extension (for standard and static libraries).  This can
 # be .a, .lib, etc., depending on the platform.
 #
@@ -88,10 +94,12 @@
 LDFLAGS := @LDFLAGS@
 
 
-# export symbols (XXX: HOW TO DEAL WITH CROSS COMPILATION ?)
+# export symbols
 #
+CCraw_build  := @CC_BUILD@     # native CC of building system
+E_BUILD      := @EXEEXT_BUILD@ # extension for exexutable on building system
 EXPORTS_LIST := $(OBJ_DIR)/ftexport.sym
-CCexe        := $(CCraw)   # used to compile "apinames" only
+CCexe        := $(CCraw_build) # used to compile "apinames" only
 
 
 # Library linking


--- orig/builds/exports.mk
+++ mod/builds/exports.mk
@@ -48,7 +48,7 @@
   # Note that $(APINAMES_OPTIONS) is empty, except for Windows compilers.
   #
   APINAMES_SRC := $(TOP_DIR)/src/tools/apinames.c
-  APINAMES_EXE := $(OBJ_DIR)/apinames$E
+  APINAMES_EXE := $(OBJ_DIR)/apinames$(E_BUILD)
 
   $(APINAMES_EXE): $(APINAMES_SRC)
          $(CCexe) $(TE)$@ $<






On Mon, 21 Aug 2006 21:17:53 +0900
address@hidden wrote:

>Hi,
>
>On Mon, 21 Aug 2006 19:49:39 +0800
>"littertiger" <address@hidden> wrote:
>>When I cross compile directfb,I found it needs FreeType 2.
>>so I donloaded it, and cross compile it.
>>My cross compiler is arm_v4t_le-gcc. I type the following cmd in
>>FreeType2 source path: CC=arm_v4t_le-gcc ./configure --host=arm-linux;
>>make  It seems it prodused a arm format program apinames, and execute
>>it, then errors.
>
>Ah, cross-building on Unix systems in freetype-2.2.x is
>temporarily broken at present, I will fix it within 1 or
>2 months. Please try freetype-2.1.10 which can be built
>without apinames.
>
># apinames is a tool to hide internal symbols from public.
>
>Regards,
>mpsuzuki






reply via email to

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