File: configure

package info (click to toggle)
ssh-askpass 1%3A1.2.4.1-6.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 280 kB
  • ctags: 891
  • sloc: ansic: 1,789; makefile: 913; sh: 266
file content (290 lines) | stat: -rwxr-xr-x 7,636 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
#
# configure: Automatically configure install locations for x11-ssh-askpass
#
# by Jim Knoble <jmknoble@pobox.com>
# Copyright (C) 2001 Jim Knoble
# 
# Disclaimer:
# 
# This software is provided "as is", without warranty of any kind,
# express or implied, including but not limited to the warranties of
# merchantability, fitness for a particular purpose and
# noninfringement. In no event shall the author(s) be liable for any
# claim, damages or other liability, whether in an action of
# contract, tort or otherwise, arising from, out of or in connection
# with the software or the use or other dealings in the software.
# 
# Permission to use, copy, modify, distribute, and sell this software
# and its documentation for any purpose is hereby granted without
# fee, provided that the above copyright notice appear in all copies
# and that both that copyright notice and this permission notice
# appear in supporting documentation.

PrintHelp() {
  cat <<EOF

Usage: $0 [options]

Options:
  --prefix=PREFIX           install architecture-independent files in PREFIX
                            [${default_prefix}]
  --exec-prefix=EPREFIX     install architecture-dependent files in EPREFIX
                            [same as prefix]
  --libexecdir=DIR          program executables in DIR [EPREFIX/libexec]
  --mandir=DIR              man documentation in DIR [PREFIX/man]
  
  --bindir=DIR              ignored
  --sbindir=DIR             ignored
  --datadir=DIR             ignored
  --sysconfdir=DIR          ignored
  --sharedstatedir=DIR      ignored
  --localstatedir=DIR       ignored
  --libdir=DIR              ignored
  --includedir=DIR          ignored
  --infodir=DIR             ignored

  --with-app-defaults=FILE          Use application defaults from FILE
                                    [${default_app_defaults}]
  --with-app-defaults-dir=DIR       Install application defaults file into DIR
                                    [wherever imake prefers]
  --disable-installing-app-defaults Do not install the application defaults
                                    file (overrides --with-app-defaults-dir)
				    [enabled]

EOF
  exit 1
}

GetOptionArg() {
  opt="$1"
  if [ -z "${opt}" ]; then
    return
  fi
  varname=`echo "${opt}" |sed -e 's/^--//' -e 's/=.*$//' -e 'y/-/_/'`
  case "${opt}" in
    *=*)
      arg=`echo "${opt}" |sed -e 's/^[^=]*=//'`
      eval "${varname}=\"${arg}\""
    ;;
  esac
}

GetWithOption() {
  opt="$1"
  if [ -z "${opt}" ]; then
    return
  fi
  varname=`echo "${opt}" |sed -e 's/^--with-//' -e 's/=.*$//' -e 'y/-/_/'`
  case "${opt}" in
    --with-*=*)
      arg=`echo "${opt}" |sed -e 's/^[^=]*=//'`
      eval "${varname}=\"${arg}\""
    ;;
  esac
}

GetEnableOption() {
  opt="$1"
  if [ -z "${opt}" ]; then
    return
  fi
  varname=`echo "${opt}" |sed -e 's/^--dis/en/' -e 's/^--//' -e 's/=.*$//' \
    -e 'y/-/_/'`
  case "${opt}" in
    --enable-*=*)
      arg=`echo "${opt}" |sed -e 's/^[^=]*=//'`
    ;;
    --enable-*)
      arg=yes
    ;;
    --disable-*)
      arg=no
    ;;
    *)
      return
    ;;
  esac
  case "${arg}" in
    1|[yY]|[tT]|[oO][nN]|[yY][eE][sS]|[tT][rR][uU][eE]|[eE][nN][aA][bB][lL][eE][dD])
      eval "${varname}=yes"
    ;;
    0|[nN]|[fF]|[oO][fF][fF]|[nN][oO]|[fF][aA][lL][sS][eE]|[dD][iI][sS][aA][bB][lL][eE][dD])
      eval "${varname}=no"
    ;;
    *)
      echo "$0: error: I don't understand '${arg}' (from '${opt}')."
      exit 1
    ;;
  esac
}

UseDefaults () {
  unset CC
  unset CFLAGS
  unset LDFLAGS

  prefix=''
  exec_prefix=''
  libexecdir=''
  mandir=''
  app_defaults=''
  app_defaults_dir=''
  enable_installing_app_defaults=''
}

IMAKEFILE_SRC="Imakefile.in"
IMAKEFILE_DST="Imakefile"

default_default_app_defaults_dir='$(XAPPLOADDIR)'

default_prefix='/usr/local'

if [ -f ../configure ]; then
  eval `cat ../configure |awk '/^[ 	]*ac_default_prefix=/ { print $0 }'`
fi
if [ -n "${ac_default_prefix}" ]; then
  default_prefix="${ac_default_prefix}"
fi

default_exec_prefix='${prefix}'
default_libexecdir='${exec_prefix}/libexec'
default_mandir='${prefix}/man'
default_app_defaults='SshAskpass-default.ad'
default_app_defaults_dir='${default_default_app_defaults_dir}'
default_enable_installing_app_defaults='yes'

prefix=''
exec_prefix=''
libexecdir=''
mandir=''
app_defaults=''
app_defaults_dir=''
enable_installing_app_defaults=''

while [ $# -gt 0 ]; do
  case "$1" in
    -h|--help|-help|-\?)
      PrintHelp
    ;;
    -d|--default|--defaults|--use-defaults)
      UseDefaults
      break
    ;;
    --prefix=*|--exec-prefix=*|--libexecdir=*|--mandir=*)
      GetOptionArg "$1"
      shift
    ;;
    --with-app-defaults=*|--with-app-defaults-dir=*)
      GetWithOption "$1"
      shift
    ;;
    --enable-installing-app-defaults|--enable-installing-app-defaults=*|--disable-installing-app-defaults)
      GetEnableOption "$1"
      shift
    ;;
    -*)
      shift
    ;;
    *)
      break
    ;;
  esac
done

for i in \
  prefix \
  exec_prefix \
  libexecdir \
  mandir \
  app_defaults \
  app_defaults_dir \
  enable_installing_app_defaults \
; do
  if eval [ -z \"\${"${i}"}\" ]; then
    eval ${i}=\"\`eval echo \${default_"${i}"}\`\"
  fi
done

if [ ! -f "${IMAKEFILE_SRC}" ]; then
  echo "$0: error: I can't seem to find ${IMAKEFILE_SRC}."
  echo "$0: Are you sure you're running me from the x11-ssh-askpass source directory?"
  exit 1
fi

cat "${IMAKEFILE_SRC}" |sed \
  -e 's#^\([ 	]*BINDIR[ 	]*=\).*$#\1 '"${libexecdir}"'#' \
  -e 's#^\([ 	]*MANPATH[ 	]*=\).*$#\1 '"${mandir}"'#' \
  -e 's#^\([ 	]*APPDEFDIR[ 	]*=\).*$#\1 '"${app_defaults_dir}"'#' \
  -e 's#^\([ 	]*APP_DEFAULTS[ 	]*=\).*#\1 '"${app_defaults}"'#' \
  >"${IMAKEFILE_DST}.tmp" \
&& mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"

case "${enable_installing_app_defaults}" in
  yes)
    cat "${IMAKEFILE_DST}" |sed \
      -e 's#^[ ]*\(XCOMM[ 	]\+\)\?\(install::[ 	]\+install-app-defaults.*\)$#\2#' \
      >"${IMAKEFILE_DST}.tmp" \
    && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
  ;;
  no)
    cat "${IMAKEFILE_DST}" |sed \
      -e 's#^[ ]*\(XCOMM[ 	]\+\)\?\(install::[ 	]\+install-app-defaults.*\)$#XCOMM \2#' \
      >"${IMAKEFILE_DST}.tmp" \
    && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
  ;;
esac

if [ -n "${CC}" ]; then
  cat "${IMAKEFILE_DST}" |sed \
    -e 's#^[ 	]*XCOMM[ 	]\+\(CC[ 	]*=\).*$#\1 '"${CC}"'#' \
    >"${IMAKEFILE_DST}.tmp" \
  && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
else
  CC='default'
fi

if [ -n "${CFLAGS}" ]; then
  cat "${IMAKEFILE_DST}" |sed \
    -e 's#^[ 	]*XCOMM[ 	]\+\(CDEBUGFLAGS[ 	]*=\).*$#\1 '"${CFLAGS}"'#' \
    >"${IMAKEFILE_DST}.tmp" \
  && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
else
  CFLAGS='default'
fi

if [ -n "${LDFLAGS}" ]; then
  cat "${IMAKEFILE_DST}" |sed \
    -e 's#^[ 	]*XCOMM[ 	]\+\(LOCAL_LDFLAGS[ 	]*=\).*$#\1 '"${LDFLAGS}"'#' \
    >"${IMAKEFILE_DST}.tmp" \
  && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
else
  LDFLAGS='default'
fi

if [ "${app_defaults_dir}" = "${default_default_app_defaults_dir}" ]; then
  app_defaults_dir='default'
fi

cat <<EOF

x11-ssh-askpass has been configured with the following options:

                  Askpass directory: ${libexecdir}
                        Manual page: ${mandir}/man1
          Application defaults file: ${app_defaults}
     Application defaults directory: ${app_defaults_dir}
  Install application defaults file: ${enable_installing_app_defaults}

        Compiler: ${CC}
  Compiler flags: ${CFLAGS}
    Linker flags: ${LDFLAGS}

You may now create the Makefile and build x11-ssh-askpass using the
following commands:

        xmkmf
	make includes
	make

EOF