-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigure
executable file
·1890 lines (1661 loc) · 39.4 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
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#! /bin/sh
#
# mouse:~ppr/src/Configure
# Copyright 1995--2008, Trinity College Computing Center.
# Written by David Chappell.
#
# This file is part of PPR. You can redistribute it and modify it under the
# terms of the revised BSD licence (without the advertising clause) as
# described in the accompanying file LICENSE.txt.
#
# Last modified 21 August 2008.
#
# If this script was not invoked by "make configure", do it now.
# "make configure" loads prior settings, selects an appropriate
# shell and runs this script again.
#
if [ -z "$CONFIGURE_RUNNING_FROM_MAKEFILE" ]
then
echo "Running make configure..."
# Don't combine these two lines, some borne shells don't like it.
SAVED_ARGV="$*"
export SAVED_ARGV
test -f Makefile.conf || touch Makefile.conf
make configure
exit $?
fi
# Find an echo that will supports escapes.
echo "Searching for echo which supports escapes..."
EECHO=echo
for i in echo "echo -e" /bin/echo "/bin/echo -e" /usr/ucb/echo print
do
echo " Trying $i..."
if [ `/bin/sh -c "$i '\n'" 2>/dev/null | wc -l` -eq 2 ]
then
echo " Chose $i."
EECHO=$i
break
fi
done
# Function to find a program in the specified $PATH style
# search list. The first argument is the program to find,
# the second is the search list.
findprog_prog_path ()
{
echo "Searching for $1" >&2
for i in `echo $2 | tr ':' ' '`
do
if [ `echo $i | cut -c1` = '/' ]
then
# echo " Trying $i/$1" >&2
if [ -x "$i/$1" ]
then
echo " Found $i/$1" >&2
echo "$i/$1"
return
fi
fi
done
echo "Not found" >&2
}
#
# Help screen
#
help_page ()
{
cat - <<EndOfHelp
./Configure
--prefix=
--sysconfdir=
--bindir=
--libdir=
--datadir=
--spooldir=
--x11bindir= -- where is xterm?
--with-gcc -- use GCC
--without-gcc -- use native compiler
--user-ppr=
--user-pprwww=
--group-ppr=
--with-gdbm -- link with GDBM
--without-gdbm
--with-tdb -- link with TBD
--without-tdb
--with-gettext -- link with GNU Gettext
--without-gettext
--help
Environment variables heeded:
PATH used to search for programs such as perl
CFLAGS flags to pass to C compiler
GUNZIP path to gunzip
UNCOMPRESS path to uncompress
BUNZIP2 path to bunzip2
EndOfHelp
}
#
# Parse the command line options.
#
opt_prefix="/usr"
opt_sysconfdir=""
opt_bindir=""
opt_libdir=""
opt_datadir=""
opt_spooldir=""
opt_rundir=""
opt_prompt_paths=1
opt_with_gcc=1
opt_prompt_compiler=1
opt_user_ppr="ppr"
opt_user_pprwww="pprwww"
opt_group_ppr="ppr"
opt_prompt_users=1
opt_with_gdbm=1
opt_prompt_gdbm=1
opt_with_tdb=1
opt_prompt_tdb=1
opt_with_gettext=1
opt_prompt_gettext=1
for opt in $SAVED_ARGV
do
case $opt in
--prefix=* )
opt_prefix=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--sysconfdir=* )
opt_sysconfdir=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--bindir=* )
opt_bindir=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--libdir=* )
opt_libdir=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--datadir=* )
opt_datadir=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--spooldir=* )
opt_spooldir=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--rundir=* )
opt_rundir=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--x11bindir=* )
opt_x11bindir=`echo $opt | cut -d= -f2`
opt_prompt_paths=0
;;
--with-gcc )
opt_with_gcc=1
opt_prompt_compiler=0
;;
--without-gcc )
opt_with_gcc=0
opt_prompt_compiler=0
;;
--user-ppr=* )
opt_user_ppr=`echo $opt | cut -d= -f2`
opt_prompt_users=0
;;
--user-pprwww=* )
opt_user_pprwww=`echo $opt | cut -d= -f2`
opt_prompt_users=0
;;
--group-ppr=* )
opt_group_ppr=`echo $opt | cut -d= -f2`
opt_prompt_users=0
;;
--with-gdbm )
opt_with_gdbm=1
opt_prompt_gdbm=0
;;
--without-gdbm )
opt_with_gdbm=0
opt_prompt_gdbm=0
;;
--with-tdb )
opt_with_tdb=1
opt_prompt_tdb=0
;;
--without-tdb )
opt_with_tdb=0
opt_prompt_tdb=0
;;
--with-gettext )
opt_with_gettext=1
opt_prompt_gettext=0
;;
--without-gettext )
opt_with_gettext=0
opt_prompt_gettext=0
;;
--help )
help_page
exit 0
;;
* )
echo "Unrecognized option: $opt"
exit 1
;;
esac
done
if [ -z "$opt_sysconfdir" ]
then
if [ "$opt_prefix" = "/usr" ]
then
opt_sysconfdir="/etc"
else
opt_sysconfdir="$opt_prefix/etc"
fi
fi
opt_bindir=${opt_bindir:-$opt_prefix/bin}
opt_libdir=${opt_libdir:-$opt_prefix/lib}
opt_datadir=${opt_datadir:-$opt_prefix/share}
opt_spooldir=${opt_spooldir:-/var/spool}
opt_rundir=${opt_rundir:-/var/run/ppr2}
opt_x11bindir=${opt_x11bindir:-/usr/bin/X11}
#
# Try to detect the operating system.
#
echo "Detecting OS..."
case `uname -s` in
ATTWGS ) # dubious
SYSTEM="ATTWGS"
DESCRIPTION="AT&T WGS Unix"
CC_NATIVE=0
CC_GCC=1
;;
Linux )
SYSTEM="LINUX"
DESCRIPTION="Linux"
CC_NATIVE=0
CC_GCC=1
;;
FreeBSD )
SYSTEM="FREEBSD"
DESCRIPTION="FreeBSD 3.1R"
CC_NATIVE=0
CC_GCC=1
;;
SunOS )
major=`uname -r | cut -d. -f1`
minor=`uname -r | cut -d. -f2`
case $major in
4 )
SYSTEM="SUNOS4"
DESCRIPTION="SunOS 4.1.3_U1"
CC_NATIVE=0
CC_GCC=1
;;
5 )
if [ $minor -lt 6 ]
then
SYSTEM="SUNOS_5"
DESCRIPTION="SunOS 5.0 thru 5.5.1"
CC_NATIVE=0
CC_GCC=1
else
SYSTEM="SUNOS_5_6"
DESCRIPTION="SunOS 5.6 thru 5.8"
CC_NATIVE=0
CC_GCC=1
fi
;;
* )
echo "Unrecognized SunOS major version $major."
exit 1
;;
esac
;;
OSF1 )
SYSTEM="OSF1"
DESCRIPTION="OSF/1 3.2 or Digital Unix 4.0"
CC_NATIVE=1
CC_GCC=1
;;
IRIX )
SYSTEM="IRIX"
DESCRIPTION="IRIX 6.3"
CC_NATIVE=1
CC_GCC=1
;;
NetBSD )
SYSTEM="NETBSD"
DESCRIPTION="NetBSD 1.0"
CC_NATIVE=0
CC_GCC=1
;;
Cygwin )
SYSTEM="CYGWIN"
DESCRIPTION="Cygwin 1.x"
CC_NATIVE=0
CC_GCC=1
;;
UWIN )
SYSTEM="UWIN"
DESCRIPTION="UWIN 2.x"
CC_NATIVE=1
CC_GCC=1
;;
HP-UX )
SYSTEM="HPUX"
DESCRIPTION="HPUX 10.2"
CC_NATIVE=1
CC_GCC=1
;;
ULTRIX )
SYSTEM="ULTRIX"
DESCRIPTION="ULTRIX 4.4 RISC"
ACTUAL_SYSTEM=`uname -s | tr -d '-'`
CC_NATIVE=1
CC_GCC=0
;;
Darwin )
SYSTEM="DARWIN"
DESCRIPTION="Darwin (Mac OS X)"
CC_NATIVE=0
CC_GCC=1
;;
* )
echo "No rule for OS `uname -s`. Please fix this script or use ./Configure instead."
exit 1
;;
esac
echo " OS is $SYSTEM."
#
# If both GCC and a native compiler are available and the user hasn't
# specified a preference on the command line, ask now, otherwise
# pick
if [ $opt_prompt_compiler -ne 0 -a $CC_GCC -ne 0 -a $CC_NATIVE -ne 0 ]
then
answer="?"
while [ "$answer" = "?" ]
do
$EECHO "Use native cc? \c"
read answer
case "$answer" in
[yY]* )
answer="yes"
;;
[nN]* )
answer="no"
;;
* )
answer="?";
;;
esac
done
NATIVE_CC=$answer
else
if [ $CC_GCC -ne 0 -a $opt_with_gcc -ne 0 ]
then
NATIVE_CC="no"
else
if [ $CC_NATIVE -ne 0 ]
then
NATIVE_CC="yes"
else
echo "No supported C compiler found."
exit 1
fi
fi
fi
if [ "$NATIVE_CC" = "yes" ]
then
echo "The system's own C compiler will be used."
else
echo "GCC will be used."
fi
#
# Create a list of default install locations.
#
CONFDIR=$opt_sysconfdir/ppr2
LIBDIR=$opt_libdir/ppr2
SHAREDIR=$opt_datadir/ppr2
VAR_SPOOL_PPR=$opt_spooldir/ppr2
VAR_LIB_PPR=/var/lib/ppr2
RUNDIR=$opt_rundir
TEMPDIR=/tmp
SYSBINDIR=$opt_bindir
XWINBINDIR=$opt_x11bindir
echo "\$CONFDIR=$CONFDIR"
echo "\$LIBDIR=$LIBDIR"
echo "\$SHAREDIR=$SHAREDIR"
echo "\$VAR_SPOOL_PPR=$VAR_SPOOL_PPR"
echo "\$VAR_LIB_PPR=$VAR_LIB_PPR"
echo "\$RUNDIR=$RUNDIR"
echo "\$TEMPDIR=$TEMPDIR"
echo "\$SYSBINDIR=$SYSBINDIR"
echo "\$XWINBINDIR=$XWINBINDIR"
#========================================================================
# Figure out which user and group names to use.
#========================================================================
# These defaults are the values in global_defines.h.
USER_PPR=${opt_user_ppr:-ppr}
USER_PPRWWW=${opt_user_pprwww:-pprwww}
GROUP_PPR=$opt_group_ppr
# MS-Windows NT doesn't allow a user and a group with the same name!
if [ $GROUP_PPR = "" ]
then
if [ $SYSTEM = "UWIN" -o $SYSTEM = "CYGWIN" ]
then
GROUP_PPR="pprgrp"
else
GROUP_PPR="ppr"
fi
fi
if [ $opt_prompt_users -ne 0 ]
then
echo
echo "Please choose the users and groups that will own PPR files and processes."
echo "These users and groups should be used only by PPR. They need not exist"
echo "right now, they can be created later."
echo
$EECHO "PPR user [$USER_PPR]: \c"
read answer
if [ -n "$answer" ]; then USER_PPR=$answer; fi
echo
$EECHO "PPR group [$GROUP_PPR]: \c"
read answer
if [ -n "$answer" ]; then GROUP_PPR=$answer; fi
echo
$EECHO "PPR WWW user [$USER_PPRWWW]: \c"
read answer
if [ -n "$answer" ]; then USER_PPRWWW=$answer; fi
echo
fi
echo "\$USER_PPR=$USER_PPR"
echo "\$USER_PPRWWW=$USER_PPRWWW"
echo "\$GROUP_PPR=$GROUP_PPR"
#
# Ask about GDBM:
#
if [ $opt_prompt_gdbm -gt 0 ]
then
echo
echo "PPR can use GNU dbm (GDBM). You can obtain GDBM from"
echo "<http://www.gnu.org/directory/gdbm.html>. Please note"
echo "that PPR binaries linked with GDBM must be distributed in accord"
echo "with the terms of the GPL."
echo
echo "Do you have and wish to use GDBM?"
echo
echo "(If you say no, the user database will not work. See the"
echo "ppuser(8) man page for information about this feature."
echo "Almost all users can do without this feature.)"
echo
answer="?"
while [ "$answer" = "?" ]
do
$EECHO "Use gdbm? [yes] \c"
read answer
case "$answer" in
[yY]* )
answer="1"
;;
[nN]* )
answer=""
;;
'' )
answer="1"
;;
* )
answer="?";
;;
esac
done
echo
USE_GDBM=$answer
else
if [ $opt_with_gdbm -gt 0 ]
then
USE_GDBM="1"
else
USE_GDBM=""
fi
fi
if [ -n "$USE_GDBM" ]
then
echo "PPR will use GDBM."
else
echo "PPR features which require GDBM will be disabled."
fi
#
# Ask about TDB:
#
if [ $opt_prompt_tdb -ne 0 ]
then
echo
echo "PPR can use the Trivial Database Library (TDB). TDB is a library"
echo "used internaly by Samba. You can obtain it in library form from"
echo "<http://sourceforge.net/projects/tdb/>. Please note that PPR linked"
echo "with TDB must be distributed in accord with the terms of the GPL."
echo
echo "Do you have and wish to use TDB?"
echo
echo "(If you say no, then automatic Samba client printer driver download"
echo "will not work."
echo
answer="?"
while [ "$answer" = "?" ]
do
$EECHO "Use tdb? [yes] \c"
read answer
case "$answer" in
[yY]* )
answer="1"
;;
[nN]* )
answer=""
;;
'' )
answer="1"
;;
* )
answer="?";
;;
esac
done
echo
USE_TDB=$answer
else
if [ $opt_with_tdb -gt 0 ]
then
USE_TDB="1"
else
USE_TDB=""
fi
fi
if [ -n "$USE_TDB" ]
then
echo "PPR will use TDB."
else
echo "PPR features which require TDB will be disabled."
fi
#
# Ask about internationalized of messages
#
if [ $opt_prompt_gettext -gt 0 ]
then
echo
echo "Do you want support for translation of messages to non-English languages?"
echo "This option requires the GNU Gettext package. The number of available"
echo "translations is still small. If you would like to contribute translations"
echo "into additional languages, compile with this option on and read"
echo "po/README.txt for instructions."
echo
answer="?"
while [ "$answer" = "?" ]
do
# prompt
$EECHO "Include international messages support? [yes] \c"
read answer
case "$answer" in
[yY]* )
answer="yes"
;;
[nN]* )
answer="no"
;;
'' )
answer="yes"
;;
* )
answer="?"
;;
esac
done
if [ $answer = "yes" ]
then
INTERNATIONAL="1" # don't comment out
else
INTERNATIONAL="" # comment out
fi
echo
else
if [ $opt_with_gettext -gt 0 ]
then
INTERNATIONAL="1"
else
INTERNATIONAL=""
fi
fi
if [ -n "$INTERNATIONAL" ]
then
echo "GNU Gettext will be used."
else
echo "GNU Gettext won't be used."
fi
echo
#
# Look for various AppleTalk libraries. Accept the first seemingly complete
# one we find.
#
ATALKTYPE=""
ATALKTYPE_LONG="None"
ATALKLIBS=""
ATALKFLAGS=""
if [ -z "$ATALKTYPE" ]
then
echo "Looking for NATALI and Netatalk..."
for prefix in /usr/local /usr
do
if [ -f "$prefix/lib/libnatali.a" ]
then
echo " Found \"$prefix/lib/libnatali.a\"."
for prefix2 in /usr/local/atalk /usr/local /usr
do
if [ -f "$prefix2/lib/libatalk.a" ]
then
echo " Found \"$prefix2/lib/libatalk.a\"."
ATALKTYPE="ali"
ATALKTYPE_LONG="NATALI and Netatalk"
ATALKFLAGS="-I $prefix/include -I $prefix2/include"
ATALKLIBS="$prefix/lib/libnatali.a $prefix2/lib/libatalk.a"
break;
fi
done
if [ "$ATALKTYPE_LONG" != "NATALI and Netatalk" ]
then
echo "You have NATALI, but Netatalk is missing!"
exit 1
fi
break
fi
done
fi
if [ -z "$ATALKTYPE" ]
then
echo "Looking for the Columbia AppleTalk Program (CAP)..."
for prefix in /usr/local /usr
do
if [ -f "$prefix/lib/libcap.a" ]
then
echo " Found \"$prefix/lib/libcap.a\"."
if [ ! -d "$prefix/include/netat" ]
then
echo "CAP include directory at \"$prefix/include/netat\" is missing."
exit 1
fi
if [ ! -f "$prefix/include/netat/abpap.h" ]
then
echo "You didn't install CAP's abpap.h in $prefix/include/netat as INSTALL.txt instructs."
exit 1
fi
ATALKTYPE="cap"
ATALKTYPE_LONG="Columbia AppleTalk Program"
ATALKFLAGS="-I $prefix/include"
ATALKLIBS="$prefix/lib/libcap.a \$(SOCKLIBS)"
echo
break
fi
done
fi
if [ -z "$ATALKTYPE" ]
then
echo "Looking for the AT&T/NCR AppleTalk Network Program..."
if [ -f /usr/lib/libanp.so ]
then
echo " Found \"/usr/lib/libanp.so\"."
ATALKTYPE="ali"
ATALKTYPE_LONG="AT&T/NCR AppleTalk Network Program"
ATALKFLAGS=""
ATALKLIBS="-lanp"
echo
fi
fi
if [ "$ATALKTYPE" = "" ]
then
echo " No AppleTalk."
else
echo " Will use $ATALKTYPE_LONG AppleTalk."
fi
echo
if [ -z "$SENDMAIL_PATH" ]
then
SENDMAIL_PATH=`findprog_prog_path sendmail /usr/sbin /usr/lib /usr/ucblib`
if [ -z "$SENDMAIL_PATH" ]
then
SENDMAIL_PATH="/usr/lib/sendmail"
fi
fi
if [ -z "$PERL_PATH" ]
then
PERL_PATH=`findprog_prog_path perl $PATH`
if [ -z "$PERL_PATH" ]
then
PERL_PATH="/usr/bin/perl"
fi
fi
if [ -z "$GUNZIP_PATH" ]
then
GUNZIP_PATH=`findprog_prog_path gunzip $PATH`
fi
if [ -z "$UNCOMPRESS_PATH" ]
then
UNCOMPRESS_PATH=`findprog_prog_path uncompress $PATH`
fi
if [ -z "$BUNZIP2_PATH" ]
then
BUNZIP2_PATH=`findprog_prog_path bunzip2 $PATH`
fi
#
# See if we can find Zlib.
#
echo "Searching for Zlib..."
if [ -f /usr/include/zlib.h -o -f /usr/local/include/zlib.h ]
then
echo " Found."
HAVE_ZLIB="1"
else
echo " Not found."
HAVE_ZLIB=""
fi
echo
#
# Come up with a set of CFLAGS.
#
if [ -n "$CFLAGS" ]
then
echo "Using CFLAGS provided: $CFLAGS"
else
CFLAGS="-O2"
# If we will use GCC,
if [ $NATIVE_CC = "no" ]
then
# Turn off support for c99 since we are aiming to write c89 code.
# We don't do this because we want snprintf().
#CFLAGS="$CFLAGS -std=c89"
# Select the warnings which we want to see.
CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wmissing-declarations -Wno-format-y2k"
echo "Selecting appropriate processor options for GCC."
PROCESSOR=`uname -m`
GCC_VERSION=`gcc --version | head -1`
GCC_VERSION_SHORT=`echo $GCC_VERSION | sed -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9\.][0-9\.]*\).*$/\1/'`
echo " GCC version: $GCC_VERSION_SHORT ($GCC_VERSION)"
echo " Processor: $PROCESSOR"
# If this is an Intel platform and the GCC version is prior to 2.7.2.1, then add i
# -fno-strength-reduce in order to avoid generating bad code.
case $PROCESSOR in
i[3456789]86 )
case $GCC_VERSION_SHORT in
2.7.2.[1-9] | 2.[89]* | [3456789].* )
;;
* )
echo " Pre-2.7.2.1 GCC or unrecognized variant, turning off"
echo " buggy strength-reduce optimization."
CFLAGS="$CFLAGS -fno-strength-reduce"
;;
esac
esac
#
# Add additional options for certain CPUs. Suggestions are welcome.
#
case $PROCESSOR in
i386 ) # default anyway?
;;
i[456]86 )
case $GCC_VERSION_SHORT in
3.[456789]* | [456789].* )
echo " Selecting $PROCESSOR code generation."
CFLAGS="$CFLAGS -march=$PROCESSOR -fomit-frame-pointer"
;;
3.* | 2.9* )
echo " Selecting $PROCESSOR code generation."
CFLAGS="$CFLAGS -mcpu=$PROCESSOR -fomit-frame-pointer"
;;
* )
echo " Selecting i486 code generation because $PROCESSOR may not be available."
CFLAGS="$CFLAGS -mcpu=i486 -fomit-frame-pointer"
;;
esac
;;
* )
;;
esac
fi
fi
echo
#========================================================================
# Start of Makefile.conf builder code.
#========================================================================
echo "Building Makefile.conf..."
exec 3>Makefile.conf
#========================================================================
echo " Building header..."
cat >&3 <<===EndOfHere10===
#
# ~ppr/src/Makefile.conf
# Generated on `date` by Configure.
#
# This name of the system on which PPR will be compiled.
# You should change this if you are creating a new port.
export PORT_NAME=$SYSTEM
# Do we want international messages support?
# This uses GNU Gettext.
export INTERNATIONAL=${INTERNATIONAL}
===EndOfHere10===
if [ -n "$INTERNATIONAL" ]
then
echo "INTLLIBS=-lintl -liconv" >&3
echo "INTERNATIONAL_ALL=all-international" >&3
echo "INTERNATIONAL_INSTALL=install-international" >&3
else
echo "#INTLLIBS=-lintl -liconv" >&3
echo "#INTERNATIONAL_ALL=all-international" >&3
echo "#INTERNATIONAL_INSTALL=install-international" >&3
fi
echo >&3
cat >&3 <<===EndOfHere15===
# Define the owner and group of most PPR files.
export USER_PPR=$USER_PPR
export GROUP_PPR=$GROUP_PPR
export USER_PPRWWW=$USER_PPRWWW
# Directory for program files and such.
export LIBDIR=$LIBDIR
# Directory for architecture independent files
export SHAREDIR=$SHAREDIR
# Directory into which to install configuration files.
export CONFDIR=$CONFDIR
# Directory for spool files.
export VAR_SPOOL_PPR=$VAR_SPOOL_PPR
# Directory for replacable cache files
export CACHEDIR=/var/cache/ppr2
# Directory for spooler state
export STATEDIR=/var/lib/ppr2
# Directory for PID files and such.
export RUNDIR=$RUNDIR
# Directory for temporary files.
export TEMPDIR=$TEMPDIR
# Directory for symbolic links to PPR executables
export SYSBINDIR=$SYSBINDIR
# Directory were we will find X-Windows programs
export XWINBINDIR=$XWINBINDIR
===EndOfHere15===
cat >&3 <<'===EndOfHere16==='
# Directory for HTML files. If you change this
# you will have to fix makeprogs/make_install_dirs.sh too.
export WWWDIR=$(SHAREDIR)/www
# Directory into which man pages wll beinstalled
export MANDIR=$(SHAREDIR)/man
# Directory for the CGI programs for the WWW interface
export CGI_BIN=$(LIBDIR)/cgi-bin
# Directory for Perl libraries
export PERL_LIBDIR=$(LIBDIR)
#----------------------------------------
# Various configuration directories
#----------------------------------------
# printer configuration files
export PRCONF=$(CONFDIR)/printers
# group configuration files
export GRCONF=$(CONFDIR)/groups
# queue alias configuration files
export ALIASCONF=$(CONFDIR)/aliases
# default destination configuration file
export DEFAULT_CONFFILE=$(CONFDIR)/default
# Access Control Lists
export ACLDIR=$(CONFDIR)/acl
#----------------------------------------
# Subdirectories
#----------------------------------------
export BINDIR=$(LIBDIR)/bin
export PRINTERS_PURGABLE_STATEDIR=$(CACHEDIR)/printers
export PRINTERS_PERSISTENT_STATEDIR=$(STATEDIR)/printers
export GROUPS_PERSISTENT_STATEDIR=$(STATEDIR)/groups
export MISCDIR=$(SHAREDIR)/misc
#----------------------------------------
# Various configuration files
#----------------------------------------
# main PPR configuration file
export PPR_CONF=$(CONFDIR)/ppr.conf
# users database file name
export DBNAME=$(CONFDIR)/charge_users.db
# media definitions
export MEDIAFILE=$(CONFDIR)/media.db
# new printer configuration lines
export NEWPRN_CONFIG=$(CONFDIR)/newprn.conf
#----------------------------------------
# Configuration files that aren't meant
# to be changed:
#----------------------------------------
# MetaFont modes for various printers
export MFMODES=$(MISCDIR)/mfmodes.conf
# font substitution database
export FONTSUB=$(MISCDIR)/fontsub.conf
# LaserWriter errors file
export LW_MESSAGES_CONF=$(MISCDIR)/lw-messages.conf
# PJL USTATUS DEVICE errors file
export PJL_MESSAGES_CONF=$(MISCDIR)/pjl-messages.conf
# for ppr -H editps
export EDITPSDIR=$(LIBDIR)/editps
export EDITPSCONF=$(EDITPSDIR)/editps.conf
# map characters set to PostScript encodings
export CHARSETSCONF=$(MISCDIR)/charsets.conf
# list of fonts and the PostScript encodings they support
export FONTSCONF=$(MISCDIR)/fonts.conf
# additional PostScript *PageSize names
export PAGESIZES_CONF=$(MISCDIR)/pagesizes.conf
# additional PostScript error explainations
export PSERRORS_CONF=$(MISCDIR)/pserrors.conf
#----------------------------------------
# Special files used by the spooler:
#----------------------------------------
# file with previous queue id number