¦pªG¥Î xmkmf ©M/©Î make «Ü¦¨¥\¨S¦³¿ù»~, §A¥i¥HµÛ¤â©ó next section. µM¦Ó, ¦b¯u¹ê¥Í¬¡, «Ü¤Ö¨Æ±¡¦b²Ä¤@¦¸´N¥¿½Tªº¤u§@. ³o´N¬O·í§Aªº¾÷´¼Â×´I®É,n«i©ó¹Á¸Õ.
Link error: -lX11:
No such file or directory
, ¬Æ¦Ü¬O¦b¨Ï¥Î xmkmf «á.
³o¥i¯à·N¨ýµÛ Imake ÀɮרS¦³¾A·í¦a¸Ë¦n.
Àˬd Makefile ªº²Ä¤@³¡¤À¦³¨S¦³¹³³o¼Ëªº´X¦æ:
LIB= -L/usr/X11/lib
INCLUDE= -I/usr/X11/include/X11
LIBS= -lX11 -lc -lm
-L
©M -I
¤Á´«¾¹(switches)·|³q§i½sĶ¾¹©M³sµ²¾¹¤À§O¥hþùØ´M§ä library ©M include ÀÉ®×.
¦b³o¨Ò¤l, X11 libraries À³¸Ó¬O¦b /usr/X11/lib
¥Ø¿ý,
¦Ó X11 include ÀÉ®× À³¸Ó¬O¦b /usr/X11/include/X11
¥Ø¿ý.
¦pªG³o¦b§Aªº¾÷¾¹¤W¬O¤£¹ïªº, ¥²¶·§ïÅÜ Makefile ¦Ó¥B¦A¸Õ¸Õ
make.
make -DUseInstalled -I/usr/X386/lib/X11/config
R5 libs
¬O¦³ libX11.so.3.1.0
, libXaw.so.3.1.0
,
©M libXt.so.3.1.0
. ¤@¯ë§A»Ýn³sµ²¦Ü, ¹³¬O
libX11.so.3 -> libX11.so.3.1.0.
¤j·§³nÅé¤]»Ýn³oӧΦ¡³sµ² libX11.so -> libX11.so.3.1.0.
·íµM, n±N³o"Â_±¼(missing)"ªº³sµ²«Ø¦n, n¥H root ¨¤À¨Ï¥Î³o«ü¥O
ln -s libX11.so.3.1.0 libX11.so.
libc
version 5.4.4 ©Î§ó·s. ¥H root¨¤À,
§A»Ýn½Æ»s¤@Ó©Î¥H¤Wªº¨ç¦¡®w(libraries)¦Ü¦X¾Aªº¥Ø¿ý,
§R¥hªº¨ç¦¡®w(libraries),µM«á«³]²Å¸¹³sµ².
¤p¤ß: ¦b³on®æ¥~ª`·N, ¦]¬°¦pªG§A§ËÁV, §A¥i¯à·|¥I¥X§Aªº¨t²Î¤£¯à¹B§@ªº¥N»ù.
§A³q±`¥i¥H§ä¨ì¤É¯Åªº¨ç¦¡®w(libraries)¦b
Sunsite.
No such file or directory
¿ù»~°T®§. ¦b³o±¡ªp,ÀˬdÀÉ®×Åv¨Ó½T©wÀÉ®×¥i°õ¦æ
¥H¤ÎÀˬdÀÉ®×¼ÐÀY¬O§_§t¦³¨Ï¥Î shell ©Îµ{¦¡, «ü©ú script ©Ò¦b¦a¤è.
Á|¨Ò¦Ó¨¥, script ¶}©l¦p:
#!/usr/local/bin/perl
¦pªG Perl ¹ê»Ú¸Ë¦b§Aªº /usr/bin
¥Ø¿ý,
¦Ó¤£¬O /usr/local/bin
¥Ø¿ý, ¨º»ò script µLªk°õ¦æ.
¦³¨âÓ¤èªk¨Óקï. script ÀÉ®×¼ÐÀY§ï¦¨ #!/usr/bin/perl
,
©Î¥Î²Å¸¹³sµ²¦Ü¥¿½Tªº¥Ø¿ý, ln -s
/usr/bin/perl /usr/local/bin/perl.
Motif
¨ç¦¡®w(libraries)¤~¯à«Ø¥ß.
¦Ó¼Ð·Çªº Linux µo¦æ®M¥ó¨Ã¨S¦³¦w¸Ë Motif libraries, ¦Ó¥B¥Ø«e Motif
ÁÙnÃB¥~ $100-$200 ªºªá¶O (ÁöµM§K¶O³nÅé
Lesstif ¦b¬Y¨Ç³õ¦X¤]¯à°÷¥Î).
¦pªG§A»Ýn Motif ¨Ó«Ø¥ß¬Y¤@®M¥ó, ¦ý¯Ê¤Ö Motif libraries,
¨º»ò¤]³\¥i¥H¨ú±o ÀRºA³sµ²ªº¤G¤¸½X(statically linked binaries).
ÀRºA³sµ²¦b¤G¤¸½X¥»¨¯Ç¤J¨ç¦¡®w¦æµ{(library routines).
³o³y¦¨¤G¤¸½XÀɮפj¤F³\¦h, ¦ý¬O½X¥i¦b¯Ê¤Ö¸Ó¨ç¦¡®wªº¨t²Î¤W°õ¦æ.
Makefile
,
¨º¹³¬O»P§A©Òn³]ªk«Ø¥ßªº®M¥ó½¤£¬Û¤z. ³oªí¥Ü¶]µÛ¿ù»~ªº configure,
¨ä§ä¨ì§Aªº path ¤W¬Y³B¨ä¥Lªº configure. ©Ò¥Hn¤U configure «ü¥O
À³¸Ón¤U¦¨ ./configure §Y¥Ø«e¥Ø¿ý¤Uªº.
ĵ§i: ¤@Ó¦³ setuid ¦¨ root ªºµ{¦¡¥i¯à´£¥X¹ï§Aªº¨t²Î¦³¦w¥þ¤Wªº·ÀI. ³oÓµ{¦¡¥i¥H root Åv¤O¨Ó¶]¦Ó©Ò¥H¦³¬Y¨Ç¯}®`ªº¼ç¦b©Ê. ¦b³]©w setuid bit «e, ½T©w§Aª¾¹D¸Óµ{¦¡¦b°µ¤°»ò, ¥²n®É¬Ý¤@¤Uì©l½X.
§A¥i¯à§Æ±æÀˬd Makefile
¨Ó½T©w¦³¿ï¥Î¹ï§A¨t²Î³Ì¨Î½sĶ¿ï¶µ.
Á|¨Ò¨Ó»¡, ³]©w -O2 ºX¼Ð¨Ó¿ï³Ì°ª¼h¯Åªº³Ì¨Î¤Æ¦Ó
-fomit-frame-pointer ºX¼Ð¨Ó³y³Ì¤p¤G¤¸½X
(ÁöµM debugging ·|¨S¦³¥´¶}). °£«D§Aª¾¹D§A¦b°µ¤°»ò,
¦Ó¥B¦b¥ô¦ó±¡ªp¤U, °£«DÁ}W«Ø¥ßªº¤u§@¤w§¹¦¨, §_«h¤£nª±³o¨Ç.
¦b§Úªº¸gÅç, ¤j·§25%ªºÀ³¥Îµ{¦¡«Ø¥ß"§¹¥þ¨S¦³§xÃø".
¥t¥~¤j¬ù50%¯à"³Q»¡ªA"ªº«Ø¥ß, n¥I¥X§V¤Oªº½d³ò±qµL²á¨ì·¥¬°§xÃø.
¨º¤´µMªí¥Ü¦³¬Y¨Ç®M¥óµL½×¦p¦ó³£µLªk«Ø¥ß. §Y¨Ï¨º¼Ë, ¨º¨Ç
Intel ELF
©M/©Î a.out
¤G¤¸½X, ¤]¥i¯à¦b
Sunsite,
TSX-11 archive ©Î¨ä¥¦¦a¤è§ä¨ì.
¤]³\, ³nÅ骺³Ð³yªÌ¥i¥H´£¨Ñ½sĶ¦nªº¤G¤¸½Xµ¹§Aªº¯S§Oªº¾÷¾¹¨Ï¥Î.
ª`·Nªº¬O¦pªG§A¨ú±o¹w¥ý½sĶ¦nªº¤G¤¸½X, §A·|»ÝnÀˬd¬O§_»P§Aªº¨t²Î¬Û®e:
³o¤G¤¸½X¥²¶·¦b§Aªº µwÅé¤W¶] (i.e., Intel x86).
³o¤G¤¸½X¥²¶·»P§Aªº®Ö¤ß(kernel)¬Û®e (i.e., a.out ©Î ELF).
§Aªº¨ç¦¡®w(libraries)¥²¶·¬O³Ì·sªº.
¦pªG¥þ³£¥¢±Ñ, §A¥i¥H¦b¦X¾Aªº ·s»D¸s²Õ´M¨DÀ°¦£, ¹³¬O¦b comp.os.linux.x ©Î comp.os.linux.development. ¸U¤@§A¥u¬O¤£°÷©¯¹Bªº¸Ü, ¼K, ¸Õ¸Õ¤]¬O¦³½ìªº.