Mercurial > hg > toybox
annotate kconfig/lxdialog/check-lxdialog.sh @ 953:13916d161ec0
xzcat: remove XZ_(PREALLOC|SINGLE), inline xz_dec_bcj_create
Because we only use XZ_DYNALLOC, there's a bunch of dead code.
This patch removes the #ifdef's and if()s associated with support for
multiple modes.
single_call was only used to store the mode; it is no longer needed.
A little bit of reorganization was needed to reduce the number of prototypes.
Documentation associated with dead code was dropped.
There are still some relics of multiple modes in the continued presence
of "XZ_DYNALLOC" and xz_mode.
Additionally, I inlined xz_dec_bcj_create; it was called once.
This loses about 125 lines, mostly comments.
author | Isaac Dunham <idunham@lavabit.com> |
---|---|
date | Wed, 17 Jul 2013 17:25:07 -0500 |
parents | 4d21d59f3206 |
children |
rev | line source |
---|---|
10
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
1 #!/bin/sh |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
2 # Check ncurses compatibility |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
3 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
4 # What library to link |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
5 ldflags() |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
6 { |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
7 $cc -print-file-name=libncursesw.so | grep -q / |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
8 if [ $? -eq 0 ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
9 echo '-lncursesw' |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
10 exit |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
11 fi |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
12 $cc -print-file-name=libncurses.so | grep -q / |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
13 if [ $? -eq 0 ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
14 echo '-lncurses' |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
15 exit |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
16 fi |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
17 $cc -print-file-name=libcurses.so | grep -q / |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
18 if [ $? -eq 0 ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
19 echo '-lcurses' |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
20 exit |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
21 fi |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
22 exit 1 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
23 } |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
24 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
25 # Where is ncurses.h? |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
26 ccflags() |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
27 { |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
28 if [ -f /usr/include/ncurses/ncurses.h ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
29 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
30 elif [ -f /usr/include/ncurses/curses.h ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
31 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
32 elif [ -f /usr/include/ncurses.h ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
33 echo '-DCURSES_LOC="<ncurses.h>"' |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
34 else |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
35 echo '-DCURSES_LOC="<curses.h>"' |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
36 fi |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
37 } |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
38 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
39 # Temp file, try to clean up after us |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
40 tmp=.lxdialog.tmp |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
41 trap "rm -f $tmp" 0 1 2 3 15 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
42 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
43 # Check if we can link to ncurses |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
44 check() { |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
45 echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
46 if [ $? != 0 ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
47 echo " *** Unable to find the ncurses libraries." 1>&2 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
48 echo " *** make menuconfig require the ncurses libraries" 1>&2 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
49 echo " *** " 1>&2 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
50 echo " *** Install ncurses (ncurses-devel) and try again" 1>&2 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
51 echo " *** " 1>&2 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
52 exit 1 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
53 fi |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
54 } |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
55 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
56 usage() { |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
57 printf "Usage: $0 [-check compiler options|-header|-library]\n" |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
58 } |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
59 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
60 if [ $# == 0 ]; then |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
61 usage |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
62 exit 1 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
63 fi |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
64 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
65 cc="" |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
66 case "$1" in |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
67 "-check") |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
68 shift |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
69 cc="$@" |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
70 check |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
71 ;; |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
72 "-ccflags") |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
73 ccflags |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
74 ;; |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
75 "-ldflags") |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
76 shift |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
77 cc="$@" |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
78 ldflags |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
79 ;; |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
80 "*") |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
81 usage |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
82 exit 1 |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
83 ;; |
4d21d59f3206
Add menuconfig, plus some basic Config info, lots of which is just future
landley@driftwood
parents:
diff
changeset
|
84 esac |