| 5880 | | : define an is-a-typedef? function |
|---|
| 5881 | | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; |
|---|
| 5882 | | case "$inclist" in |
|---|
| 5883 | | "") inclist="sys/types.h";; |
|---|
| 5884 | | esac; |
|---|
| 5885 | | eval "varval=\$$var"; |
|---|
| 5886 | | case "$varval" in |
|---|
| 5887 | | "") |
|---|
| 5888 | | $rm -f temp.c; |
|---|
| 5889 | | for inc in $inclist; do |
|---|
| 5890 | | echo "#include <$inc>" >>temp.c; |
|---|
| 5891 | | done; |
|---|
| 5892 | | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; |
|---|
| 5893 | | if $contains $type temp.E >/dev/null 2>&1; then |
|---|
| 5894 | | eval "$var=\$type"; |
|---|
| 5895 | | else |
|---|
| 5896 | | eval "$var=\$def"; |
|---|
| 5897 | | fi; |
|---|
| 5898 | | $rm -f temp.?;; |
|---|
| 5899 | | *) eval "$var=\$varval";; |
|---|
| 5900 | | esac' |
|---|
| 5901 | | |
|---|
| 5902 | | : see what type pids are declared as in the kernel |
|---|
| 5903 | | set pid_t pidtype int stdio.h sys/types.h |
|---|
| 5904 | | eval $typedef |
|---|
| 5905 | | dflt="$pidtype" |
|---|
| 5906 | | echo " " |
|---|
| 5907 | | rp="What type are process ids on this system declared as?" |
|---|
| 5908 | | . ./myread |
|---|
| 5909 | | pidtype="$ans" |
|---|
| 5910 | | |
|---|
| 5911 | | : see what type is used for size_t |
|---|
| 5912 | | set size_t sizetype 'unsigned int' stdio.h sys/types.h |
|---|
| 5913 | | eval $typedef |
|---|
| 5914 | | dflt="$sizetype" |
|---|
| 5915 | | echo " " |
|---|
| 5916 | | rp="What type is used for the length parameter for string functions?" |
|---|
| 5917 | | . ./myread |
|---|
| 5918 | | sizetype="$ans" |
|---|
| 5919 | | |
|---|
| 5920 | | : see if arpa/inet.h has to be included |
|---|
| 5921 | | set arpa/inet.h i_arpainet |
|---|
| 5922 | | eval $inhdr |
|---|
| 5923 | | |
|---|
| 5924 | | : see if arpa/nameser.h has to be included |
|---|
| 5925 | | set arpa/nameser.h i_arpanameser |
|---|
| 5926 | | eval $inhdr |
|---|
| 5927 | | |
|---|
| 5928 | | : see if errno.h can be included |
|---|
| 5929 | | set errno.h i_errno |
|---|
| 5930 | | eval $inhdr |
|---|
| 5931 | | : see if sys/errno.h can be included |
|---|
| 5932 | | set sys/errno.h i_syserrno |
|---|
| 5933 | | eval $inhdr |
|---|
| 5934 | | : see if this is a sys/file.h system |
|---|
| 5935 | | val='' |
|---|
| 5936 | | set sys/file.h val |
|---|
| 5937 | | eval $inhdr |
|---|
| 5938 | | |
|---|
| 5939 | | : do we need to include sys/file.h ? |
|---|
| 5940 | | case "$val" in |
|---|
| 5941 | | "$define") |
|---|
| 5942 | | echo " " |
|---|
| 5943 | | if $h_sysfile; then |
|---|
| 5944 | | val="$define" |
|---|
| 5945 | | echo "We'll be including <sys/file.h>." >&4 |
|---|
| 5946 | | else |
|---|
| 5947 | | val="$undef" |
|---|
| 5948 | | echo "We won't be including <sys/file.h>." >&4 |
|---|
| 5949 | | fi |
|---|
| 5950 | | ;; |
|---|
| 5951 | | *) |
|---|
| 5952 | | h_sysfile=false |
|---|
| 5953 | | ;; |
|---|
| 5954 | | esac |
|---|
| 5955 | | set i_sysfile |
|---|
| 5956 | | eval $setvar |
|---|
| 5957 | | |
|---|
| 5958 | | : see if fcntl.h is there |
|---|
| 5959 | | val='' |
|---|
| 5960 | | set fcntl.h val |
|---|
| 5961 | | eval $inhdr |
|---|
| 5962 | | |
|---|
| 5963 | | : see if we can include fcntl.h |
|---|
| 5964 | | case "$val" in |
|---|
| 5965 | | "$define") |
|---|
| 5966 | | echo " " |
|---|
| 5967 | | if $h_fcntl; then |
|---|
| 5968 | | val="$define" |
|---|
| 5969 | | echo "We'll be including <fcntl.h>." >&4 |
|---|
| 5970 | | else |
|---|
| 5971 | | val="$undef" |
|---|
| 5972 | | if $h_sysfile; then |
|---|
| 5973 | | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 |
|---|
| 5974 | | else |
|---|
| 5975 | | echo "We won't be including <fcntl.h>." >&4 |
|---|
| 5976 | | fi |
|---|
| 5977 | | fi |
|---|
| 5978 | | ;; |
|---|
| 5979 | | *) |
|---|
| 5980 | | h_fcntl=false |
|---|
| 5981 | | val="$undef" |
|---|
| 5982 | | ;; |
|---|
| 5983 | | esac |
|---|
| 5984 | | set i_fcntl |
|---|
| 5985 | | eval $setvar |
|---|
| 5986 | | |
|---|
| 5987 | | : see if locale.h is available |
|---|
| 5988 | | set locale.h i_locale |
|---|
| 5989 | | eval $inhdr |
|---|
| 5990 | | |
|---|
| 5991 | | : see if memory.h is available. |
|---|
| 5992 | | val='' |
|---|
| 5993 | | set memory.h val |
|---|
| 5994 | | eval $inhdr |
|---|
| 5995 | | |
|---|
| 5996 | | : See if it conflicts with string.h |
|---|
| 5997 | | case "$val" in |
|---|
| 5998 | | $define) |
|---|
| 5999 | | case "$strings" in |
|---|
| 6000 | | '') ;; |
|---|
| 6001 | | *) |
|---|
| 6002 | | $cppstdin $cppflags $cppminus < "$strings" > mem.h |
|---|
| 6003 | | if $contains 'memcpy' mem.h >/dev/null 2>&1; then |
|---|
| 6004 | | echo " " |
|---|
| 6005 | | echo "We won't be including <memory.h>." |
|---|
| 6006 | | val="$undef" |
|---|
| 6007 | | fi |
|---|
| 6008 | | $rm -f mem.h |
|---|
| 6009 | | ;; |
|---|
| 6010 | | esac |
|---|
| 6011 | | esac |
|---|
| 6012 | | set i_memory |
|---|
| 6013 | | eval $setvar |
|---|
| 6014 | | |
|---|
| 6015 | | : see if netdb.h can be included |
|---|
| 6016 | | set netdb.h i_netdb |
|---|
| 6017 | | eval $inhdr |
|---|
| 6018 | | : see if setjmp.h can be included |
|---|
| 6019 | | set setjmp.h i_setjmp |
|---|
| 6020 | | eval $inhdr |
|---|
| 6021 | | : see if stdarg is available |
|---|
| 6022 | | echo " " |
|---|
| 6023 | | if $test "`./findhdr stdarg.h`"; then |
|---|
| 6024 | | echo "<stdarg.h> found." >&4 |
|---|
| 6025 | | valstd="$define" |
|---|
| 6026 | | else |
|---|
| 6027 | | echo "<stdarg.h> NOT found." >&4 |
|---|
| 6028 | | valstd="$undef" |
|---|
| 6029 | | fi |
|---|
| 6030 | | |
|---|
| 6031 | | : see if varags is available |
|---|
| 6032 | | echo " " |
|---|
| 6033 | | if $test "`./findhdr varargs.h`"; then |
|---|
| 6034 | | echo "<varargs.h> found." >&4 |
|---|
| 6035 | | else |
|---|
| 6036 | | echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 |
|---|
| 6037 | | fi |
|---|
| 6038 | | |
|---|
| 6039 | | : set up the varargs testing programs |
|---|
| 6040 | | $cat > varargs.c <<EOP |
|---|
| 6041 | | #ifdef I_STDARG |
|---|
| 6042 | | #include <stdarg.h> |
|---|
| 6043 | | #endif |
|---|
| 6044 | | #ifdef I_VARARGS |
|---|
| 6045 | | #include <varargs.h> |
|---|
| 6046 | | #endif |
|---|
| 6047 | | |
|---|
| 6048 | | #ifdef I_STDARG |
|---|
| 6049 | | int f(char *p, ...) |
|---|
| 6050 | | #else |
|---|
| 6051 | | int f(va_alist) |
|---|
| 6052 | | va_dcl |
|---|
| 6053 | | #endif |
|---|
| 6054 | | { |
|---|
| 6055 | | va_list ap; |
|---|
| 6056 | | #ifndef I_STDARG |
|---|
| 6057 | | char *p; |
|---|
| 6058 | | #endif |
|---|
| 6059 | | #ifdef I_STDARG |
|---|
| 6060 | | va_start(ap,p); |
|---|
| 6061 | | #else |
|---|
| 6062 | | va_start(ap); |
|---|
| 6063 | | p = va_arg(ap, char *); |
|---|
| 6064 | | #endif |
|---|
| 6065 | | va_end(ap); |
|---|
| 6066 | | } |
|---|
| 6067 | | EOP |
|---|
| 6068 | | $cat > varargs <<EOP |
|---|
| 6069 | | $startsh |
|---|
| 6070 | | if $cc -c $ccflags $ldflags -D\$1 varargs.c >/dev/null 2>&1; then |
|---|
| 6071 | | echo "true" |
|---|
| 6072 | | else |
|---|
| 6073 | | echo "false" |
|---|
| 6074 | | fi |
|---|
| 6075 | | $rm -f varargs$_o |
|---|
| 6076 | | EOP |
|---|
| 6077 | | chmod +x varargs |
|---|
| 6078 | | |
|---|
| 6079 | | : now check which varargs header should be included |
|---|
| 6080 | | echo " " |
|---|
| 6081 | | i_varhdr='' |
|---|
| 6082 | | case "$valstd" in |
|---|
| 6083 | | "$define") |
|---|
| 6084 | | if `./varargs I_STDARG`; then |
|---|
| 6085 | | val='stdarg.h' |
|---|
| 6086 | | elif `./varargs I_VARARGS`; then |
|---|
| 6087 | | val='varargs.h' |
|---|
| 6088 | | fi |
|---|
| 6089 | | ;; |
|---|
| 6090 | | *) |
|---|
| 6091 | | if `./varargs I_VARARGS`; then |
|---|
| 6092 | | val='varargs.h' |
|---|
| 6093 | | fi |
|---|
| 6094 | | ;; |
|---|
| 6095 | | esac |
|---|
| 6096 | | case "$val" in |
|---|
| 6097 | | '') |
|---|
| 6098 | | echo "I could not find the definition for va_dcl... You have problems..." >&4 |
|---|
| 6099 | | val="$undef"; set i_stdarg; eval $setvar |
|---|
| 6100 | | val="$undef"; set i_varargs; eval $setvar |
|---|
| 6101 | | ;; |
|---|
| 6102 | | *) |
|---|
| 6103 | | set i_varhdr |
|---|
| 6104 | | eval $setvar |
|---|
| 6105 | | case "$i_varhdr" in |
|---|
| 6106 | | stdarg.h) |
|---|
| 6107 | | val="$define"; set i_stdarg; eval $setvar |
|---|
| 6108 | | val="$undef"; set i_varargs; eval $setvar |
|---|
| 6109 | | ;; |
|---|
| 6110 | | varargs.h) |
|---|
| 6111 | | val="$undef"; set i_stdarg; eval $setvar |
|---|
| 6112 | | val="$define"; set i_varargs; eval $setvar |
|---|
| 6113 | | ;; |
|---|
| 6114 | | esac |
|---|
| 6115 | | echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; |
|---|
| 6116 | | esac |
|---|
| 6117 | | $rm -f varargs* |
|---|
| 6118 | | |
|---|
| 6119 | | : see if stddef is available |
|---|
| 6120 | | set stddef.h i_stddef |
|---|
| 6121 | | eval $inhdr |
|---|
| 6122 | | |
|---|
| 6123 | | : see if sys/mman.h has to be included |
|---|
| 6124 | | set sys/mman.h i_sysmman |
|---|
| 6125 | | eval $inhdr |
|---|
| 6126 | | |
|---|
| 6127 | | : see if sys/page.h has to be included |
|---|
| 6128 | | set sys/page.h i_syspage |
|---|
| 6129 | | eval $inhdr |
|---|
| 6130 | | |
|---|
| 6131 | | : see if this is a sys/param system |
|---|
| 6132 | | set sys/param.h i_sysparam |
|---|
| 6133 | | eval $inhdr |
|---|
| 6134 | | |
|---|
| 6135 | | : see if sys/resource.h has to be included |
|---|
| 6136 | | set sys/resource.h i_sysresrc |
|---|
| 6137 | | eval $inhdr |
|---|
| 6138 | | |
|---|
| 6139 | | : see if sys/select.h has to be included |
|---|
| 6140 | | set sys/select.h i_sysselct |
|---|
| 6141 | | eval $inhdr |
|---|
| 6142 | | |
|---|
| 6143 | | : see if sys/stat.h is available |
|---|
| 6144 | | set sys/stat.h i_sysstat |
|---|
| 6145 | | eval $inhdr |
|---|
| 6146 | | |
|---|
| 6147 | | : see if we should include time.h, sys/time.h, or both |
|---|
| 6148 | | echo " " |
|---|
| 6149 | | echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4 |
|---|
| 6150 | | $echo $n "I'm now running the test program...$c" |
|---|
| 6151 | | $cat >try.c <<'EOCP' |
|---|
| 6152 | | #include <sys/types.h> |
|---|
| 6153 | | #ifdef I_TIME |
|---|
| 6154 | | #include <time.h> |
|---|
| 6155 | | #endif |
|---|
| 6156 | | #ifdef I_SYSTIME |
|---|
| 6157 | | #ifdef SYSTIMEKERNEL |
|---|
| 6158 | | #define KERNEL |
|---|
| 6159 | | #endif |
|---|
| 6160 | | #include <sys/time.h> |
|---|
| 6161 | | #endif |
|---|
| 6162 | | #ifdef I_SYSSELECT |
|---|
| 6163 | | #include <sys/select.h> |
|---|
| 6164 | | #endif |
|---|
| 6165 | | main() |
|---|
| 6166 | | { |
|---|
| 6167 | | struct tm foo; |
|---|
| 6168 | | #ifdef S_TIMEVAL |
|---|
| 6169 | | struct timeval bar; |
|---|
| 6170 | | #endif |
|---|
| 6171 | | #ifdef S_TIMEZONE |
|---|
| 6172 | | struct timezone tzp; |
|---|
| 6173 | | #endif |
|---|
| 6174 | | if (foo.tm_sec == foo.tm_sec) |
|---|
| 6175 | | exit(0); |
|---|
| 6176 | | #ifdef S_TIMEVAL |
|---|
| 6177 | | if (bar.tv_sec == bar.tv_sec) |
|---|
| 6178 | | exit(0); |
|---|
| 6179 | | #endif |
|---|
| 6180 | | exit(1); |
|---|
| 6181 | | } |
|---|
| 6182 | | EOCP |
|---|
| 6183 | | flags='' |
|---|
| 6184 | | for s_timezone in '-DS_TIMEZONE' ''; do |
|---|
| 6185 | | sysselect='' |
|---|
| 6186 | | for s_timeval in '-DS_TIMEVAL' ''; do |
|---|
| 6187 | | for i_systimek in '' '-DSYSTIMEKERNEL'; do |
|---|
| 6188 | | for i_time in '' '-DI_TIME'; do |
|---|
| 6189 | | for i_systime in '-DI_SYSTIME' ''; do |
|---|
| 6190 | | case "$flags" in |
|---|
| 6191 | | '') $echo $n ".$c" |
|---|
| 6192 | | if $cc $ccflags \ |
|---|
| 6193 | | $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \ |
|---|
| 6194 | | try.c -o try >/dev/null 2>&1 ; then |
|---|
| 6195 | | set X $i_time $i_systime $i_systimek $sysselect $s_timeval |
|---|
| 6196 | | shift |
|---|
| 6197 | | flags="$*" |
|---|
| 6198 | | echo " " |
|---|
| 6199 | | $echo $n "Succeeded with $flags$c" |
|---|
| 6200 | | fi |
|---|
| 6201 | | ;; |
|---|
| 6202 | | esac |
|---|
| 6203 | | done |
|---|
| 6204 | | done |
|---|
| 6205 | | done |
|---|
| 6206 | | done |
|---|
| 6207 | | done |
|---|
| 6208 | | timeincl='' |
|---|
| 6209 | | echo " " |
|---|
| 6210 | | case "$flags" in |
|---|
| 6211 | | *SYSTIMEKERNEL*) i_systimek="$define" |
|---|
| 6212 | | timeincl=`./findhdr sys/time.h` |
|---|
| 6213 | | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; |
|---|
| 6214 | | *) i_systimek="$undef";; |
|---|
| 6215 | | esac |
|---|
| 6216 | | case "$flags" in |
|---|
| 6217 | | *I_TIME*) i_time="$define" |
|---|
| 6218 | | timeincl=`./findhdr time.h`" $timeincl" |
|---|
| 6219 | | echo "We'll include <time.h>." >&4;; |
|---|
| 6220 | | *) i_time="$undef";; |
|---|
| 6221 | | esac |
|---|
| 6222 | | case "$flags" in |
|---|
| 6223 | | *I_SYSTIME*) i_systime="$define" |
|---|
| 6224 | | timeincl=`./findhdr sys/time.h`" $timeincl" |
|---|
| 6225 | | echo "We'll include <sys/time.h>." >&4;; |
|---|
| 6226 | | *) i_systime="$undef";; |
|---|
| 6227 | | esac |
|---|
| 6228 | | $rm -f try.c try |
|---|
| 6229 | | |
|---|
| 6230 | | : see if sys/vlimit.h has to be included |
|---|
| 6231 | | set sys/vlimit.h i_sysvlimit |
|---|
| 6232 | | eval $inhdr |
|---|
| 6233 | | |
|---|
| 6234 | | : see if this is a syswait system |
|---|
| 6235 | | set sys/wait.h i_syswait |
|---|
| 6236 | | eval $inhdr |
|---|
| 6237 | | |
|---|
| 6238 | | : determine the name of a reasonable mailer |
|---|
| 6239 | | case "$mailer" in |
|---|
| 6240 | | '') |
|---|
| 6241 | | if $test -f "$sendmail"; then |
|---|
| 6242 | | dflt="$sendmail" |
|---|
| 6243 | | elif $test -f "$smail"; then |
|---|
| 6244 | | dflt="$smail" |
|---|
| 6245 | | elif $test -f "$rmail"; then |
|---|
| 6246 | | dflt="$rmail" |
|---|
| 6247 | | elif $test -f /bin/mail; then |
|---|
| 6248 | | dflt=/bin/mail |
|---|
| 6249 | | else |
|---|
| 6250 | | dflt=$mail |
|---|
| 6251 | | fi |
|---|
| 6252 | | ;; |
|---|
| 6253 | | *) dflt="$mailer";; |
|---|
| 6254 | | esac |
|---|
| 6255 | | $cat <<EOM |
|---|
| 6256 | | |
|---|
| 6257 | | Later on, I'm going to offer you the chance to subscribe (or unsubscribe) |
|---|
| 6258 | | to the $package mailing list. In order to do that, I need to figure out |
|---|
| 6259 | | how to send mail, your name, and a few other things. |
|---|
| 6260 | | |
|---|
| 6261 | | I need the full pathname of the program used to deliver mail on your system. |
|---|
| 6262 | | A typical answer would be /usr/lib/sendmail or /bin/rmail, but you may choose |
|---|
| 6263 | | any other program, as long as it can be fed from standard input and will |
|---|
| 6264 | | honour any user-supplied headers. |
|---|
| 6265 | | |
|---|
| 6266 | | EOM |
|---|
| 6267 | | fn=f |
|---|
| 6268 | | rp='Mail transport agent to be used?' |
|---|
| 6269 | | . ./getfile |
|---|
| 6270 | | mailer="$ans" |
|---|
| 6271 | | |
|---|
| | 6176 | : define an is-a-typedef? function |
|---|
| | 6177 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; |
|---|
| | 6178 | case "$inclist" in |
|---|
| | 6179 | "") inclist="sys/types.h";; |
|---|
| | 6180 | esac; |
|---|
| | 6181 | eval "varval=\$$var"; |
|---|
| | 6182 | case "$varval" in |
|---|
| | 6183 | "") |
|---|
| | 6184 | $rm -f temp.c; |
|---|
| | 6185 | for inc in $inclist; do |
|---|
| | 6186 | echo "#include <$inc>" >>temp.c; |
|---|
| | 6187 | done; |
|---|
| | 6188 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; |
|---|
| | 6189 | if $contains $type temp.E >/dev/null 2>&1; then |
|---|
| | 6190 | eval "$var=\$type"; |
|---|
| | 6191 | else |
|---|
| | 6192 | eval "$var=\$def"; |
|---|
| | 6193 | fi; |
|---|
| | 6194 | $rm -f temp.?;; |
|---|
| | 6195 | *) eval "$var=\$varval";; |
|---|
| | 6196 | esac' |
|---|
| | 6197 | |
|---|
| | 6198 | : see what type pids are declared as in the kernel |
|---|
| | 6199 | set pid_t pidtype int stdio.h sys/types.h |
|---|
| | 6200 | eval $typedef |
|---|
| | 6201 | dflt="$pidtype" |
|---|
| | 6202 | echo " " |
|---|
| | 6203 | rp="What type are process ids on this system declared as?" |
|---|
| | 6204 | . ./myread |
|---|
| | 6205 | pidtype="$ans" |
|---|
| | 6206 | |
|---|
| | 6207 | : see what type is used for size_t |
|---|
| | 6208 | set size_t sizetype 'unsigned int' stdio.h sys/types.h |
|---|
| | 6209 | eval $typedef |
|---|
| | 6210 | dflt="$sizetype" |
|---|
| | 6211 | echo " " |
|---|
| | 6212 | rp="What type is used for the length parameter for string functions?" |
|---|
| | 6213 | . ./myread |
|---|
| | 6214 | sizetype="$ans" |
|---|
| | 6215 | |
|---|
| | 6216 | : see if arpa/inet.h has to be included |
|---|
| | 6217 | set arpa/inet.h i_arpainet |
|---|
| | 6218 | eval $inhdr |
|---|
| | 6219 | |
|---|
| | 6220 | : see if arpa/nameser.h has to be included |
|---|
| | 6221 | set arpa/nameser.h i_arpanameser |
|---|
| | 6222 | eval $inhdr |
|---|
| | 6223 | |
|---|
| | 6224 | : see if errno.h can be included |
|---|
| | 6225 | set errno.h i_errno |
|---|
| | 6226 | eval $inhdr |
|---|
| | 6227 | : see if sys/errno.h can be included |
|---|
| | 6228 | set sys/errno.h i_syserrno |
|---|
| | 6229 | eval $inhdr |
|---|
| | 6230 | : see if this is a sys/file.h system |
|---|
| | 6231 | val='' |
|---|
| | 6232 | set sys/file.h val |
|---|
| | 6233 | eval $inhdr |
|---|
| | 6234 | |
|---|
| | 6235 | : do we need to include sys/file.h ? |
|---|
| | 6236 | case "$val" in |
|---|
| | 6237 | "$define") |
|---|
| | 6238 | echo " " |
|---|
| | 6239 | if $h_sysfile; then |
|---|
| | 6240 | val="$define" |
|---|
| | 6241 | echo "We'll be including <sys/file.h>." >&4 |
|---|
| | 6242 | else |
|---|
| | 6243 | val="$undef" |
|---|
| | 6244 | echo "We won't be including <sys/file.h>." >&4 |
|---|
| | 6245 | fi |
|---|
| | 6246 | ;; |
|---|
| | 6247 | *) |
|---|
| | 6248 | h_sysfile=false |
|---|
| | 6249 | ;; |
|---|
| | 6250 | esac |
|---|
| | 6251 | set i_sysfile |
|---|
| | 6252 | eval $setvar |
|---|
| | 6253 | |
|---|
| | 6254 | : see if fcntl.h is there |
|---|
| | 6255 | val='' |
|---|
| | 6256 | set fcntl.h val |
|---|
| | 6257 | eval $inhdr |
|---|
| | 6258 | |
|---|
| | 6259 | : see if we can include fcntl.h |
|---|
| | 6260 | case "$val" in |
|---|
| | 6261 | "$define") |
|---|
| | 6262 | echo " " |
|---|
| | 6263 | if $h_fcntl; then |
|---|
| | 6264 | val="$define" |
|---|
| | 6265 | echo "We'll be including <fcntl.h>." >&4 |
|---|
| | 6266 | else |
|---|
| | 6267 | val="$undef" |
|---|
| | 6268 | if $h_sysfile; then |
|---|
| | 6269 | echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4 |
|---|
| | 6270 | else |
|---|
| | 6271 | echo "We won't be including <fcntl.h>." >&4 |
|---|
| | 6272 | fi |
|---|
| | 6273 | fi |
|---|
| | 6274 | ;; |
|---|
| | 6275 | *) |
|---|
| | 6276 | h_fcntl=false |
|---|
| | 6277 | val="$undef" |
|---|
| | 6278 | ;; |
|---|
| | 6279 | esac |
|---|
| | 6280 | set i_fcntl |
|---|
| | 6281 | eval $setvar |
|---|
| | 6282 | |
|---|
| | 6283 | : see if locale.h is available |
|---|
| | 6284 | set locale.h i_locale |
|---|
| | 6285 | eval $inhdr |
|---|
| | 6286 | |
|---|
| | 6287 | : see if memory.h is available. |
|---|
| | 6288 | val='' |
|---|
| | 6289 | set memory.h val |
|---|
| | 6290 | eval $inhdr |
|---|
| | 6291 | |
|---|
| | 6292 | : See if it conflicts with string.h |
|---|
| | 6293 | case "$val" in |
|---|
| | 6294 | $define) |
|---|
| | 6295 | case "$strings" in |
|---|
| | 6296 | '') ;; |
|---|
| | 6297 | *) |
|---|
| | 6298 | $cppstdin $cppflags $cppminus < "$strings" > mem.h |
|---|
| | 6299 | if $contains 'memcpy' mem.h >/dev/null 2>&1; then |
|---|
| | 6300 | echo " " |
|---|
| | 6301 | echo "We won't be including <memory.h>." |
|---|
| | 6302 | val="$undef" |
|---|
| | 6303 | fi |
|---|
| | 6304 | $rm -f mem.h |
|---|
| | 6305 | ;; |
|---|
| | 6306 | esac |
|---|
| | 6307 | esac |
|---|
| | 6308 | set i_memory |
|---|
| | 6309 | eval $setvar |
|---|
| | 6310 | |
|---|
| | 6311 | : see if netdb.h can be included |
|---|
| | 6312 | set netdb.h i_netdb |
|---|
| | 6313 | eval $inhdr |
|---|
| | 6314 | : see if setjmp.h can be included |
|---|
| | 6315 | set setjmp.h i_setjmp |
|---|
| | 6316 | eval $inhdr |
|---|
| | 6317 | : see if stdarg is available |
|---|
| | 6318 | echo " " |
|---|
| | 6319 | if $test "`./findhdr stdarg.h`"; then |
|---|
| | 6320 | echo "<stdarg.h> found." >&4 |
|---|
| | 6321 | valstd="$define" |
|---|
| | 6322 | else |
|---|
| | 6323 | echo "<stdarg.h> NOT found." >&4 |
|---|
| | 6324 | valstd="$undef" |
|---|
| | 6325 | fi |
|---|
| | 6326 | |
|---|
| | 6327 | : see if varags is available |
|---|
| | 6328 | echo " " |
|---|
| | 6329 | if $test "`./findhdr varargs.h`"; then |
|---|
| | 6330 | echo "<varargs.h> found." >&4 |
|---|
| | 6331 | else |
|---|
| | 6332 | echo "<varargs.h> NOT found, but that's ok (I hope)." >&4 |
|---|
| | 6333 | fi |
|---|
| | 6334 | |
|---|
| | 6335 | : set up the varargs testing programs |
|---|
| | 6336 | $cat > varargs.c <<EOP |
|---|
| | 6337 | #ifdef I_STDARG |
|---|
| | 6338 | #include <stdarg.h> |
|---|
| | 6339 | #endif |
|---|
| | 6340 | #ifdef I_VARARGS |
|---|
| | 6341 | #include <varargs.h> |
|---|
| | 6342 | #endif |
|---|
| | 6343 | |
|---|
| | 6344 | #ifdef I_STDARG |
|---|
| | 6345 | int f(char *p, ...) |
|---|
| | 6346 | #else |
|---|
| | 6347 | int f(va_alist) |
|---|
| | 6348 | va_dcl |
|---|
| | 6349 | #endif |
|---|
| | 6350 | { |
|---|
| | 6351 | va_list ap; |
|---|
| | 6352 | #ifndef I_STDARG |
|---|
| | 6353 | char *p; |
|---|
| | 6354 | #endif |
|---|
| | 6355 | #ifdef I_STDARG |
|---|
| | 6356 | va_start(ap,p); |
|---|
| | 6357 | #else |
|---|
| | 6358 | va_start(ap); |
|---|
| | 6359 | p = va_arg(ap, char *); |
|---|
| | 6360 | #endif |
|---|
| | 6361 | va_end(ap); |
|---|
| | 6362 | } |
|---|
| | 6363 | EOP |
|---|
| | 6364 | $cat > varargs <<EOP |
|---|
| | 6365 | $startsh |
|---|
| | 6366 | if $cc -c $ccflags $ldflags -D\$1 varargs.c >/dev/null 2>&1; then |
|---|
| | 6367 | echo "true" |
|---|
| | 6368 | else |
|---|
| | 6369 | echo "false" |
|---|
| | 6370 | fi |
|---|
| | 6371 | $rm -f varargs$_o |
|---|
| | 6372 | EOP |
|---|
| | 6373 | chmod +x varargs |
|---|
| | 6374 | |
|---|
| | 6375 | : now check which varargs header should be included |
|---|
| | 6376 | echo " " |
|---|
| | 6377 | i_varhdr='' |
|---|
| | 6378 | case "$valstd" in |
|---|
| | 6379 | "$define") |
|---|
| | 6380 | if `./varargs I_STDARG`; then |
|---|
| | 6381 | val='stdarg.h' |
|---|
| | 6382 | elif `./varargs I_VARARGS`; then |
|---|
| | 6383 | val='varargs.h' |
|---|
| | 6384 | fi |
|---|
| | 6385 | ;; |
|---|
| | 6386 | *) |
|---|
| | 6387 | if `./varargs I_VARARGS`; then |
|---|
| | 6388 | val='varargs.h' |
|---|
| | 6389 | fi |
|---|
| | 6390 | ;; |
|---|
| | 6391 | esac |
|---|
| | 6392 | case "$val" in |
|---|
| | 6393 | '') |
|---|
| | 6394 | echo "I could not find the definition for va_dcl... You have problems..." >&4 |
|---|
| | 6395 | val="$undef"; set i_stdarg; eval $setvar |
|---|
| | 6396 | val="$undef"; set i_varargs; eval $setvar |
|---|
| | 6397 | ;; |
|---|
| | 6398 | *) |
|---|
| | 6399 | set i_varhdr |
|---|
| | 6400 | eval $setvar |
|---|
| | 6401 | case "$i_varhdr" in |
|---|
| | 6402 | stdarg.h) |
|---|
| | 6403 | val="$define"; set i_stdarg; eval $setvar |
|---|
| | 6404 | val="$undef"; set i_varargs; eval $setvar |
|---|
| | 6405 | ;; |
|---|
| | 6406 | varargs.h) |
|---|
| | 6407 | val="$undef"; set i_stdarg; eval $setvar |
|---|
| | 6408 | val="$define"; set i_varargs; eval $setvar |
|---|
| | 6409 | ;; |
|---|
| | 6410 | esac |
|---|
| | 6411 | echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;; |
|---|
| | 6412 | esac |
|---|
| | 6413 | $rm -f varargs* |
|---|
| | 6414 | |
|---|
| | 6415 | : see if stddef is available |
|---|
| | 6416 | set stddef.h i_stddef |
|---|
| | 6417 | eval $inhdr |
|---|
| | 6418 | |
|---|
| | 6419 | : see if sys/mman.h has to be included |
|---|
| | 6420 | set sys/mman.h i_sysmman |
|---|
| | 6421 | eval $inhdr |
|---|
| | 6422 | |
|---|
| | 6423 | : see if sys/page.h has to be included |
|---|
| | 6424 | set sys/page.h i_syspage |
|---|
| | 6425 | eval $inhdr |
|---|
| | 6426 | |
|---|
| | 6427 | : see if this is a sys/param system |
|---|
| | 6428 | set sys/param.h i_sysparam |
|---|
| | 6429 | eval $inhdr |
|---|
| | 6430 | |
|---|
| | 6431 | : see if sys/resource.h has to be included |
|---|
| | 6432 | set sys/resource.h i_sysresrc |
|---|
| | 6433 | eval $inhdr |
|---|
| | 6434 | |
|---|
| | 6435 | : see if sys/select.h has to be included |
|---|
| | 6436 | set sys/select.h i_sysselct |
|---|
| | 6437 | eval $inhdr |
|---|
| | 6438 | |
|---|
| | 6439 | : see if sys/stat.h is available |
|---|
| | 6440 | set sys/stat.h i_sysstat |
|---|
| | 6441 | eval $inhdr |
|---|
| | 6442 | |
|---|
| | 6443 | : see if we should include time.h, sys/time.h, or both |
|---|
| | 6444 | echo " " |
|---|
| | 6445 | echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4 |
|---|
| | 6446 | $echo $n "I'm now running the test program...$c" |
|---|
| | 6447 | $cat >try.c <<'EOCP' |
|---|
| | 6448 | #include <sys/types.h> |
|---|
| | 6449 | #ifdef I_TIME |
|---|
| | 6450 | #include <time.h> |
|---|
| | 6451 | #endif |
|---|
| | 6452 | #ifdef I_SYSTIME |
|---|
| | 6453 | #ifdef SYSTIMEKERNEL |
|---|
| | 6454 | #define KERNEL |
|---|
| | 6455 | #endif |
|---|
| | 6456 | #include <sys/time.h> |
|---|
| | 6457 | #endif |
|---|
| | 6458 | #ifdef I_SYSSELECT |
|---|
| | 6459 | #include <sys/select.h> |
|---|
| | 6460 | #endif |
|---|
| | 6461 | main() |
|---|
| | 6462 | { |
|---|
| | 6463 | struct tm foo; |
|---|
| | 6464 | #ifdef S_TIMEVAL |
|---|
| | 6465 | struct timeval bar; |
|---|
| | 6466 | #endif |
|---|
| | 6467 | #ifdef S_TIMEZONE |
|---|
| | 6468 | struct timezone tzp; |
|---|
| | 6469 | #endif |
|---|
| | 6470 | if (foo.tm_sec == foo.tm_sec) |
|---|
| | 6471 | exit(0); |
|---|
| | 6472 | #ifdef S_TIMEVAL |
|---|
| | 6473 | if (bar.tv_sec == bar.tv_sec) |
|---|
| | 6474 | exit(0); |
|---|
| | 6475 | #endif |
|---|
| | 6476 | exit(1); |
|---|
| | 6477 | } |
|---|
| | 6478 | EOCP |
|---|
| | 6479 | flags='' |
|---|
| | 6480 | for s_timezone in '-DS_TIMEZONE' ''; do |
|---|
| | 6481 | sysselect='' |
|---|
| | 6482 | for s_timeval in '-DS_TIMEVAL' ''; do |
|---|
| | 6483 | for i_systimek in '' '-DSYSTIMEKERNEL'; do |
|---|
| | 6484 | for i_time in '' '-DI_TIME'; do |
|---|
| | 6485 | for i_systime in '-DI_SYSTIME' ''; do |
|---|
| | 6486 | case "$flags" in |
|---|
| | 6487 | '') $echo $n ".$c" |
|---|
| | 6488 | if $cc $ccflags \ |
|---|
| | 6489 | $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \ |
|---|
| | 6490 | try.c -o try >/dev/null 2>&1 ; then |
|---|
| | 6491 | set X $i_time $i_systime $i_systimek $sysselect $s_timeval |
|---|
| | 6492 | shift |
|---|
| | 6493 | flags="$*" |
|---|
| | 6494 | echo " " |
|---|
| | 6495 | $echo $n "Succeeded with $flags$c" |
|---|
| | 6496 | fi |
|---|
| | 6497 | ;; |
|---|
| | 6498 | esac |
|---|
| | 6499 | done |
|---|
| | 6500 | done |
|---|
| | 6501 | done |
|---|
| | 6502 | done |
|---|
| | 6503 | done |
|---|
| | 6504 | timeincl='' |
|---|
| | 6505 | echo " " |
|---|
| | 6506 | case "$flags" in |
|---|
| | 6507 | *SYSTIMEKERNEL*) i_systimek="$define" |
|---|
| | 6508 | timeincl=`./findhdr sys/time.h` |
|---|
| | 6509 | echo "We'll include <sys/time.h> with KERNEL defined." >&4;; |
|---|
| | 6510 | *) i_systimek="$undef";; |
|---|
| | 6511 | esac |
|---|
| | 6512 | case "$flags" in |
|---|
| | 6513 | *I_TIME*) i_time="$define" |
|---|
| | 6514 | timeincl=`./findhdr time.h`" $timeincl" |
|---|
| | 6515 | echo "We'll include <time.h>." >&4;; |
|---|
| | 6516 | *) i_time="$undef";; |
|---|
| | 6517 | esac |
|---|
| | 6518 | case "$flags" in |
|---|
| | 6519 | *I_SYSTIME*) i_systime="$define" |
|---|
| | 6520 | timeincl=`./findhdr sys/time.h`" $timeincl" |
|---|
| | 6521 | echo "We'll include <sys/time.h>." >&4;; |
|---|
| | 6522 | *) i_systime="$undef";; |
|---|
| | 6523 | esac |
|---|
| | 6524 | $rm -f try.c try |
|---|
| | 6525 | |
|---|
| | 6526 | : see if sys/vlimit.h has to be included |
|---|
| | 6527 | set sys/vlimit.h i_sysvlimit |
|---|
| | 6528 | eval $inhdr |
|---|
| | 6529 | |
|---|
| | 6530 | : see if this is a syswait system |
|---|
| | 6531 | set sys/wait.h i_syswait |
|---|
| | 6532 | eval $inhdr |
|---|
| | 6533 | |
|---|
| | 6534 | : determine the name of a reasonable mailer |
|---|
| | 6535 | case "$mailer" in |
|---|
| | 6536 | '') |
|---|
| | 6537 | if $test -f "$sendmail"; then |
|---|
| | 6538 | dflt="$sendmail" |
|---|
| | 6539 | elif $test -f "$smail"; then |
|---|
| | 6540 | dflt="$smail" |
|---|
| | 6541 | elif $test -f "$rmail"; then |
|---|
| | 6542 | dflt="$rmail" |
|---|
| | 6543 | elif $test -f /bin/mail; then |
|---|
| | 6544 | dflt=/bin/mail |
|---|
| | 6545 | else |
|---|
| | 6546 | dflt=$mail |
|---|
| | 6547 | fi |
|---|
| | 6548 | ;; |
|---|
| | 6549 | *) dflt="$mailer";; |
|---|
| | 6550 | esac |
|---|
| | 6551 | $cat <<EOM |
|---|
| | 6552 | |
|---|
| | 6553 | Later on, I'm going to offer you the chance to subscribe (or unsubscribe) |
|---|
| | 6554 | to the $package mailing list. In order to do that, I need to figure out |
|---|
| | 6555 | how to send mail, your name, and a few other things. |
|---|
| | 6556 | |
|---|
| | 6557 | I need the full pathname of the program used to deliver mail on your system. |
|---|
| | 6558 | A typical answer would be /usr/lib/sendmail or /bin/rmail, but you may choose |
|---|
| | 6559 | any other program, as long as it can be fed from standard input and will |
|---|
| | 6560 | honour any user-supplied headers. |
|---|
| | 6561 | |
|---|
| | 6562 | EOM |
|---|
| | 6563 | fn=f |
|---|
| | 6564 | rp='Mail transport agent to be used?' |
|---|
| | 6565 | . ./getfile |
|---|
| | 6566 | mailer="$ans" |
|---|
| | 6567 | |
|---|
| | 6568 | : find out how to find out full name |
|---|
| | 6569 | case "$d_berknames" in |
|---|
| | 6570 | "$define") |
|---|
| | 6571 | dflt=y;; |
|---|
| | 6572 | "$undef") |
|---|
| | 6573 | dflt=n;; |
|---|
| | 6574 | *) |
|---|
| | 6575 | if ./bsd; then |
|---|
| | 6576 | dflt=y |
|---|
| | 6577 | elif ./xenix; then |
|---|
| | 6578 | dflt=y |
|---|
| | 6579 | elif $test "x$osname" = "xlinux"; then |
|---|
| | 6580 | dflt=y |
|---|
| | 6581 | else |
|---|
| | 6582 | dflt=n |
|---|
| | 6583 | fi |
|---|
| | 6584 | ;; |
|---|
| | 6585 | esac |
|---|
| | 6586 | $cat <<'EOM' |
|---|
| | 6587 | |
|---|
| | 6588 | Does your /etc/passwd file keep full names in Berkeley/V7 format (name first |
|---|
| | 6589 | thing after ':' in GCOS field)? In that case, a typical entry in the password |
|---|
| | 6590 | file looks like this: |
|---|
| | 6591 | |
|---|
| | 6592 | guest:**paswword**:1 |
|---|