home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / images / ramdisk2.img / usr / lib / perl5 / i586-linux / Config.pm next >
Encoding:
Perl POD Document  |  1995-07-19  |  11.5 KB  |  581 lines

  1. package Config;
  2. require Exporter;
  3. @ISA = (Exporter);
  4. @EXPORT = qw(%Config);
  5.  
  6. $] == 5.001 or die sprintf
  7.     "Perl lib version (5.001) doesn't match executable version (%.3f)\n", $];
  8.  
  9. # This file was created by configpm when Perl was built. Any changes
  10. # made to this file will be lost the next time perl is built.
  11.  
  12. =head1 NAME
  13.  
  14. Config - access Perl configuration option
  15.  
  16. =head1 SYNOPSIS
  17.  
  18.     use Config;
  19.     if ($Config{'cc'} =~ /gcc/) {
  20.     print "built by gcc\n";
  21.     } 
  22.  
  23. =head1 DESCRIPTION
  24.  
  25. The Config module contains everything that was available to the
  26. C<Configure> program at Perl build time.  Shell variables from
  27. F<config.sh> are stored in the readonly-variable C<%Config>, indexed by
  28. their names.
  29.  
  30. =head1 EXAMPLE
  31.  
  32. Here's a more sophisticated example of using %Config:
  33.  
  34.     use Config;
  35.  
  36.     defined $Config{sig_name} || die "No sigs?";
  37.     foreach $name (split(' ', $Config{sig_name})) {
  38.     $signo{$name} = $i;
  39.     $signame[$i] = $name;
  40.     $i++;
  41.     }   
  42.  
  43.     print "signal #17 = $signame[17]\n";
  44.     if ($signo{ALRM}) { 
  45.     print "SIGALRM is $signo{ALRM}\n";
  46.     }   
  47.  
  48. =head1 NOTE
  49.  
  50. This module contains a good example of how to make a variable
  51. readonly to those outside of it.  
  52.  
  53. =cut
  54.  
  55. ##
  56. ## This file was produced by running the Configure script. It holds all the
  57. ## definitions figured out by Configure. Should you modify one of these values,
  58. ## do not forget to propagate your changes by running "Configure -der". You may
  59. ## instead choose to run each of the .SH files by yourself, or "Configure -S".
  60. ##
  61. #
  62. ## Configuration time: Tue Jul 11 10:02:02 EDT 1995
  63. ## Configured by: marc
  64. ## Target system: linux porky.redhat.com 1.2.9 #5 thu jun 8 09:50:07 gmt 1995 i586 
  65. #
  66. ## Variables propagated from previous config.sh file.
  67.  
  68. $config_sh=<<'!END!OF!CONFIG!';
  69. archlib='/usr/lib/perl5/i586-linux'
  70. ccflags='-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL'
  71. cppflags='-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL'
  72. dynamic_ext='DB_File Fcntl GDBM_File ODBM_File POSIX SDBM_File Socket'
  73. extensions='DB_File Fcntl GDBM_File ODBM_File POSIX SDBM_File Socket'
  74. intsize='4'
  75. libpth='/lib /usr/lib /usr/local/lib'
  76. osname='linux'
  77. osvers='1'
  78. sharpbang='#!'
  79. shsharp='true'
  80. sig_name='ZERO HUP INT QUIT ILL TRAP IOT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH LOST PWR UNUSED'
  81. so='so'
  82. startsh='#!/bin/sh'
  83. static_ext=' '
  84. Author=''
  85. CONFIG='true'
  86. Date='$Date'
  87. Header=''
  88. Id='$Id'
  89. Locker=''
  90. Log='$Log'
  91. Mcc='Mcc'
  92. PATCHLEVEL='1'
  93. RCSfile='$RCSfile'
  94. Revision='$Revision'
  95. Source=''
  96. State=''
  97. afs='false'
  98. alignbytes='4'
  99. aphostname=''
  100. archlibexp='/usr/lib/perl5/i586-linux'
  101. archname='i586-linux'
  102. awk='awk'
  103. baserev='5.0'
  104. bash=''
  105. bin='/usr/bin'
  106. binexp='/usr/bin'
  107. bison=''
  108. byacc='byacc'
  109. byteorder='1234'
  110. c=''
  111. castflags='0'
  112. cat='cat'
  113. cc='gcc'
  114. cccdlflags='-fpic'
  115. ccdlflags='-rdynamic'
  116. cf_by='marc'
  117. cf_time='Tue Jul 11 10:02:02 EDT 1995'
  118. chgrp=''
  119. chmod=''
  120. chown=''
  121. clocktype='clock_t'
  122. comm='comm'
  123. compress=''
  124. contains='grep'
  125. cp='cp'
  126. cpio=''
  127. cpp='cpp'
  128. cpp_stuff='42'
  129. cpplast='-'
  130. cppminus='-'
  131. cpprun='gcc -E'
  132. cppstdin='gcc -E'
  133. cryptlib=''
  134. csh='csh'
  135. d_Gconvert='gcvt((x),(n),(b))'
  136. d_access='define'
  137. d_alarm='define'
  138. d_archlib='define'
  139. d_attribut='define'
  140. d_bcmp='define'
  141. d_bcopy='define'
  142. d_bsd='undef'
  143. d_bsdpgrp='undef'
  144. d_bzero='define'
  145. d_casti32='undef'
  146. d_castneg='define'
  147. d_charvspr='undef'
  148. d_chown='define'
  149. d_chroot='define'
  150. d_chsize='undef'
  151. d_closedir='define'
  152. d_const='define'
  153. d_crypt='define'
  154. d_csh='define'
  155. d_cuserid='define'
  156. d_dbl_dig='define'
  157. d_dbm_open='undef'
  158. d_difftime='define'
  159. d_dirnamlen='undef'
  160. d_dlerror='define'
  161. d_dlopen='define'
  162. d_dlsymun='undef'
  163. d_dosuid='define'
  164. d_dup2='define'
  165. d_eunice='undef'
  166. d_fchmod='define'
  167. d_fchown='define'
  168. d_fcntl='define'
  169. d_fd_macros='define'
  170. d_fd_set='define'
  171. d_fds_bits='define'
  172. d_fgetpos='define'
  173. d_flexfnam='define'
  174. d_flock='define'
  175. d_fork='define'
  176. d_fpathconf='define'
  177. d_fsetpos='define'
  178. d_getgrps='define'
  179. d_gethent='define'
  180. d_gethname='undef'
  181. d_getlogin='define'
  182. d_getpgrp2='undef'
  183. d_getpgrp='define'
  184. d_getppid='define'
  185. d_getprior='define'
  186. d_htonl='define'
  187. d_index='undef'
  188. d_isascii='define'
  189. d_killpg='define'
  190. d_link='define'
  191. d_locconv='define'
  192. d_lockf='define'
  193. d_lstat='define'
  194. d_mblen='define'
  195. d_mbstowcs='define'
  196. d_mbtowc='define'
  197. d_memcmp='define'
  198. d_memcpy='define'
  199. d_memmove='define'
  200. d_memset='define'
  201. d_mkdir='define'
  202. d_mkfifo='define'
  203. d_mktime='define'
  204. d_msg='define'
  205. d_msgctl='define'
  206. d_msgget='define'
  207. d_msgrcv='define'
  208. d_msgsnd='define'
  209. d_mymalloc='undef'
  210. d_nice='define'
  211. d_oldsock='undef'
  212. d_open3='define'
  213. d_pathconf='define'
  214. d_pause='define'
  215. d_phostname='undef'
  216. d_pipe='define'
  217. d_portable='define'
  218. d_pwage='undef'
  219. d_pwchange='undef'
  220. d_pwclass='undef'
  221. d_pwcomment='undef'
  222. d_pwexpire='undef'
  223. d_pwquota='undef'
  224. d_readdir='define'
  225. d_readlink='define'
  226. d_rename='define'
  227. d_rewinddir='define'
  228. d_rmdir='define'
  229. d_safebcpy='define'
  230. d_safemcpy='undef'
  231. d_seekdir='define'
  232. d_select='define'
  233. d_sem='define'
  234. d_semctl='define'
  235. d_semget='define'
  236. d_semop='define'
  237. d_setegid='define'
  238. d_seteuid='define'
  239. d_setlinebuf='define'
  240. d_setlocale='define'
  241. d_setpgid='define'
  242. d_setpgrp2='undef'
  243. d_setpgrp='define'
  244. d_setprior='define'
  245. d_setregid='define'
  246. d_setresgid='undef'
  247. d_setresuid='undef'
  248. d_setreuid='define'
  249. d_setrgid='undef'
  250. d_setruid='undef'
  251. d_setsid='define'
  252. d_shm='define'
  253. d_shmat='define'
  254. d_shmatprototype='define'
  255. d_shmctl='define'
  256. d_shmdt='define'
  257. d_shmget='define'
  258. d_shrplib='undef'
  259. d_sitelib='undef'
  260. d_socket='define'
  261. d_sockpair='define'
  262. d_statblks='define'
  263. d_stdio_cnt_lval='undef'
  264. d_stdio_ptr_lval='define'
  265. d_stdiobase='define'
  266. d_stdstdio='define'
  267. d_strchr='define'
  268. d_strcoll='define'
  269. d_strctcpy='define'
  270. d_strerrm='strerror(e)'
  271. d_strerror='define'
  272. d_strxfrm='define'
  273. d_suidsafe='undef'
  274. d_symlink='define'
  275. d_syscall='define'
  276. d_sysconf='define'
  277. d_sysernlst=''
  278. d_syserrlst='define'
  279. d_system='define'
  280. d_tcgetpgrp='define'
  281. d_tcsetpgrp='define'
  282. d_telldir='define'
  283. d_time='define'
  284. d_times='define'
  285. d_truncate='define'
  286. d_tzname='define'
  287. d_umask='define'
  288. d_uname='define'
  289. d_vfork='undef'
  290. d_void_closedir='undef'
  291. d_voidsig='define'
  292. d_voidtty=''
  293. d_volatile='define'
  294. d_vprintf='define'
  295. d_wait4='define'
  296. d_waitpid='define'
  297. d_wcstombs='define'
  298. d_wctomb='define'
  299. d_xenix='undef'
  300. date='date'
  301. db_hashtype='u_int32_t'
  302. db_prefixtype='size_t'
  303. defvoidused='15'
  304. direntrytype='struct dirent'
  305. dlext='so'
  306. dlsrc='dl_dlopen.xs'
  307. echo='echo'
  308. egrep='egrep'
  309. emacs=''
  310. eunicefix=':'
  311. expr='expr'
  312. find='find'
  313. flex=''
  314. fpostype='fpos_t'
  315. freetype='void'
  316. full_csh='/bin/csh'
  317. full_sed='/bin/sed'
  318. gcc=''
  319. gccversion='2.7.0'
  320. gidtype='gid_t'
  321. glibpth='/usr/shlib  /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/local/lib '
  322. grep='grep'
  323. groupcat=''
  324. groupstype='gid_t'
  325. h_fcntl='false'
  326. h_sysfile='true'
  327. hint='previous'
  328. hostcat=''
  329. huge=''
  330. i_bsdioctl=''
  331. i_db='define'
  332. i_dbm='define'
  333. i_dirent='define'
  334. i_dld='undef'
  335. i_dlfcn='define'
  336. i_fcntl='undef'
  337. i_float='define'
  338. i_gdbm='define'
  339. i_grp='define'
  340. i_limits='define'
  341. i_malloc='define'
  342. i_math='define'
  343. i_memory='define'
  344. i_ndbm='undef'
  345. i_neterrno='undef'
  346. i_niin='define'
  347. i_pwd='define'
  348. i_sgtty='undef'
  349. i_stdarg='define'
  350. i_stddef='define'
  351. i_stdlib='define'
  352. i_string='define'
  353. i_sysdir='define'
  354. i_sysfile='define'
  355. i_sysfilio='undef'
  356. i_sysin='undef'
  357. i_sysioctl='define'
  358. i_sysndir='undef'
  359. i_sysparam='define'
  360. i_sysselct='undef'
  361. i_syssockio=''
  362. i_sysstat='define'
  363. i_systime='define'
  364. i_systimek='undef'
  365. i_systimes='define'
  366. i_systypes='define'
  367. i_termio='undef'
  368. i_termios='define'
  369. i_time='undef'
  370. i_unistd='define'
  371. i_utime='define'
  372. i_varargs='undef'
  373. i_varhdr='stdarg.h'
  374. i_vfork='undef'
  375. incpath=''
  376. inews=''
  377. installarchlib='/usr/lib/perl5/i586-linux'
  378. installbin='/usr/bin'
  379. installman1dir='/usr/man/man1'
  380. installman3dir='/usr/man/man3'
  381. installprivlib='/usr/lib/perl5'
  382. installscript='/usr/bin'
  383. installsitelib=''
  384. known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File POSIX SDBM_File Socket'
  385. ksh=''
  386. large=''
  387. ld='gcc'
  388. lddlflags='-shared'
  389. ldflags=''
  390. less=''
  391. libc=''
  392. libs='-lgdbm -ldbm -ldb -ldl -lm -lc -lbsd'
  393. libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
  394. line='line'
  395. lint=''
  396. lkflags=''
  397. ln='ln'
  398. lns='/bin/ln -s'
  399. lp=''
  400. lpr=''
  401. ls='ls'
  402. lseektype='off_t'
  403. mail=''
  404. mailx=''
  405. make=''
  406. mallocobj=''
  407. mallocsrc=''
  408. malloctype='void *'
  409. man1dir='/usr/man/man1'
  410. man1direxp='/usr/man/man1'
  411. man1ext='1'
  412. man3dir='/usr/man/man3'
  413. man3direxp='/usr/man/man3'
  414. man3ext='3'
  415. medium=''
  416. mips=''
  417. mips_type=''
  418. mkdir='mkdir'
  419. models='none'
  420. modetype='mode_t'
  421. more=''
  422. mv=''
  423. myarchname='i586-linux'
  424. mydomain=''
  425. myhostname='porky.redhat.com'
  426. myuname='linux porky.redhat.com 1.2.9 #5 thu jun 8 09:50:07 gmt 1995 i586 '
  427. n='-n'
  428. nm_opt=''
  429. nroff='nroff'
  430. optimize='-O2 -m486'
  431. orderlib='false'
  432. package='perl5'
  433. passcat=''
  434. patchlevel='1'
  435. perl='perl'
  436. pg=''
  437. phostname='hostname'
  438. plibpth=''
  439. pmake=''
  440. pr=''
  441. prefix='/usr'
  442. prefixexp='/usr'
  443. privlib='/usr/lib/perl5'
  444. privlibexp='/usr/lib/perl5'
  445. prototype='define'
  446. randbits='31'
  447. ranlib=':'
  448. rm='rm'
  449. rmail=''
  450. runnm='false'
  451. scriptdir='/usr/bin'
  452. scriptdirexp='/usr/bin'
  453. sed='sed'
  454. selecttype='fd_set *'
  455. sendmail=''
  456. sh=''
  457. shar=''
  458. shmattype='char *'
  459. shrpdir='none'
  460. signal_t='void'
  461. sitelib=''
  462. sitelibexp=''
  463. sizetype='size_t'
  464. sleep=''
  465. smail=''
  466. small=''
  467. sockethdr=''
  468. socketlib=''
  469. sort='sort'
  470. spackage='Perl5'
  471. spitshell='cat'
  472. split=''
  473. ssizetype='ssize_t'
  474. stdchar='char'
  475. stdio_base='((fp)->_IO_read_base)'
  476. stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)'
  477. stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
  478. stdio_ptr='((fp)->_IO_read_ptr)'
  479. strings='/usr/include/string.h'
  480. submit=''
  481. sysman='/usr/man/man1'
  482. tail=''
  483. tar=''
  484. tbl=''
  485. test='test'
  486. timeincl='/usr/include/sys/time.h '
  487. timetype='time_t'
  488. touch='touch'
  489. tr='tr'
  490. troff=''
  491. uidtype='uid_t'
  492. uname='uname'
  493. uniq='uniq'
  494. usedl='define'
  495. usemymalloc='n'
  496. usenm='false'
  497. useposix='true'
  498. usevfork='false'
  499. usrinc='/usr/include'
  500. uuname=''
  501. vi=''
  502. voidflags='15'
  503. xlibpth='/usr/lib/386 /lib/386'
  504. zcat=''
  505. !END!OF!CONFIG!
  506.  
  507.  
  508. tie %Config, Config;
  509. sub TIEHASH { bless {} }
  510. sub FETCH { 
  511.     # check for cached value (which maybe undef so we use exists not defined)
  512.     return $_[0]->{$_[1]} if (exists $_[0]->{$_[1]});
  513.  
  514.     my($value); # search for the item in the big $config_sh string
  515.     return undef unless (($value) = $config_sh =~ m/^$_[1]='(.*)'\s*$/m);
  516.  
  517.     $value = undef if $value eq 'undef'; # So we can say "if $Config{'foo'}".
  518.     $_[0]->{$_[1]} = $value; # cache it
  519.     return $value;
  520. }
  521.  
  522. sub FIRSTKEY {
  523.     $prevpos = 0;
  524.     my $key;
  525.     ($key) = $config_sh =~ m/^(.*)=/;
  526.     $key;
  527. }
  528.  
  529. sub NEXTKEY {
  530.     my ($pos, $len);
  531.     $pos = $prevpos;
  532.     $pos = index( $config_sh, "\n", $pos) + 1;
  533.     $prevpos = $pos;
  534.     $len = index( $config_sh, "=", $pos) - $pos;
  535.     $len > 0 ? substr( $config_sh, $pos, $len) : undef;
  536. }
  537.  
  538. sub EXISTS{ 
  539.      exists($_[0]->{$_[1]})  or  $config_sh =~ m/^$_[1]=/m; 
  540. }
  541.  
  542. sub readonly { die "\%Config::Config is read-only\n" }
  543.  
  544. sub myconfig {
  545.     my($output);
  546.     
  547.     $output = <<'END';
  548. Summary of my $package (patchlevel $PATCHLEVEL) configuration:
  549.   Platform:
  550.     osname=$osname, osver=$osvers, archname=$archname
  551.     uname='$myuname'
  552.     hint=$hint
  553.   Compiler:
  554.     cc='$cc', optimize='$optimize'
  555.     cppflags='$cppflags'
  556.     ccflags ='$ccflags'
  557.     ldflags ='$ldflags'
  558.     stdchar='$stdchar', d_stdstdio=$d_stdstdio, usevfork=$usevfork
  559.     voidflags=$voidflags, castflags=$castflags, d_casti32=$d_casti32, d_castneg=$d_castneg
  560.     intsize=$intsize, alignbytes=$alignbytes, usemymalloc=$usemymalloc, randbits=$randbits
  561.   Libraries:
  562.     so=$so
  563.     libpth=$libpth
  564.     libs=$libs
  565.     libc=$libc
  566.   Dynamic Linking:
  567.     dlsrc=$dlsrc, dlext=$dlext, d_dlsymun=$d_dlsymun
  568.     cccdlflags='$cccdlflags', ccdlflags='$ccdlflags', lddlflags='$lddlflags'
  569.  
  570. END
  571.     $output =~ s/\$(\w+)/$Config{$1}/ge;
  572.     $output;
  573. }
  574.  
  575. sub STORE { &readonly }
  576. sub DELETE{ &readonly }
  577. sub CLEAR { &readonly }
  578.  
  579.  
  580. 1;
  581.