建筑与SDL2 NDK工具链 [英] Building SDL2 with NDK toolchain

查看:605
本文介绍了建筑与SDL2 NDK工具链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否有人却设法建立与Android NDK(r8d)的工具链新鲜SDL2。

I wonder if anyone did managed to build the fresh SDL2 with the toolchain of the Android NDK(r8d).

SDL2似乎是非常接近的版本(因为昨天不是UNDER CONSTROCTION了:的http:// hg.libsdl.org/SDL/rev/0a3d2ec7af6d )。它配备了一个Android.mk,只是编译以下罚款中捆绑README.android文件中的指令。我的问题是,是否真的没有工作automake的基础建设可用或将可用编译它在Android,或者什么是错的我的工具链的设置?

SDL2 seems to be very close to the release (since yesterday it isn't "UNDER CONSTROCTION anymore: http://hg.libsdl.org/SDL/rev/0a3d2ec7af6d). It comes with an Android.mk and just compiles fine following the instructions in the bundled README.android file. My question is whether there's really no working automake based build is available or will be available to compile it on Android, or something's wrong with my toolchain setup?

我已经安装了NDK工具链以下位于$ NDK / DOC / STANDALONE-TOOLCHAIN​​.html文档的说明。我用gcc 4.6。这里有一个环境我使用:

I have installed the NDK toolchain following the instructions of the documentation located at $NDK/doc/STANDALONE-TOOLCHAIN.html. I'm using gcc 4.6. Here's one environment i use:

#!/bin/sh
export TOOLCHAIN=$HOME/Android/android-14-arm
export PATH=$TOOLCHAIN/bin:$PATH
export SYSROOT=$TOOLCHAIN/sysroot
export CROSS_COMPILE="arm-linux-androideabi"
export CC=$CROSS_COMPILE-gcc
export CXX=$CROSS_COMPILE-g++
export CPP=$CROSS_COMPILE-cpp
export CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
export LDFLAGS="-march=armv7-a -Wl,--fix-cortex-a8"
echo "Compiler set up for ARM 14"

在配置PARAMS:

The configure params:

./configure --host=arm-linux-androideabi --prefix=$SYSROOT/usr/local

使用相同的配置我成功的libjpeg内置涡轮增压V8发动机和SDL_image。
配置脚本识别交叉编译器,并建立makefile文件,但是,它发现X11的支持,不能看到的OpenGL ES ......本作失败:

With the same configuration i successfully built libjpeg-turbo v8 and SDL_image. The configure script recognizes the cross-compiler, and builds the makefile, however, it finds X11 support, can't see the OpenGL ES... The make fails:

In file included from /usr/include/features.h:378:0,
             from /usr/include/sys/types.h:27,
             from ./include/SDL_stdinc.h:35,
...

我查了配置日志,我不知道这里的​​/ usr / include目录的由来。
但事实上,生成的生成文件添加在EXTRA_CFLAGS编译器该行。
NDK的文档所引用的--with-SYSROOT = $ SYSROOT可选,我已经包括了它,看它是否解决了问题,但是这并没有帮助。
作为最后的努力,我手动编辑Makefile文件,修复该参考,现在的编译器抱怨X11.h.
据我所知Android已经无关,与X11,所以我想整个编译树完全不合适与NDK使用。

I checked the configure log, i have no idea where the "/usr/include" comes from. But in fact, the generated makefile adds that line in the EXTRA_CFLAGS to the compiler. The NDK doc refers the --with-sysroot=$SYSROOT as optional, i've included it to see if it solves the problem, but that didn't help. As a last effort i manually edited the Makefile, fixing that reference, and now the compiler complained about X11.h. AFAIK Android has nothing to do with X11, so i guess the whole build-tree completely inappropriate to use with NDK.

我也尝试了不同的配置,在一个旧的线程<一发现href=\"http://stackoverflow.com/questions/8973582/building-sdl-for-arm-using-android-standalone-toolchain\">here.
无论是定义-DANDROID -mandroid -fomit帧指针也变回-march =的ARMv7-A -mfloat-ABI = softfp -mfpu = VFP -mthumb解决了这个问题。

I have also tried a different configuration, found in an older thread here. Neither defining -DANDROID -mandroid -fomit-frame-pointer nor changing back to -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb" solved the problem.

在previous项目,我不得不刷新的config.guess,为了config.sub脚本让我的编译器能够识别。 SDL似乎没有使用它们。此外没有Makefile.ac或Makefile.am带有SDL的工作,并且可以用于其他平台没有模板,一个很好的起点,以创建自己的makefile。此外,我从来没有处理的makefile,我真的没有机会去理清这些问题。即使成功了,我可能会需要一个配置工具为好,因为我不知道NDK的构建如何管理没有配置脚本安装SDL2。

On previous projects, i had to refresh config.guess, and config.sub in order to get my compiler recognized. SDL doesn't seem to use those. Furthermore no Makefile.ac or Makefile.am comes with SDL to work with, and no templates for other platform could be used for a good starting point to create my own makefile. Additionally, i've never had to deal with makefiles, i really have no chance to sort out these problems. Even if it succeeds, i will probably need a configure tool as well, since i have no idea how ndk-build manages to install SDL2 without configure scripts.

编译该项目的SDL源一起是唯一的工作 - 但丑陋的解决方案。我想部署必要的lib和是make install头文件。

Compiling the SDL sources with the project together is the only working - but ugly solution. I would like to deploy the necessary lib and header files by make install.

我希望的解决方案是东西非常容易和明显的事情,我只是没想到...

I hope the solution is something really easy and obvious thing that i just didn't think about...

推荐答案

此问题已被固定在 http://hg.libsdl.org/SDL/rev/4e57cfd9fca8 并预计2.0.4版。注意,有大约定义了一些相关的修复较新的版本。

This issue has been fixed at http://hg.libsdl.org/SDL/rev/4e57cfd9fca8 and expected for the 2.0.4 release. Note there are newer revisions with some related fixes about defines.

这篇关于建筑与SDL2 NDK工具链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆