ubuntu make show complete命令

时间:2018-06-02 17:55:26

标签: linux gcc makefile compilation autotools

我试图在ubuntu上交叉编译libmp3lame,但在某些时候它失败并且错误日志被截断,所以我无法真正发现正在发生的事情

shell输出的最后一行是:

/bin/bash ../libtool  --tag=CC   --mode=link /home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc  -mfloat-abi=softfp -marm -march=armv7-a -Os -O3   -I/home/rafa/Desktop/m2/build_dir/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include/arm-linux-androideabi/ -L/home/rafa/Desktop/m2/build_dir/lib -L/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib -L/home/rafa/Desktop/missao/ndk17/sysroot/usr/lib/arm-linux-androideabi -fPIE       -L/home/rafa/Desktop/m2/build_dir/lib -L/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib -L/home/rafa/Desktop/missao/ndk17/sysroot/usr/lib/arm-linux-androideabi -fPIE -pie   -static  -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o ../libmp3lame/libmp3lame.la -lm 
libtool: link: /home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -mfloat-abi=softfp -marm -march=armv7-a -Os -O3 -I/home/rafa/Desktop/m2/build_dir/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include/arm-linux-androideabi/ -fPIE -fPIE -pie -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o  -L/home/rafa/Desktop/m2/build_dir/lib -L/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib -L/home/rafa/Desktop/missao/ndk17/sysroot/usr/lib/arm-linux-androideabi ../libmp3lame/.libs/libmp3lame.a -lm
/home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory

在:

/home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld

如何强制make显示完整的命令,而不是/../来帮助我了解正在发生的事情

=================== UPDATE ========================

试图弄清楚它是一个非常长的脚本来构建ffmpeg到android [它在编译libmp3lame时失败

我会尝试粘贴相关字段:

export NDK=/home/rafa/Desktop/missao/ndk17

OS="linux-x86_64"
ARM_SYSROOT=$NDK/platforms/android-27/arch-arm
ARM_PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/$OS

CPU=armv7-a
ARCH=arm
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -mtune=cortex-a8 -march=$CPU -Os -O3"
ADDITIONAL_CONFIGURE_FLAG="--enable-neon "
SYSROOT=$ARM_SYSROOT
HOST=arm-linux-androideabi
CROSS_PREFIX=$ARM_PREBUILT/bin/$HOST-
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS "
PREBUILT=$ARM_PREBUILT

TOOLCHAIN=$NDK/sysroot/usr/include/$HOST/
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
export CPP="${CROSS_PREFIX}cpp"
export CXX="${CROSS_PREFIX}g++"
export CC="${CROSS_PREFIX}gcc"
export LD="${CROSS_PREFIX}ld"
export AR="${CROSS_PREFIX}ar"
export NM="${CROSS_PREFIX}nm"
export RANLIB="${CROSS_PREFIX}ranlib"
export LDFLAGS="-L$PREFIX/lib -L$SYSROOT/usr/lib -L$NDK/sysroot/usr/lib/$HOST -fPIE -pie "
export CFLAGS="$OPTIMIZE_CFLAGS -I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN -L$PREFIX/lib -L$SYSROOT/usr/lib -L$NDK/sysroot/usr/lib/$HOST -fPIE " 
export CXXFLAGS="$CFLAGS "
export CPPFLAGS="-I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN --sysroot=$SYSROOT "
export STRIP=${CROSS_PREFIX}strip
export PATH="$PATH:$PREFIX/bin:$NDK/build"

命令:

pushd lame
./configure \
    --prefix=$PREFIX \
    --host=$HOST \
    --enable-static \
    --disable-shared \
    --with-sysroot=/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib

make clean
make  
make install
popd

它正在寻找的文件在

/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib

但是我在sysroot和LDFLAGS设置了这个目录,它仍然无法找到它

1 个答案:

答案 0 :(得分:0)

在测试了几个配置之后,我找到了一个有效,共享的配置        万一有人面临类似的问题

doc.text()

并以:

运行
       export NDK=/home/rafa/Desktop/missao/ndk17

       OS="linux-x86_64"
       ARM_SYSROOT=$NDK/platforms/android-27/arch-arm
       ARM_PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/$OS

       CPU=armv7-a
       ARCH=arm
       OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -mtune=cortex-a8 -march=$CPU -Os -O3"
       ADDITIONAL_CONFIGURE_FLAG="--enable-neon "
       SYSROOT=$ARM_SYSROOT
       HOST=arm-linux-androideabi
       CROSS_PREFIX=$ARM_PREBUILT/bin/$HOST-
       OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS "
       PREBUILT=$ARM_PREBUILT
       export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
       export CPP="${CROSS_PREFIX}cpp"
       export CXX="${CROSS_PREFIX}g++"
       export CC="${CROSS_PREFIX}gcc"
       export LD="${CROSS_PREFIX}ld"
       export AR="${CROSS_PREFIX}ar"
       export NM="${CROSS_PREFIX}nm"
       export RANLIB="${CROSS_PREFIX}ranlib"
       export LDFLAGS="-L$PREFIX/lib -L$SYSROOT/usr/lib -L$NDK/sysroot/usr/lib/$HOST -fPIE -pie --sysroot=$SYSROOT "
       export CFLAGS="$OPTIMIZE_CFLAGS -I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN -fPIE " 
       export CXXFLAGS="$CFLAGS "
       export CPPFLAGS="-I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN --sysroot=$SYSROOT "
       export STRIP=${CROSS_PREFIX}strip
       export PATH="$PATH:$PREFIX/bin:$NDK/build"