File: Configure

package info (click to toggle)
twin 0.4.0-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,804 kB
  • ctags: 23,904
  • sloc: ansic: 61,860; cpp: 1,023; makefile: 777; sh: 552; lex: 302; yacc: 231
file content (164 lines) | stat: -rwxr-xr-x 5,578 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

for ac_option
do
  case "$ac_option" in

  -help | --help | --hel | --he)
    cat << EOF
Usage: scripts/Configure [OPTIONS]
Options: [defaults in brackets after descriptions]
  --help                  print this message
  --show                  show current configuration
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
--enable options recognized:
  --enable--shlibs[=yes|no]              enable building shared libraries
  --enable--modules[=yes|no]             enable building shared modules
  --enable--alloc[=yes|no]               enable custom malloc/free routines
  --enable--unicode[=yes|no]             enable building unicode-aware code
  --enable-socket[=yes|no]               enable remote socket connections (libTw)
  --enable-socket-gz[=yes|no]            enable gzip compression on sockets
  --enable-socket-pthreads[=yes|no]      enable thread safe libTw (requires pthread)
  --enable-socket-alien[=yes|no]         enable support for non-native architectures
EOF
    cat << EOF
  --enable-wm[=yes|no|mod]               enable the builtin WM (absolutely needed!)
  --enable-wm-rc[=yes|no|mod]            enable ~/.twinrc configuration parser
  --enable-wm-rc-shmmap[=yes|no]         enable mmapped shared file for parser
  --enable-wm-rc-shrink[=yes|no]         enable shrinking memory when parser finished
  --enable-term[=yes|no|mod]             enable builtin terminal emulator
  --enable-term-devpts[=yes|no]          enable glibc-2.1 /dev/pts/* pseudo-ttys
  --enable-printk[=yes|no]               enable logging messages in Messages window
  --enable-hw-tty[=yes|no|mod]           enable tty drivers
  --enable-hw-tty-linux[=yes|no]         enable the Linux console driver
  --enable-hw-tty-twterm[=yes|no]        enable the twterm terminal driver
  --enable-hw-tty-termcap[=yes|no]       enable the termcap terminal driver
  --enable-hw-x11[=yes|no|mod]           enable the X11 driver
  --enable-hw-twin[=yes|no|mod]          enable the twin native driver
  --enable-hw-display[=yes|no|mod]       enable the twdisplay client driver
  --enable-hw-ggi[=yes|no|mod]           enable the ggi driver
EOF
    exit 0 ;;
  esac
done

#
# read current configuration
#
if test -f conf/conf.current -a -f conf/conf.auto -a conf/conf.current -ot conf/conf.auto; then
  . conf/conf.auto
elif test -f conf/conf.current; then
  . conf/conf.current
elif test -f conf/conf.auto; then
  . conf/conf.auto
else
  . conf/conf.default
  echo "scripts/Configure: warning: missing conf/conf.auto: './configure' will overwrite your changes!" 1>&2
fi

ac_cf_list=
#
# set enable_* variables from current configuration
#
for ac_CONF in `cat conf/conf.list`; do
  ac_feature=enable_`echo $ac_CONF | cut -d_ -f2- | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ%abcdefghijklmnopqrstuvwxyz%' | sed 's/-/_/g'`
  ac_cf_list="$ac_cf_list $ac_feature"
  eval "$ac_feature=$`echo $ac_CONF`"
done

#
# process command line options
#
for ac_option
do
  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac
  
  case "$ac_option" in
  
  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
      echo "scripts/Configure: error: $ac_feature: invalid feature name" 1>&2
      exit 1
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    eval "enable_${ac_feature}=no" ;;

  --show | --sho | --sh )
    ac_opt_show=yes ;;
    
  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      echo "scripts/Configure: error: $ac_feature: invalid feature name" 1>&2
      exit 1
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  -help | --help | --hel | --he)
    ;;

  *)
    echo "scripts/Configure: error: $ac_option: invalid option; use --help to show usage" 1>&2;
    exit 1 ;;

  esac
done


#
# prepare conf/conf.auto
#

exec 3>conf/conf.auto

echo "#" 1>&3
echo "# This configuration was created by 'scripts/Configure [OPTIONS]'." 1>&3
echo "# Don't edit it, use one of 'make config', 'make menuconfig', " 1>&3
echo "# 'scripts/Configure [OPTIONS]' or './configure [OPTIONS]' instead." 1>&3
echo "#" 1>&3

if test "$ac_opt_show"; then
  echo "#" 1>&2
  echo "# scripts/Configure: current configuration is:" 1>&2
  echo "#" 1>&2
fi

for ac_feature in $ac_cf_list; do
  eval "ac_cf_val=$`echo $ac_feature`"
  case "$ac_cf_val" in
    y | yes ) ac_cf_val=y ; ac_cf_val_long=yes ;;
    n | no  ) ac_cf_val=n ; ac_cf_val_long=no  ;;
    m | mod ) ac_cf_val=m ; ac_cf_val_long=mod ;;
    * )
      # unset / undetectable. set to empty.
      ac_cf_val= ; ac_cf_val_long= ;;
  esac
  if test "$ac_cf_val"; then
    ac_CONF=CONF_`echo $ac_feature | cut -d_ -f2- | sed 'y%abcdefghijklmnopqrstuvwxyz%ABCDEFGHIJKLMNOPQRSTUVWXYZ%'`
    #echo $ac_feature, $ac_cf_val_long
    #echo $ac_CONF, $ac_cf_val
    echo "$ac_CONF=$ac_cf_val" 1>&3
    if test "$ac_opt_show"; then
      echo "  --`echo $ac_feature | sed 's/_/-/g'`=$ac_cf_val_long"
    fi
  fi
done

if test -z "$ac_opt_show"; then
  echo "#" 1>&2
  echo "# scripts/Configure: conf/conf.auto successfully updated." 1>&2
  echo "#" 1>&2
fi