-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·884 lines (774 loc) · 20.7 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
#!/bin/sh
#
# Configuration script for Services.
###########################################################################
# Nifty handy functions.
echo2 () {
$ECHO2 "$*$ECHO2SUF" # these are defined later
}
log () {
echo >&3 "$MODE: $*"
}
run () {
echo >&3 "$MODE: >>> $*"
$* >&3 2>&3 </dev/null
}
exists () { # because some shells don't have test -e
if [ -f $1 -o -d $1 -o -h $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
return 0
else
return 1
fi
}
###########################################################################
# Test for the presence of a given include file or function. If the
# variable TEST is non-empty, it contains code to be placed at the end of
# main(), and should return 0 if everything is okay, else 1.
#
# For includes: Pass the include filename as an argument. The variable
# HAVE_include_name, where "include_name" is the name of the include file
# with letters uppercased and non-alphanumerics replaced by underscores, is
# set to 1 if the include file is present, else 0.
#
# For functions: Pass the return type, function name, and prototype as
# arguments. The variable HAVE_function, where "function" is the name
# of the function with letters uppercased, is set to 1 if the function is
# available, else 0.
#
# For both: The result code of the function will be 0 (true) if the entity
# is present, else 1 (false).
test_include () {
return 1
}
test_function () {
rettype="$1"
func="$2"
proto="$3"
if [ ! "$rettype" -o ! "$func" ] ; then
log "test_function: missing parameter(s)"
return 1
fi
if [ ! "$proto" ] ; then
proto="(...)"
fi
func2=`echo $func | tr '[a-z]' '[A-Z]'`
if [ ! "$TEST" ] ; then
TEST="return 0;"
fi
cat >tmp/test.c <<EOT
extern $rettype $func$proto;
int main() {
$TEST
}
EOT
rm -f tmp/test
if run $CC $CC_FLAGS tmp/test.c $CC_LIBS -o tmp/test && run tmp/test ; then
eval "HAVE_${func2}=1"
log "found $func"
return 0
else
eval "HAVE_${func2}=0"
log "didn't find $func"
return 1
fi
}
###########################################################################
###########################################################################
# Create a temporary directory for our use.
if [ -d tmp ] ; then
rm -rf tmp
fi
if mkdir tmp ; then : ; else
echo "Failed to create temporary directory! Exiting."
exit 2
fi
if chmod u+rwx tmp ; then : ; else
echo "Cannot write to temporary directory! Exiting."
exit 2
fi
###########################################################################
# Variable initialization.
BINDEST=/usr/local/sbin
DATDEST=/usr/local/lib/services
RUNGROUP=
UMASK=
IRCTYPE="no default"
IRCTYPE_DEF=
DALSERV=n
INSTALL=
CP_ALL=
CC=
CC_FLAGS=bonkle
CC_LIBS=bonkle
HAVE_STRERROR=
HAVE_SYS_ERRLIST=0
HAVE_SNPRINTF=
BAD_SNPRINTF=
HAVE_STRICMP=
HAVE_STRCASECMP=
HAVE_STRDUP=
HAVE_STRSPN=
HAVE_STRSIGNAL=
MISSING=bonkle
###########################################################################
# How can we echo something without going to the next line?
ECHO2SUF=''
if [ "`echo -n a ; echo b`" = "ab" ] ; then
ECHO2='echo -n'
elif [ "`echo 'a\c' ; echo 'b'`" = "ab" ] ; then
ECHO2='echo' ; ECHO2SUF='\c'
elif [ "`printf 'a' 2>&1 ; printf 'b\n' 2>&1`" = "ab" ] ; then
ECHO2='printf "%s"'
else
# oh well...
ECHO2='echo'
fi
export ECHO2 ECHO2SUF
###########################################################################
# Header
echo "Magick Configuration"
echo "===================="
echo ""
echo "Magick IRC Services are copyright (c) 1996-1998 Preston A. Elder."
echo " E-mail: <prez@magick.tm> IRC: PreZ@RelicNet"
echo "Originally based on EsperNet services (c) 1996-1998 Andy Church"
echo "This program is free but copyrighted software; see the file doc/COPYING"
echo "for details."
echo ""
###########################################################################
# Command-line parsing.
IGNORE_CACHE= ; USER_CC= ; USER_CC_FLAGS=bonkle ; USER_CC_LFLAGS=
USER_CC_LIBS=
export IGNORE_CACHE USER_CC USER_CC_FLAGS USER_CC_LFLAGS USER_CC_LIBS
while [ $# -gt 0 ] ; do
if [ "$1" = "-ignore-cache" ] ; then
IGNORE_CACHE=bonkle
elif [ "$1" = "-cc" ] ; then
shift
USER_CC=$1
elif [ "$1" = "-cflags" ] ; then
shift
USER_CC_FLAGS=$1
elif [ "$1" = "-lflags" ] ; then
shift
USER_CC_LFLAGS=$1
elif [ "$1" = "-libs" ] ; then
shift
USER_CC_LIBS=$1
else
if [ "$1" != "-help" ] ; then
echo >&2 Unknown option/parameter: "$1"
fi
cat >&2 <<EOT
Available options:
-ignore-cache Don't use cache file if it exists
-cc Specify C compiler to use (overrides cache and check)
-cflags Specify compilation flags (defaults: -O2 for gcc,
-O for other compilers; overrides cache/check)
-lflags Specify link flags for C compiler (default: none)
-libs Specify extra link libraries to use (default: none)
EOT
exit 1
fi
shift
done
###########################################################################
# First, test for the presence of a config.cache file. If found, either
# don't use it (-ignore-cache), or let the user know how to not use it and
# then use it.
if [ -f config.cache -a -r config.cache -a ! "$IGNORE_CACHE" ] ; then
cat <<EOT
Using defaults from config.cache. To ignore, either remove config.cache or
give the command-line option "-ignore-cache".
EOT
. config.cache
if [ ! "$HAVE_SNPRINTF" \
-o ! "$BAD_SNPRINTF" \
-o ! "$HAVE_STRICMP" \
-o ! "$HAVE_STRCASECMP" \
-o ! "$HAVE_STRDUP" \
-o ! "$HAVE_STRSPN" \
-o ! "$HAVE_STRSIGNAL" ] ; then
MISSING=bonkle
fi
fi
###########################################################################
# Ask the user anything we need to know ahead of time.
export ok INPUT
####
ok=0
echo "In what directory do you want the binaries to be installed?"
echo "Press Return for the default, or enter a new value."
while [ $ok -eq 0 ] ; do
echo2 "[$BINDEST] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$BINDEST
fi
if [ ! -d "$INPUT" ] ; then
if exists "$INPUT" ; then
echo "$INPUT exists, but is not a directory!"
else
echo "$INPUT does not exist. Create it?"
echo2 "[y] "
read YN
if [ "$YN" != "n" ] ; then
if mkdir $INPUT ; then
ok=1
fi
fi
fi
else
ok=1
fi
done
BINDEST=$INPUT
echo ""
####
ok=0
echo "Where do you want the data files to be installed?"
while [ $ok -eq 0 ] ; do
echo2 "[$DATDEST] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$DATDEST
fi
if [ ! -d "$INPUT" ] ; then
if exists "$INPUT" ; then
echo "$INPUT exists, but is not a directory!"
else
echo "$INPUT does not exist. Create it?"
echo2 "[y] "
read YN
if [ "$YN" != "n" ] ; then
if mkdir $INPUT ; then
ok=1
fi
fi
fi
else
ok=1
fi
done
DATDEST=$INPUT
echo ""
####
OLD_RUNGROUP="$RUNGROUP"
echo "Which group should all Services data files be owned by? (If Services"
echo "should not force files to be owned by a particular group, just press"
echo "Return.)"
echo2 "[$RUNGROUP] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
RUNGROUP=`echo $INPUT`
fi
echo ""
####
if [ ! "$UMASK" -o "$RUNGROUP" != "$OLD_RUNGROUP" ] ; then
if [ "$RUNGROUP" ] ; then
UMASK=007
else
UMASK=077
fi
fi
ok=0
echo "What should the default umask for data files be (in octal)?"
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
while [ $ok -eq 0 ] ; do
echo2 "[$UMASK] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$UMASK
fi
if [ `echo "$INPUT" | grep -c '[^0-7]'` -gt 0 ] ; then
echo "$UMASK is not a valid octal number!"
else
if [ "`echo $INPUT | cut -c1`" != "0" ] ; then
INPUT=0$INPUT
fi
ok=1
fi
done
UMASK=$INPUT
echo ""
####
ok=0
echo "Which of the following is closest to the type of server on your IRC"
echo "network?"
echo " 1) Base irc2 distribution (RFC 1459 compatible--but see README)"
echo " 2) irc2 with TS8 protocol"
echo " 3) Undernet (ircu)"
echo " 4) DALnet (ircd)"
while [ $ok -eq 0 ] ; do
echo2 "[$IRCTYPE] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$IRCTYPE
fi
case $INPUT in
no\ default)
echo "You must specify your IRC server type in order for Services to function"
echo "correctly."
;;
1)
IRCTYPE_DEF="IRC_CLASSIC"
ok=1
;;
2)
IRCTYPE_DEF="IRC_TS8"
ok=1
;;
3)
IRCTYPE_DEF="IRC_UNDERNET"
ok=1
;;
4)
IRCTYPE_DEF="IRC_DALNET"
unset YN
while [ -z "$YN" ]; do
echo "Are you using DAL4.4.15 or greater? "
$ECHO2 "[$DALSERV] $ECHO2SUF"
read YN
if [ "$YN" = "y" -o "$YN" = "Y" ] ; then
DALSERV=y
elif [ "$YN" = "n" -o "$YN" = "N" ] ; then
DALSERV=n
elif [ -z "$YN" ]; then
YN="$DALSERV"
else
unset YN
fi
done
ok=1
;;
*)
echo "Please enter a number from 1 to 5."
;;
esac
done
IRCTYPE=$INPUT
echo ""
####
echo "End of interactive configuration."
echo ""
###########################################################################
# Set up log file for automated tests, so we have a clue what's going on if
# something dies.
exec 3>configure.log
MODE=" "
TEST=""
export MODE TEST
###########################################################################
# Search for a compiler.
MODE="find_cc "
echo2 "Searching for a suitable compiler... "
if [ "$USER_CC" ] ; then
CC="$USER_CC"
echo "(supplied) using $CC."
log user supplied \`"$USER_CC'"
elif [ "$CC" ] ; then
echo "(cached) using $CC."
log cache supplied \`"$CC'"
elif run gcc --version ; then
echo "great, found gcc!"
CC=gcc
DEF_CC_FLAGS=-O2
log using \`gcc\'
else
echo "gcc not found."
echo2 " Looking for alternatives... "
echo >tmp/test.c "int main(){return 1;}"
if run cc tmp/test.c -o tmp/test ; then
CC=cc
elif run c89 tmp/test.c -o tmp/test ; then
CC=c89
else
echo "no C compiler found!"
echo " Use the -cc command line option to specify your C compiler."
log "automatic tests failed"
exit 2
fi
# See if it handles ANSI.
cat >tmp/test.c <<EOT
int main(int argc, char **argv) {
extern void foo(int bar);
}
EOT
log "test for ANSI..."
if run $CC tmp/test.c -o tmp/test ; then
echo "using $CC."
log using \`"$CC'"
else
echo "found $CC, but it's not ANSI-compliant!"
echo " Use the -cc command line option to specify your C compiler."
log \`"$CC' not ANSI-compliant"
exit 2
fi
DEF_CC_FLAGS=-O
fi
# Test compiler options.
MODE="find_ccopts "
if [ "$USER_CC_FLAGS" != bonkle ] ; then
CC_FLAGS="$USER_CC_FLAGS"
echo "Compiler flags supplied: $CC_FLAGS"
log user supplied flags: \`"$CC_FLAGS'"
elif [ "$CC_FLAGS" != bonkle ] ; then
echo "Compiler flags: (cached) $CC_FLAGS"
log cache supplied flags: \`"$CC_FLAGS'"
else
CC_FLAGS=$DEF_CC_FLAGS
echo2 "Testing default compiler flags ($CC_FLAGS)..."
cat >tmp/test.c <<EOT
int main(int argc, char **argv) {
extern void foo(int bar);
}
EOT
if run $CC $CC_FLAGS tmp/test.c -o tmp/test ; then
echo "looks good."
else
echo "no luck! Using no flags."
echo " If you know what flags you want, use the -cflags option to configure."
CC_FLAGS=
fi
log using flags: \`"$CC_FLAGS'"
fi
###########################################################################
if [ "$USER_CC_LFLAGS" != "bonkle" ] ; then
CC_LFLAGS=$USER_CC_LFLAGS
fi
###########################################################################
# See what libraries we have that we might need.
MODE="find_libs "
echo2 "Let's see what libraries are lying around... "
if [ "$CC_LIBS" != bonkle ] ; then
if [ "$CC_LIBS" ] ; then
echo "(cached) $CC_LIBS"
else
echo "(cached) none"
fi
log cache supplied \`"$CC_LIBS'"
else
CC_LIBS=
if run $CC $CC_FLAGS tmp/test.c -lnsl -o tmp/test ; then
CC_LIBS="$CC_LIBS -lnsl"
echo2 "-lnsl "
fi
if run $CC $CC_FLAGS tmp/test.c -lsocket -o tmp/test ; then
CC_LIBS="$CC_LIBS -lsocket"
echo2 "-lsocket "
fi
if run $CC $CC_FLAGS tmp/test.c -lbsd -o tmp/test ; then
CC_LIBS="$CC_LIBS -lbsd"
echo2 "-lbsd "
fi
echo ""
CC_LIBS="`echo $CC_LIBS | sed 's/^ +//'`"
fi
if [ "$USER_CC_LIBS" ] ; then
CC_LIBS="$CC_LIBS $USER_CC_LIBS"
echo "Additional user-supplied libraries: $USER_CC_LIBS"
log user added \`"$USER_CC_LIBS'"
fi
###########################################################################
# Look for missing/broken built-in routines, and similar compatibility
# stuff.
MODE="check_strerror "
echo2 "How to complain when something goes wrong... "
if [ "$HAVE_STRERROR" ] ; then
if [ "$HAVE_STRERROR" = 1 ] ; then
echo "(cached) strerror()."
log "cache supplied strerror()"
elif [ "$HAVE_SYS_ERRLIST" = 1 ] ; then
echo "(cached) sys_errlist."
log "cache supplied sys_errlist"
else
HAVE_SYS_ERRLIST=0 # just in case... you never know.
echo "(cached) pseudo sys_errlist."
log "cache supplied pseudo sys_errlist"
fi
else
cat >tmp/test.c <<EOT
int main() {
extern void strerror(void);
strerror();
}
EOT
if run $CC $CC_FLAGS tmp/test.c $CC_LIBS -o tmp/test ; then
HAVE_STRERROR=1
echo "ah, strerror() is here."
log "using strerror()"
else
HAVE_STRERROR=0
echo "no strerror()."
cat >tmp/test.c <<EOT
int main() {
extern char *sys_errlist[];
char *s;
s = sys_errlist[0];
}
EOT
log "trying sys_errlist..."
if run $CC $CC_FLAGS tmp/test.c $CC_LIBS -o tmp/test ; then
HAVE_SYS_ERRLIST=1
echo " But you have sys_errlist, which will do nicely."
log "using sys_errlist"
else
HAVE_SYS_ERRLIST=0
echo " You don't have sys_errlist either, so we'll have to make do."
log "using pseudo sys_errlist"
fi
fi
fi
echo2 "Looking for other routines we need that you don't have... "
MODE="check_compat "
if [ "$MISSING" != bonkle ] ; then
if [ ! "$MISSING" ] ; then
echo "(cached) none"
log "cache supplied: (none)"
else
echo "(cached)$MISSING"
log "cache supplied:$MISSING"
fi
else
MISSING=
MODE="check_snprintf "
TEST=' char buf[16];
int res;
if ((res = snprintf(buf, 8, "%d", 123456789)) != 7)
printf("test: snprintf broken (wrong return value: wanted 7, got %d)\n", res);
else if (strcmp(buf, "1234567") != 0)
printf("test: snprintf broken (bad result in buffer: wanted 1234567, got %s)\n", buf);
return 0;'
if test_function int snprintf "(char *, int, const char *, ...)" ; then
tmp="`tmp/test 2>&1`"
if [ "`echo $tmp | cut -d\ -f3 2>&1`" = "broken" ] ; then
BAD_SNPRINTF=1
log "found, but broken"
else
BAD_SNPRINTF=0
MISSING="$MISSING snprintf"
echo2 "snprintf "
fi
else
BAD_SNPRINTF=0
fi
MODE="check_stricmp "
TEST='extern int strnicmp(const char *, const char *, int); return stricmp("ABC","abc")==0 && strnicmp("ABC","abd",2)==0 ? 0 : 1;'
if test_function int stricmp "(const char *, const char *)" ; then
HAVE_STRCASECMP=0 # doesn't really matter
else
TEST='extern int strncasecmp(const char *, const char *, int); return strcasecmp("ABC","abc")==0 && strncasecmp("ABC","abd",2)==0 ? 0 : 1;'
if test_function int strcasecmp "(const char *, const char *)"
then : ; else
MISSING="$MISSING str[n]icmp"
echo2 "str[n]icmp "
fi
fi
MODE="check_strdup "
TEST='char *s,*t; s="ABC"; t=strdup(s); '"return (t!=(char *)0 && t[0]=='A' && t[1]=='B' && t[2]=='C' && t[3]==0) ? 0 : 1;"
if test_function "char *" strdup "(const char *)" ; then : ; else
MISSING="$MISSING strdup"
echo2 "strdup "
fi
MODE="check_strspn "
TEST='return (strspn("ABCBA","BA")==2 && strspn("123","123")==3) ? 0 : 1;'
if test_function int strspn "(const char *, const char *)" ; then : ; else
MISSING="$MISSING strspn"
echo2 "strspn "
fi
MODE="check_strsignal "
TEST="(void) strsignal(1); return 0;"
if test_function "char *" strsignal "(int)" ; then : ; else
MISSING="$MISSING strsignal"
echo2 "strsignal "
fi
echo ""
fi
if [ $HAVE_SNPRINTF = 0 -a $BAD_SNPRINTF = 0 ] ; then
cat <<EOT
*** Danger Will Robinson! Without snprintf(), Services may be vulnerable
*** to buffer overflows. Contact your OS vendor about installing a library
*** with snprintf() on your system.
EOT
fi
###########################################################################
MODE="check_install "
echo2 "Checking how to install files... "
if [ "$INSTALL" ] ; then
if [ "`echo $INSTALL | cut -c1`" = "." ] ; then
echo '(cached) using our own "install".'
log "cache says use our own"
else
echo '(cached) this system'\''s "install" works.'
log "cache says use regular "\`"install'"
fi
else
cat >tmp/test.c <<EOT
int main() { return 0; }
EOT
if run $CC $CC_FLAGS tmp/test.c $CC_LIBS -o tmp/test ; then : ; else
echo ""
echo ""
echo "*** WHOA THERE! ***"
echo ""
echo "We suddenly couldn't compile using the C compiler we already tested!"
echo "The command line we used was:"
echo " $CC $CC_FLAGS tmp/test.c $CC_LIBS -o tmp/test"
echo "Please try to fix this; if you can't, mail achurch@dragonfire.net"
echo "with information about your system, the output from this script,"
echo "and the "\`"configure.log' file generated by this script."
echo ""
exit 4
fi
if run install -m 500 tmp/test tmp/test2 && [ -f tmp/test ] && run cmp tmp/test tmp/test2 ; then
echo 'looks like "install" will work.'
if [ "$RUNGROUP" ] ; then
INSTALL="install -g $RUNGROUP -m 710"
else
INSTALL="install -m 700"
fi
else
echo \"install\"" doesn't seem to work."
echo " But we can still use cp and friends, so we'll roll our own "\"install\".
if [ "$RUNGROUP" ] ; then
INSTALL="./install-script -g $RUNGROUP -m 710"
else
INSTALL="./install-script -m 700"
fi
fi
log "using: $INSTALL"
fi
###########################################################################
MODE="check_copy_recur"
echo2 "Checking how to copy directories... "
if [ "$CP_ALL" ] ; then
echo "(cached) $CP_ALL"
log "cache supplied $CP_ALL"
else
sysname=`uname -s 2>&1`
log "sysname: $sysname"
case $sysname in
Linux) CP_ALL="cp -dpr";
log "guessing: cp -dpr";;
*) CP_ALL="cp -pr";
log "guessing: cp -pr";;
esac
if [ ! -f tmp/test2 ] ; then
run cp tmp/test tmp/test2
fi
if run mkdir tmp/testA && run mkdir tmp/testB && run mv tmp/test2 tmp/testA
then : ; else
echo ""
echo ""
echo "*** WHOA THERE! ***"
echo ""
echo "A few simple mkdir's and mv's failed!"
echo "Are you out of disk space?"
exit 4
fi
if run $CP_ALL tmp/testA/* tmp/testB && run cmp tmp/testA/test2 tmp/testB/test2 ; then
echo "$CP_ALL"
log \`"$CP_ALL' works"
else
log \`"$CP_ALL' doesn't work"
run rm -rf tmp/testB/*
if run sh -c 'tar -Ccf tmp/testA - . | tar -Cxf tmp/testB -' ; then
echo "tar (yuck)"
CP_ALL="./cp-recursive -t"
log "using tar"
else
log "tar failed(!)"
echo ""
echo " Neither cp nor tar work! I give up."
exit 2
fi
fi
fi
###########################################################################
# Create files.
echo2 "Creating sysconf.h... "
cat >sysconf.h <<EOT
/*
* This file is generated automatically by "configure". Any changes made
* to it will be erased next time "configure" is run.
*/
#define SERVICES_DIR "$DATDEST"
EOT
if [ "$RUNGROUP" ] ; then cat >>sysconf.h <<EOT
#define RUNGROUP "$RUNGROUP"
EOT
fi
cat >>sysconf.h <<EOT
#define DEFUMASK $UMASK
EOT
cat >>sysconf.h <<EOT
#define $IRCTYPE_DEF
EOT
if [ "$DALSERV" = "y" ] ; then cat >>sysconf.h <<EOT
#define DAL_SERV
EOT
fi
cat >>sysconf.h <<EOT
#define HAVE_STRERROR $HAVE_STRERROR
#define HAVE_SYS_ERRLIST $HAVE_SYS_ERRLIST
#define HAVE_SNPRINTF $HAVE_SNPRINTF
#define BAD_SNPRINTF $BAD_SNPRINTF
#define HAVE_STRICMP $HAVE_STRICMP
#define HAVE_STRCASECMP $HAVE_STRCASECMP
#define HAVE_STRDUP $HAVE_STRDUP
#define HAVE_STRSPN $HAVE_STRSPN
#define HAVE_STRSIGNAL $HAVE_STRSIGNAL
EOT
echo "done."
echo2 "Creating Makefile.inc... "
cat >Makefile.inc <<EOT
# This file is generated automatically by "configure". Any changes made
# to it will be erased next time "configure" is run.
CC=$CC
EXTRA_CFLAGS=$CC_FLAGS
LFLAGS=$CC_LFLAGS
LIBS=$CC_LIBS
BINDEST=$BINDEST
DATDEST=$DATDEST
INSTALL=$INSTALL
CP_ALL=$CP_ALL
RUNGROUP=$RUNGROUP
OBJ=o
EOT
echo "done."
###########################################################################
# Save results in cache for next time around.
echo2 "Saving configuration results in config.cache... "
cat <<EOT >config.cache
BINDEST="$BINDEST"
DATDEST="$DATDEST"
INSTALL="$INSTALL"
CP_ALL="$CP_ALL"
RUNGROUP="$RUNGROUP"
UMASK=$UMASK
NETWORK_DOMAIN="$NETWORK_DOMAIN"
IRCTYPE=$IRCTYPE
IRCTYPE_DEF="$IRCTYPE_DEF"
DALSERV="$DALSERV"
CC="$CC"
CC_FLAGS="$CC_FLAGS"
CC_LFLAGS="$CC_LFLAGS"
CC_LIBS="$CC_LIBS"
HAVE_STRERROR=$HAVE_STRERROR
HAVE_SYS_ERRLIST=$HAVE_SYS_ERRLIST
HAVE_SNPRINTF=$HAVE_SNPRINTF
BAD_SNPRINTF=$BAD_SNPRINTF
HAVE_STRICMP=$HAVE_STRICMP
HAVE_STRCASECMP=$HAVE_STRCASECMP
HAVE_STRDUP=$HAVE_STRDUP
HAVE_STRSPN=$HAVE_STRSPN
HAVE_STRSIGNAL=$HAVE_STRSIGNAL
MISSING="$MISSING"
EOT
echo "done."
###########################################################################
echo 'All done!'
echo '#**********************************#'
echo '# Type "make" to compile Magick. #'
echo '#**********************************#'
exit 0