This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Metaconfig unit change for #10807.
[metaconfig.git] / U / perl / d_sfio.U
1 ?RCS: $Id: d_sfio.U,v $
2 ?RCS:
3 ?RCS: Copyright (c) 1996-1998 Andy Dougherty
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?RCS: $Log: d_sfio.U,v $
9 ?RCS:
10 ?MAKE:usesfio d_sfio: i_sfio Inlibc Myread Oldconfig sed libs \
11         Setvar package useperlio
12 ?MAKE:  -pick add $@ %<
13 ?S:usesfio:
14 ?S:     This variable is set to true when the user agrees to use sfio.
15 ?S:     It is set to false when sfio is not available or when the user
16 ?S:     explicitely requests not to use sfio.  It is here primarily so
17 ?S:     that command-line settings can override the auto-detection of
18 ?S:     d_sfio without running into a "WHOA THERE".
19 ?S:.
20 ?S:d_sfio:
21 ?S:     This variable conditionally defines the USE_SFIO symbol,
22 ?S:     and indicates whether sfio is available (and should be used).
23 ?S:.
24 ?C:USE_SFIO:
25 ?C:     This symbol, if defined, indicates that sfio should
26 ?C:     be used.
27 ?C:.
28 ?H:#$d_sfio     USE_SFIO                /**/
29 ?H:.
30 ?LINT:set d_sfio
31 ?LINT:change libs
32 ?LINT:change useperlio
33
34 : see if sfio library is available
35 case "$i_sfio" in
36 $define)
37         val=''
38         set sfreserve val
39         eval $inlibc
40         ;;
41 *)
42         val="$undef"
43         ;;
44 esac
45 : Ok, but do we want to use it.
46 case "$val" in
47 $define)
48         case "$usesfio" in
49         true|$define|[yY]*) dflt='y';;
50         *) dflt='n';;
51         esac
52         echo "$package can use the sfio library, but it is experimental."
53         case "$useperlio" in
54         "$undef")
55             echo "For sfio also the PerlIO abstraction layer is needed."
56             echo "Earlier you said you wouldn't want that."
57             ;;
58         esac
59         rp="You seem to have sfio available, do you want to try using it?"
60         . ./myread
61         case "$ans" in
62         y|Y)    echo "Ok, turning on both sfio and PerlIO, then."
63                 useperlio="$define"
64                 val="$define"
65                 ;;
66         *)      echo "Ok, avoiding sfio this time.  I'll use stdio instead."
67                 val="$undef"
68                 ;;
69         esac
70         ;;
71 *)      case "$usesfio" in
72         true|$define|[yY]*)
73                 echo "Sorry, cannot find sfio on this machine." >&4
74                 echo "Ignoring your setting of usesfio=$usesfio." >&4
75                 val="$undef"
76                 ;;
77         esac
78         ;;
79 esac
80 ?X:
81 ?X: Only set d_sfio when final value is known to avoid spurious Whoas
82 ?X: Then set usesfio accordingly to the current value, for next run
83 ?X:
84 set d_sfio
85 eval $setvar
86 case "$d_sfio" in
87 $define) usesfio='true';;
88 *) usesfio='false';;
89 esac
90 case "$d_sfio" in
91 $define) ;;
92 *)      : Remove sfio from list of libraries to use
93         case "$libs" in
94         *-lsfio*)
95                 echo "Removing unneeded -lsfio from library list" >&4
96                 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
97                 shift
98                 libs="$*"
99                 echo "libs = $libs" >&4
100                 ;;
101         esac
102 ;;
103 esac
104
105