2016-08-06 54 views
3

我想交叉編譯libsndfile在intel愛迪生上使用,具有flac功能。我已經成功地編譯FLAC,OGG,和Vorbis到我的交叉工具鏈,但是當我運行./configure它給了我下面的輸出:編譯libsndfile,並沒有找到FLAC

checking for pkg-config... /opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/bin/pkg-config 
checking pkg-config is at least version 0.9.0... yes 
checking for flac >= 1.3.1 ... no 
checking for ogg >= 1.1.3 ... yes 
checking for vorbis >= 1.2.3 ... yes 
checking for vorbisenc >= 1.2.3 ... yes 

configure: WARNING: *** One or more of the external libraries (ie libflac, libogg and 
configure: WARNING: *** libvorbis) is either missing (possibly only the development 
configure: WARNING: *** headers) or is of an unsupported version. 
configure: WARNING: *** 
configure: WARNING: *** Unfortunately, for ease of maintenance, the external libs 
configure: WARNING: *** are an all or nothing affair. 

我的環境變量設置爲這樣:

export SDKTARGETSYSROOT=/opt/poky-edison/1.7.3/sysroots/core2-32-poky-linux 
export PATH=/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/bin:/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/bin/i586-poky-linux:$PATH 
export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT 
export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig 
export CONFIG_SITE=/opt/poky-edison/1.7.3/site-config-core2-32-poky-linux 
export OECORE_NATIVE_SYSROOT="/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux" 
export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT" 
export OECORE_ACLOCAL_OPTS="-I /opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr/share/aclocal" 
export PYTHONHOME=/opt/poky-edison/1.7.3/sysroots/i686-pokysdk-linux/usr 
export CC="i586-poky-linux-gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer --sysroot=$SDKTARGETSYSROOT" 
export CXX="i586-poky-linux-g++ -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer --sysroot=$SDKTARGETSYSROOT -I${SDKTARGETSYSROOT}/usr/include/c++/4.9.1 -I${SDKTARGETSYSROOT}/usr/include/c++/4.9.1/i586-poky-linux" 
export CPP="i586-poky-linux-gcc -E -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer --sysroot=$SDKTARGETSYSROOT" 
export AS="i586-poky-linux-as " 
export LD="i586-poky-linux-ld --sysroot=$SDKTARGETSYSROOT" 
export GDB=i586-poky-linux-gdb 
export STRIP=i586-poky-linux-strip 
export RANLIB=i586-poky-linux-ranlib 
export OBJCOPY=i586-poky-linux-objcopy 
export OBJDUMP=i586-poky-linux-objdump 
export AR=i586-poky-linux-ar 
export NM=i586-poky-linux-nm 
export M4=m4 
export TARGET_PREFIX=i586-poky-linux- 
export CONFIGURE_FLAGS="--target=i586-poky-linux --host=i586-poky-linux --build=i686-linux --with-libtool-sysroot=$SDKTARGETSYSROOT" 
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types" 
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types" 
export LDFLAGS="" 
export CPPFLAGS="" 
export KCFLAGS="--sysroot=$SDKTARGETSYSROOT" 
export OECORE_DISTRO_VERSION="1.7.3" 
export OECORE_SDK_VERSION="1.7.3" 
export ARCH=x86 
export CROSS_COMPILE=i586-poky-linux- 

但flac庫在那裏(在/opt/poky-edison/1.7.3/sysroots/core2-32-poky-linux/usr/local)!我曾嘗試在我編寫的flac庫中添加顯式路徑,但沒有任何區別。有沒有一個特定的地方,我應該嘗試調整路徑?

回答

2

Edison SDK實際上帶有FLAC已經出現,但較舊的版本。將我自己的版本編譯到我的SDK中的usr/local/lib位置並未更新pkgConfig,因爲它將pkgconfig放入/usr/local/ib/pkgconfig

最簡單的解決方案是將環境設置腳本中的:分隔的路徑添加到PKG_CONFIG_PATH變量中。例如,第4行變爲: export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig:$SDKTARGETSYSROOT/usr/local/lib/pkgconfig

您也可以在./config步驟中傳遞路徑,但我認爲將其添加到變量是更好的長期解決方案。