½ñÌìÒª¶ÔÒ»Ì׳ÌÐò½øÐн»²æ±àÒ룬ÕâÌ׳ÌÐòÊÇ´øÓÐconfigureµÄ¡£
¿ªÊ¼±¾À´ÏëÓñȽϱ¿×¾µÄ°ì·¨£¬Öð¸öÐÞ¸ÄMakefile
ºóÀ´¾Áõ²©ÌáÐÑ£¬¿ÉÒÔÑо¿Ò»ÏÂconfigureµÄÉèÖÃ
googleÁËÒ»·¬ÓÐÁËÒÔÏÂÐĵÃ
configureµÄ²ÎÊýÖڶ࣬һ°ã°üÀ¨ÈçÏÂ
--srcdir=DIR
Õâ¸öÑ¡Ïî¶Ô°²×°Ã»ÓÐ×÷ÓÃ.Ëû»á¸æËß'configure'Ô´ÂëµÄλÖÃ.Ò»°ãÀ´Ëµ²»ÓÃÖ¸¶¨´ËÑ¡Ïî,ÒòΪ'configure'½Å±¾Ò»°ãºÍÔ´ÂëÎļþÔÚͬһ¸öĿ¼ÏÂ.
--program-prefix=PREFIX
Ö¸¶¨½«±»¼Óµ½Ëù°²×°³ÌÐòµÄÃû×ÖÉϵÄǰ׺.ÀýÈç,ʹÓÃ'--program-prefix=g'À´configureÒ»¸öÃûΪ'tar'µÄ³ÌÐò½«»áʹ°²×°µÄ³ÌÐò±»ÃüÃûΪ'gtar'.µ±ºÍÆäËûµÄ°²×°Ñ¡ÏîÒ»ÆðʹÓÃʱ,Õâ¸öÑ¡ÏîÖ»Óе±Ëû±»`Makefile.in'ÎļþʹÓÃʱ²Å»á¹¤×÷.
--program-suffix=SUFFIX
Ö¸¶¨½«±»¼Óµ½Ëù°²×°³ÌÐòµÄÃû×ÖÉϵĺó׺.
--program-transform-name=PROGRAM
ÕâÀïµÄPROGRAMÊÇÒ»¸ösed½Å±¾.µ±Ò»¸ö³ÌÐò±»°²×°Ê±,ËûµÄÃû×Ö½«¾¹ý`sed -e PROGRAM'À´²úÉú°²×°µÄÃû×Ö.
--build=BUILD
Ö¸¶¨Èí¼þ°ü°²×°µÄϵͳƽ̨.Èç¹ûûÓÐÖ¸¶¨,ĬÈÏÖµ½«ÊÇ'--host'Ñ¡ÏîµÄÖµ.
--host=HOST
Ö¸¶¨Èí¼þÔËÐеÄϵͳƽ̨.Èç¹ûûÓÐÖ¸¶¨,½«»áÔËÐÐ`config.guess'À´¼ì²â.
--target=GARGET
Ö¸¶¨Èí¼þÃæÏò(target to)µÄϵͳƽ̨.ÕâÖ÷ÒªÔÚ³ÌÐòÓïÑÔ¹¤¾ßÈç±àÒëÆ÷ºÍ»ã±àÆ÷ÉÏÏÂÎÄÖÐÆð×÷ÓÃ.Èç¹ûûÓÐÖ¸¶¨,ĬÈϽ«Ê¹ÓÃ'--host'Ñ¡ÏîµÄÖµ.
--disable-FEATURE
һЩÈí¼þ°ü¿ÉÒÔÑ¡ÔñÕâ¸öÑ¡ÏîÀ´ÌṩΪ´óÐÍÑ¡ÏîµÄ±àÒëʱÅäÖÃ,ÀýÈçʹÓÃKerberosÈÏ֤ϵͳ»òÕßÒ»¸öʵÑéÐԵıàÒëÆ÷×îÓÅÅäÖÃ.Èç¹ûĬÈÏÊÇÌṩÕâЩÌØÐÔ,¿ÉÒÔʹÓÃ'--disable-FEATURE'À´½ûÓÃËü,ÕâÀï'FEATURE'ÊÇÌØÐÔµÄÃû×Ö.ÀýÈç:
$ ./configure --disable-gui
-enable-FEATURE[=ARG]
Ïà·´µÄ,һЩÈí¼þ°ü¿ÉÄÜÌṩÁËһЩĬÈϱ»½ûÖ¹µÄÌØÐÔ,¿ÉÒÔʹÓÃ'--enable-FEATURE'À´ÆðÓÃËü.ÕâÀï'FEATURE'ÊÇÌØÐÔµÄÃû×Ö.Ò»¸öÌØÐÔ¿ÉÄÜ»á½ÓÊÜÒ»¸ö¿ÉÑ¡µÄ²ÎÊý.ÀýÈç:
$ ./configure --enable-buffers=128
`--enable-FEATURE=no'ÓëÉÏÃæÌáµ½µÄ'--disable-FEATURE'ÊÇͬÒåµÄ.
--with-PACKAGE[=ARG]
ÔÚ×ÔÓÉÈí¼þÉçÇøÀï,ÓÐʹÓÃÒÑÓÐÈí¼þ°üºÍ¿âµÄÓÅÐ㴫ͳ.µ±ÓÃ'configure'À´ÅäÖÃÒ»¸öÔ´ÂëÊ÷ʱ,¿ÉÒÔÌṩÆäËûÒѾ°²×°µÄÈí¼þ°üµÄÐÅÏ¢.ÀýÈç, ÒÐÀµÓÚTclºÍTkµÄBLTÆ÷¼þ¹¤¾ß°ü.ÒªÅäÖÃBLT,¿ÉÄÜÐèÒª¸ø'configure'ÌṩһЩ¹ØÓÚÎÒÃÇ°ÑTclºÍTk×°µÄºÎ´¦µÄÐÅÏ¢:
$ ./configure --with-tcl=/usr/local --with-tk=/usr/local
'--with-PACKAGE=no'ÓëÏÂÃ潫Ìáµ½µÄ'--without-PACKAGE'ÊÇͬÒåµÄ.
--without-PACKAGE
ÓÐʱºòÄã¿ÉÄܲ»ÏëÈÃÄãµÄÈí¼þ°üÓëϵͳÒÑÓеÄÈí¼þ°ü½»»¥.ÀýÈç,Äã¿ÉÄܲ»ÏëÈÃÄãµÄбàÒëÆ÷ʹÓÃGNU ld.ͨ¹ýʹÓÃÕâ¸öÑ¡Ïî¿ÉÒÔ×öµ½ÕâÒ»µã:
$ ./configure --without-gnu-ld
--x-includes=DIR
Õâ¸öÑ¡ÏîÊÇ'--with-PACKAGE'Ñ¡ÏîµÄÒ»¸öÌØÀý.ÔÚAutoconf×î³õ±»¿ª·¢³öÀ´Ê±,Á÷ÐÐʹÓÃ'configure'À´×÷Ϊ ImakeµÄÒ»¸ö±äͨ·½·¨À´ÖÆ×÷ÔËÐÐÓÚXµÄÈí¼þ.'--x-includes'Ñ¡ÏîÌṩÁËÏò'configure'½Å±¾Ö¸Ã÷°üº¬X11Í·ÎļþµÄĿ¼µÄ·½·¨.
--x-libraries=DIR
ÀàËƵÄ,'--x-libraries'Ñ¡ÏîÌṩÁËÏò'configure'½Å±¾Ö¸Ã÷°üº¬X11¿âµÄĿ¼µÄ·½·¨.
==========================
ºìÉ«¸ßÁÁÕâÒ»¸ö²ÎÊýÊÇÎÒÃǽ»²æ±àÒëÓ¦ÓõÄÖصã
configure --host=arm-linux Õâ¾ÍÊÇarmµÄ½»²æ±àÒëÑ¡Ïî
configure --host=mipsel-linux Õâ¸ö¾ÍÊÇmipselµÄ½»²æ±àÒëÑ¡Ïî
============================
ÏÂÃæתһƪ¶ÔÎÒÓаïÖúµÄ²©¿Í
ÔÚ½»²æ±àÒëµÄʱºò×ÜÊÇʹÓÃconfigure --host=arm-linux ºÙºÙ µ«ÊÇÔÚCONFIGUREÖÐÓкܶàµÄ²âÊÔ³ÌÐòÊDz»¿ÉÒÔÔÚHOSTÉÏÔËÐеľͻá³öÏÖ£º error: cannot run test program while cross compiling
ÀàËƵĴíÎ󣬿ÉÒÔʹÓÃCACHEFILE½â¾öÕâ¸öÎÊÌ⣬»¹ÒªÐ»Ð»ABSURDÐÖµÄÎÄÕ¸øÎÒµÄÖ¸µ¼¡£
ÎÒÊÇÕâÑù½â¾öµÄµÚÒ»²½£º¼Ç¼Ï´íÎóµÄµØ·½È磺checking abstract socket namespace... configure: error: cannot run test program while cross compiling
×¢Òâµ½abstract socket namespaceÔÚconfigureÖвéÕÒabstract socket¿ÉÒÔ¿´µ½ÀàËÆÕâÑùµÄ½á¹¹
echo "$as_me:$LINENO: checking abstract socket namespace" >&5
echo $ECHO_N "checking abstract socket namespace... $ECHO_C" >&6
if test "${ac_cv_have_abstract_sockets+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
ÆäÖÐac_cv_have_abstract_socketsÊÇÎÒÃÇÒª²éÕҵıäÁ¿
ʹÓÃecho ac_cv_have_abstract_sockets=yes>arm-linux.cache
È»ºó
./configure --host=arm-linux --cache-file=arm-linux.cache
KÕâÑù¾Í¸ã¶¨ÁË
ÁíÍ⣺
1£ºfedora ÖÐ /sbin/init 3 ¹Ø±ÕͼÐνçÃæ
ÓÐЩ configure ÒÀÀµlib ±àÒ룬²¢ÇÒÐèÒªpkg-config Ö§³Ö£¬¿ÉÄÜ
ÐèÒªÉ趨 PKG_CONFIG_PATH »·¾³±äÁ¿£¬ ´Ë±äÁ¿Ö¸ÏòËùÒÀÀµlib µÄxxx.pc
ÃèÊöÎļþ, xxx.pcÃèÐðlib µÄÌØÐÔ,Èç
prefix=/develop/upnp/mips_libupnp
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=/develop/upnp/mips_libupnp/include
Name: libupnp
Description: Linux SDK for UPnP Devices
Version: 1.6.3
ibs: -L${libdir} -lupnp -lthreadutil -lixml
Cflags: -pthread -I${includedir}/upnp
2£ºconfigure ½Å±¾ÅжÏlib ÊÇ·ñ´æÔÚʱÊDzÉÓñàÒëC ÎļþµÄ·½·¨£¬ËùÒÔÓÐʱºò½»²æ±àÒëʱ
¿Éͨ¹ýÐÞ¸Ä configureÎļþͨ¹ý²âÊÔ£¬¾ßÌåÊÇÌí¼Ó -I »òÕß-L Ö¸Ã÷λÖá£
ÓÐЩͨ¹ý --host Ö¸¶¨Ä¿±êƽ̨£¬--host=mipsel-linux £¨libupnp£©
ÓÐЩͨ¹ý --cross-prefix=mipsel-linux- --cross-compile£¨ushare£© Ö¸¶¨£¬
¾ßÌå¿Éͨ¹ýconfigure --help/-h ²é¿´
myfamily0719 ÓÚ 2011-08-02 10:39:18·¢±í:
·Ç³£ºÃ~~~ллÀ²~