【记录】尝试去搞懂cygwin下编译buildroot期间,对于mpfr是如何编译生成并安装cygmpfr-4.dll到buildroot的output/host/usr/bin目录下的

【背景】

折腾:

【未解决】再次研究:Cygwin下编译Buildroot时在编译libtool-2.2.10时出错:/usr/lib/gcc/i686-pc-cygwin/4.7.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

期间,已经搞懂问题原因了:

就是

cygwin下编译buildroot时,估计是最后编译生成并安装对应的mpfr的库文件:

cygmpfr-4.dll

然后拷贝到了:

buildroot的output/host/usr/bin目录:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

然后由于后面./configure配置libtool时,传入的PATH中,

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

放在了

/bin

之前,导致底层验证c编译器时,cc1执行期间,搜到其所依赖的库文件:

cygmpfr-4.dll

不是所希望搜到的,正确的:

/bin/cygmpfr-4.dll

而是此处的:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll

从而导出出错的。

而此处,其实,对于解决办法来说:

已经可以通过:

把/bin放在PATH的最开始

就可以解决问题了:

使得cc1搜cygmpfr-4.dll找到的是正确的/bin/cygmpfr-4.dll

但是,还是没有完完全全的,真正彻底的搞清楚:

为何此处,在cygwin下,会编译生成和安装对应的cygmpfr-4.dll

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/

下面。

其具体的逻辑,过程,是什么;

是不是有什么其他办法,可以避免安装此cygmpfr-4.dll库文件?

等等。

所以,还是先要去搞懂此处生成和安装cygmpfr-4.dll的逻辑才可以。

【折腾过程】

1. 目测,看起来像是:

在buildroot的编译期间,会去编译对应的mpfr的库的,对应编译的源码,很明显是:

output\build\host-mpfr-3.1.2

此处即:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-mpfr-3.1.2

然后,去看看,是如何生成这个cygmpfr-4.dll的。

2. 看了半天,不知道如何buildroot编译mpfr期间,是如何生成cygmpfr-4.dll的。

3.能找到和mpfr-4.dll有关的,只有一个:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-mpfr-3.1.2\config.log

中有:

LIBMPFR_LDFLAGS=' -Wl,--output-def,.libs/libmpfr-4.dll.def'

4.另外去看了看:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\package\mpfr\mpfr.mk

内容是:

#############################################################
#
# mpfr
#
#############################################################

MPFR_VERSION = 3.1.2
MPFR_SITE = http://www.mpfr.org/mpfr-$(MPFR_VERSION)
MPFR_SOURCE = mpfr-$(MPFR_VERSION).tar.bz2
MPFR_LICENSE = LGPLv3+
MPFR_LICENSE_FILES = COPYING.LESSER
MPFR_INSTALL_STAGING = YES
MPFR_DEPENDENCIES = gmp
MPFR_MAKE_OPT = RANLIB=$(TARGET_RANLIB)

$(eval $(autotools-package))
$(eval $(host-autotools-package))

也没啥特殊的。

5.然后对于:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-mpfr-3.1.2\configure

中,有关于dll的配置:

cygwin* | mingw* | pw32* | cegcc*)
  version_type=windows
  shrext_cmds=".dll"

但是其他也没找到有效的内容。

6. 其实早就可以猜测到,应该是

mpfr的make install安装了此编译出来的库文件cygmpfr-4.dll到host/usr/bin下面的

所以,看来只能:

重新make clean

然后再make,在想办法,保留mpfr编译的详细输出内容,看看具体是如何编译和make install这个cygmpfr-4.dll的。

7.不过,还是先去分析分析,看看从Makefile的install中,能否找到具体逻辑。

8.结果是可以找到的:

在:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-mpfr-3.1.2\config.log

中,已经是:

$ ./configure --prefix=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr --sysconfdir=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc --enable-shared --disable-static --disable-gtk-doc --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no

了,即对应的:

--prefix=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr

已经说明了,对应的安装目录,就是:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr

对应的,bin目录的内容,就是安装到:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

了。

9.然后就是找到,如何生成这个cygmpfr-4.dll了。

后来是,参考之前的log:

【记录】cygwin下编译buildroot的编译log输出记录

然后发现了对应的部分:

/bin/sh ../libtool --tag=CC   --mode=link /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /usr/bin/gcc  -O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -ffloat-store -no-undefined -Wl,--output-def,.libs/libmpfr-4.dll.def -version-info 5:2:1 -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -o libmpfr.la -rpath /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib exceptions.lo extract.lo uceil_exp2.lo uceil_log2.lo ufloor_log2.lo add.lo add1.lo add_ui.lo agm.lo clear.lo cmp.lo cmp_abs.lo cmp_si.lo cmp_ui.lo comparisons.lo div_2exp.lo div_2si.lo div_2ui.lo div.lo div_ui.lo dump.lo eq.lo exp10.lo exp2.lo exp3.lo exp.lo frac.lo frexp.lo get_d.lo get_exp.lo get_str.lo init.lo inp_str.lo isinteger.lo isinf.lo isnan.lo isnum.lo const_log2.lo log.lo modf.lo mul_2exp.lo mul_2si.lo mul_2ui.lo mul.lo mul_ui.lo neg.lo next.lo out_str.lo printf.lo vasprintf.lo const_pi.lo pow.lo pow_si.lo pow_ui.lo print_raw.lo print_rnd_mode.lo reldiff.lo round_prec.lo set.lo setmax.lo setmin.lo set_d.lo set_dfl_prec.lo set_exp.lo set_rnd.lo set_f.lo set_prc_raw.lo set_prec.lo set_q.lo set_si.lo set_str.lo set_str_raw.lo set_ui.lo set_z.lo sqrt.lo sqrt_ui.lo sub.lo sub1.lo sub_ui.lo rint.lo ui_div.lo ui_sub.lo urandom.lo urandomb.lo get_z_exp.lo swap.lo factorial.lo cosh.lo sinh.lo tanh.lo sinh_cosh.lo acosh.lo asinh.lo atanh.lo atan.lo cmp2.lo exp_2.lo asin.lo const_euler.lo cos.lo sin.lo tan.lo fma.lo fms.lo hypot.lo log1p.lo expm1.lo log2.lo log10.lo ui_pow.lo ui_pow_ui.lo minmax.lo dim.lo signbit.lo copysign.lo setsign.lo gmp_op.lo init2.lo acos.lo sin_cos.lo set_nan.lo set_inf.lo set_zero.lo powerof2.lo gamma.lo set_ld.lo get_ld.lo cbrt.lo volatile.lo fits_sshort.lo fits_sint.lo fits_slong.lo fits_ushort.lo fits_uint.lo fits_ulong.lo fits_uintmax.lo fits_intmax.lo get_si.lo get_ui.lo zeta.lo cmp_d.lo erf.lo inits.lo inits2.lo clears.lo sgn.lo check.lo sub1sp.lo version.lo mpn_exp.lo mpfr-gmp.lo mp_clz_tab.lo sum.lo add1sp.lo free_cache.lo si_op.lo cmp_ld.lo set_ui_2exp.lo set_si_2exp.lo set_uj.lo set_sj.lo get_sj.lo get_uj.lo get_z.lo iszero.lo cache.lo sqr.lo int_ceil_log2.lo isqrt.lo strtofr.lo pow_z.lo logging.lo mulders.lo get_f.lo round_p.lo erfc.lo atan2.lo subnormal.lo const_catalan.lo root.lo sec.lo csc.lo cot.lo eint.lo sech.lo csch.lo coth.lo round_near_x.lo constant.lo abort_prec_max.lo stack_interface.lo lngamma.lo zeta_ui.lo set_d64.lo get_d64.lo jn.lo yn.lo rem1.lo get_patches.lo add_d.lo sub_d.lo d_sub.lo mul_d.lo div_d.lo d_div.lo li2.lo rec_sqrt.lo min_prec.lo buildopt.lo digamma.lo bernoulli.lo isregular.lo set_flt.lo get_flt.lo scale2.lo set_z_exp.lo ai.lo gammaonethird.lo grandom.lo  -lgmp
libtool: link: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /usr/bin/gcc -shared  .libs/exceptions.o .libs/extract.o .libs/uceil_exp2.o .libs/uceil_log2.o .libs/ufloor_log2.o .libs/add.o .libs/add1.o .libs/add_ui.o .libs/agm.o .libs/clear.o .libs/cmp.o .libs/cmp_abs.o .libs/cmp_si.o .libs/cmp_ui.o .libs/comparisons.o .libs/div_2exp.o .libs/div_2si.o .libs/div_2ui.o .libs/div.o .libs/div_ui.o .libs/dump.o .libs/eq.o .libs/exp10.o .libs/exp2.o .libs/exp3.o .libs/exp.o .libs/frac.o .libs/frexp.o .libs/get_d.o .libs/get_exp.o .libs/get_str.o .libs/init.o .libs/inp_str.o .libs/isinteger.o .libs/isinf.o .libs/isnan.o .libs/isnum.o .libs/const_log2.o .libs/log.o .libs/modf.o .libs/mul_2exp.o .libs/mul_2si.o .libs/mul_2ui.o .libs/mul.o .libs/mul_ui.o .libs/neg.o .libs/next.o .libs/out_str.o .libs/printf.o .libs/vasprintf.o .libs/const_pi.o .libs/pow.o .libs/pow_si.o .libs/pow_ui.o .libs/print_raw.o .libs/print_rnd_mode.o .libs/reldiff.o .libs/round_prec.o .libs/set.o .libs/setmax.o .libs/setmin.o .libs/set_d.o .libs/set_dfl_prec.o .libs/set_exp.o .libs/set_rnd.o .libs/set_f.o .libs/set_prc_raw.o .libs/set_prec.o .libs/set_q.o .libs/set_si.o .libs/set_str.o .libs/set_str_raw.o .libs/set_ui.o .libs/set_z.o .libs/sqrt.o .libs/sqrt_ui.o .libs/sub.o .libs/sub1.o .libs/sub_ui.o .libs/rint.o .libs/ui_div.o .libs/ui_sub.o .libs/urandom.o .libs/urandomb.o .libs/get_z_exp.o .libs/swap.o .libs/factorial.o .libs/cosh.o .libs/sinh.o .libs/tanh.o .libs/sinh_cosh.o .libs/acosh.o .libs/asinh.o .libs/atanh.o .libs/atan.o .libs/cmp2.o .libs/exp_2.o .libs/asin.o .libs/const_euler.o .libs/cos.o .libs/sin.o .libs/tan.o .libs/fma.o .libs/fms.o .libs/hypot.o .libs/log1p.o .libs/expm1.o .libs/log2.o .libs/log10.o .libs/ui_pow.o .libs/ui_pow_ui.o .libs/minmax.o .libs/dim.o .libs/signbit.o .libs/copysign.o .libs/setsign.o .libs/gmp_op.o .libs/init2.o .libs/acos.o .libs/sin_cos.o .libs/set_nan.o .libs/set_inf.o .libs/set_zero.o .libs/powerof2.o .libs/gamma.o .libs/set_ld.o .libs/get_ld.o .libs/cbrt.o .libs/volatile.o .libs/fits_sshort.o .libs/fits_sint.o .libs/fits_slong.o .libs/fits_ushort.o .libs/fits_uint.o .libs/fits_ulong.o .libs/fits_uintmax.o .libs/fits_intmax.o .libs/get_si.o .libs/get_ui.o .libs/zeta.o .libs/cmp_d.o .libs/erf.o .libs/inits.o .libs/inits2.o .libs/clears.o .libs/sgn.o .libs/check.o .libs/sub1sp.o .libs/version.o .libs/mpn_exp.o .libs/mpfr-gmp.o .libs/mp_clz_tab.o .libs/sum.o .libs/add1sp.o .libs/free_cache.o .libs/si_op.o .libs/cmp_ld.o .libs/set_ui_2exp.o .libs/set_si_2exp.o .libs/set_uj.o .libs/set_sj.o .libs/get_sj.o .libs/get_uj.o .libs/get_z.o .libs/iszero.o .libs/cache.o .libs/sqr.o .libs/int_ceil_log2.o .libs/isqrt.o .libs/strtofr.o .libs/pow_z.o .libs/logging.o .libs/mulders.o .libs/get_f.o .libs/round_p.o .libs/erfc.o .libs/atan2.o .libs/subnormal.o .libs/const_catalan.o .libs/root.o .libs/sec.o .libs/csc.o .libs/cot.o .libs/eint.o .libs/sech.o .libs/csch.o .libs/coth.o .libs/round_near_x.o .libs/constant.o .libs/abort_prec_max.o .libs/stack_interface.o .libs/lngamma.o .libs/zeta_ui.o .libs/set_d64.o .libs/get_d64.o .libs/jn.o .libs/yn.o .libs/rem1.o .libs/get_patches.o .libs/add_d.o .libs/sub_d.o .libs/d_sub.o .libs/mul_d.o .libs/div_d.o .libs/d_div.o .libs/li2.o .libs/rec_sqrt.o .libs/min_prec.o .libs/buildopt.o .libs/digamma.o .libs/bernoulli.o .libs/isregular.o .libs/set_flt.o .libs/get_flt.o .libs/scale2.o .libs/set_z_exp.o .libs/ai.o .libs/gammaonethird.o .libs/grandom.o   -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/libgmp.lib  -O2 -Wl,--output-def -Wl,.libs/libmpfr-4.dll.def -Wl,-rpath -Wl,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib   -o .libs/cygmpfr-4.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libmpfr.dll.a
libtool: link: ( cd ".libs" && rm -f "libmpfr.la" && ln -s "../libmpfr.la" "libmpfr.la" )
make[3]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/src'
make[2]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/src'
Making all in tests
make[2]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/tests'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/tests'
Making all in tune
make[2]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/tune'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/tune'
make[2]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2'
make[1]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2'
>>> host-mpfr 3.1.2 Installing to host directory
PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin:/opt/crosstool-ng/bin:/home/CLi/develop/crosstool-ng/x-tools/armxscalecurl/bin:/usr/local/bin:/usr/bin:/cygdrive/d/tmp/dev_install_root/Python27_x64:/cygdrive/d/tmp/dev_install_root/Python27_x64/Lib/site-packages/PyQt4:/cygdrive/d/tmp/dev_install_root/Perl64/site/bin:/cygdrive/d/tmp/dev_install_root/Perl64/bin:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/cygdrive/d/tmp/WordPress/mysql/mysql-5.5.18/MySQL/MySQL Server 5.5/bin:/cygdrive/d/tmp/WordPress/DevRoot/MySQL/MySQL Server 5.5/bin:/cygdrive/d/tmp/WordPress/DevRoot/php-5.3.6-Win32-VC9-x64:/cygdrive/d/tmp/WordPress/DevRoot/php-5.3.6-Win32-VC9-x64/ext:/cygdrive/d/tmp/WordPress/DevRoot/Python27:/cygdrive/c/Program Files (x86)/Common Files/Acronis/SnapAPI:/cygdrive/c/Program Files (x86)/Windows Live/Shared:/cygdrive/c/Program Files/Java/jdk1.7.0_11/bin:/home/CLi/develop/docbook/tools/fop/lib:/home/CLi/develop/docbook/tools/fop:/cygdrive/d/DevInstallRoot/FF/DD_IDE_1.1.2/TOK/BIN:/cygdrive/d/DevInstallRoot/FF/DD_IDE_1.2.0/TOK/BIN:/cygdrive/d/DevRoot/EmbeddedDevelop/trunk/Research/CLI/FF/FBK/develop/tools/develop-tools:/cygdrive/d/tmp/WordPress/DevRoot/Python27/Scripts:/cygdrive/d/tmp/dev_install_root/PostgreSQL/8.3/bin:/cygdrive/d/tmp/dev_install_root/ant/apache-ant-1.8.4/bin:/cygdrive/c/Program Files/nodejs:/cygdrive/c/Program Files/Microsoft/Web Platform Installer:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/d/DevRoot/IndustrialMobileAutomation/HandheldDataSetter/ANTLR/batchFile:/cygdrive/c/Program Files (x86)/QuickTime/QTSystem:/cygdrive/d/tmp/tmp_dev_root/android/adt-bundle-windows/sdk/platform-tools:/cygdrive/d/tmp/dev_install_root/Tesseract-OCR:/cygdrive/d/tmp/dev_install_root/jython2.5.3/bin:/cygdrive/d/devinstallroot/gnuarm/bin:/cygdrive/d/tmp/dev_install_root/HTML Help Workshop:/cygdrive/c/Users/CLi/AppData/Roaming/npm:/usr/lib/lapack:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include/linux" LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:" PKG_CONFIG="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig" PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"  /usr/bin/make -j4 -C /home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/ install
make[1]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2'
Making install in doc
make[2]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/doc'
make[3]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/doc'
make[3]: Nothing to be done for `install-exec-am'.
 /usr/bin/mkdir -p '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/doc/mpfr'
 /usr/bin/mkdir -p '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/info'
 /usr/bin/install -c -m 644 FAQ.html '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/doc/mpfr'
 /usr/bin/install -c -m 644 ./mpfr.info '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/info'
 install-info --info-dir='/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/info' '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/info/mpfr.info'
make[3]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/doc'
make[2]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/doc'
Making install in src
make[2]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/src'
/usr/bin/make  install-am
make[3]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/src'
make[4]: Entering directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/src'
 /usr/bin/mkdir -p '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib'
 /usr/bin/mkdir -p '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libmpfr.la '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib'
libtool: install: /usr/bin/install -c .libs/libmpfr.dll.a /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/libmpfr.dll.a
 /usr/bin/install -c -m 644 mpfr.h mpf2mpfr.h '/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include'
libtool: install: base_file=`basename libmpfr.la`
libtool: install:  dlpath=`/bin/sh 2>&1 -c '. .libs/'libmpfr.la'i; echo cygmpfr-4.dll'`
libtool: install:  dldir=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/`dirname ../bin/cygmpfr-4.dll`
libtool: install:  test -d /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin || mkdir -p /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin
libtool: install:  /usr/bin/install -c .libs/cygmpfr-4.dll /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin/cygmpfr-4.dll
libtool: install:  chmod a+x /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin/cygmpfr-4.dll
libtool: install:  if test -n '' && test -n 'strip --strip-unneeded'; then eval 'strip --strip-unneeded /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin/cygmpfr-4.dll' || exit 0; fi
libtool: install: /usr/bin/install -c .libs/libmpfr.lai /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/libmpfr.la
make[4]: Leaving directory `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-mpfr-3.1.2/src'

其中,包含了:

libtool: link: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /usr/bin/gcc -shared  xxx.o xxx.o xxx.o -Lxxx /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/libgmp.lib  -O2 -Wl,--output-def -Wl,.libs/libmpfr-4.dll.def -Wl,-rpath -Wl,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib   -o .libs/cygmpfr-4.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libmpfr.dll.a

用于生成对应的cygmpfr-4.dll

然后再去install:

libtool: install:  dlpath=`/bin/sh 2>&1 -c '. .libs/'libmpfr.la'i; echo cygmpfr-4.dll'`
libtool: install:  dldir=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/`dirname ../bin/cygmpfr-4.dll`
libtool: install:  test -d /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin || mkdir -p /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin
libtool: install:  /usr/bin/install -c .libs/cygmpfr-4.dll /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin/cygmpfr-4.dll
libtool: install:  chmod a+x /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin/cygmpfr-4.dll
libtool: install:  if test -n '' && test -n 'strip --strip-unneeded'; then eval 'strip --strip-unneeded /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin/cygmpfr-4.dll' || exit 0; fi

中的:

libtool: install:  /usr/bin/install -c .libs/cygmpfr-4.dll /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin/cygmpfr-4.dll

把cygmpfr-4.dll安装到对应的:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/../bin

即:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

中去的。

至此,算是基本清楚了:

貌似在cygwin下,编译buildroot中的mpfr时,按照逻辑,貌似也的确是应该编译生成对应的mpfr的库:

cygmpfr-4.dll

最终会安装到:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

中的。

10.所以,知道了现象和基本逻辑后,那么结论就是:

此处,还是不用理会mpfr编译生成安装

cygmpfr-4.dll

到:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

还是想办法,避开此cygmpfr-4.dll。

还是用之前的办法:

把/bin加上PATH最开始,应该就算是最佳解决办法了。

 

【总结】

此处,基本搞懂了,cygwin下编译buildroot期间,如何编译生成cygmpfr-4.dll,并安装到

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

的逻辑:

1.cygwin中编译buildroot期间,在用./configure去配置mpfr时,给定了参数:

--prefix=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr

说明了要安装的目标文件夹,就是

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/

了。

2.编译期间,最终通过把一堆的.o文件,去链接link,生成最终的cygmpfr-4.dll

3.安装期间,把对应的cygmpfr-4.dll,安装到了

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

目录下了。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量