3 # Copyright 2005 Timo Hirvonen
5 # This file is licensed under the GPLv2.
16 echo "Exporting CDPATH is dangerous and unnecessary!"
23 if test "$DEBUG_CONFIGURE" = y
26 echo "DEBUG_CONFIGURE=y, not removing temporary files"
35 # can't use "die" because stderr is often redirected to /dev/null
36 # (stdout could also be redirected but it's not so common)
39 echo "Aborting. configure failed."
40 # this executes __cleanup automatically
44 # clean temporary files on exit
47 # clean temporary files and die with error message if interrupted
48 trap '__abort' 1 2 3 13 15
52 # config.mk variable names
55 # cross compilation, prefix for CC, LD etc.
58 # argc function_name $# min [max]
61 if test $# -lt 3 ||
test $# -gt 4
63 die
"argc: expecting 3-4 arguments (got $*)"
70 die
"$1: expecting at least $3 arguments"
73 if test $2 -lt $3 ||
test $2 -gt $4
75 die
"$1: expecting $3-$4 arguments"
80 # print warning message (all parameters)
86 # print error message (all parameters) and exit
93 # usage: 'tmp_file .c'
94 # get filename for temporary file
97 if test -z "$__tmp_file_counter"
104 __tmp_filename
=.tmp-
${__tmp_file_counter}-${1}
105 __tmp_file_counter
=`expr $__tmp_file_counter + 1`
106 test -f "$__tmp_filename" ||
break
108 echo "$__tmp_filename"
113 # @name: name of the variable
116 eval echo '"$'${1}'"'
119 # set variable by name
121 # @name: name of the variable
122 # @value: value of the variable
128 # set variable @name to @default IF NOT SET OR EMPTY
130 # @name: name of the variable
131 # @value: value of the variable
134 test "`get_var $1`" || set_var
$1 "$2"
137 # usage: echo $foo | to_upper
140 # stupid solaris tr doesn't understand ranges
141 tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
144 # portable which command
162 if test -x "$__pf_i/$1"
176 Usage ./configure [-f FILE] [OPTION=VALUE]...
178 -f FILE Read OPTION=VALUE list from FILE (sh script)
184 # @tmpfile: temporary file
185 # @file: file to update
187 # replace @file with @tmpfile if their contents differ
192 if cmp "$2" "$1" 2>/dev
/null
1>&2