2 # source: gatherinfo.sh
3 # Copyright Gerhard Rieger 2001, 2002
4 # Published under the GNU General Public License V.2, see file COPYING
8 # use this script after successful porting
9 # provide the platform name as argument with no dots, e.g. HPUX-11-0
10 # it generates the files:
11 # Config/Makefile.PLATFORM
12 # Config/config.PLATFORM.h
13 # Config/socat.PLATFORM.out
15 # Config/config.PLATFORM.log
16 # Config/compile.PLATFORM.log
17 # Config/test.PLATFORM.log
26 # how to echo special characters?
27 if [ `echo "x\c"` = "x" ]; then E
=""
28 elif [ `echo -e "x\c"` = "x" ]; then E
="-e"
33 -v) VERBOSE
=1; shift;; # tell about progress
34 -d) LOGGING
=1; shift;; # show complete output
35 -i) INTERACTIVE
=1; shift;; # diff and ask before overriding old files
36 -*) CONFOPTS
="$CONFOPTS $1"; shift;;
37 *) PLATFORM
="$1"; break;;
41 #if [ -z "$PLATFORM" ]; then
42 # echo "please specify a configuration name, e.g. `uname -s`-`uname -r|tr '.' '-'`!" >&2; exit 1;
46 echo $E "usage: $0 [-v] [-i] [configure options ...] platform" >&2
47 echo $E "\t-v\t\tverbose (print actual command)" >&2
48 echo $E "\t-d\t\tdump command outputs" >&2
49 echo $E "\t-i\t\tinteractive (ask before overwriting something)" >&2
50 echo $E "\tconfigure options\toptions for configure script, e.g. --disable-ip6" >&2
51 echo $E "\tplatform\tdescribe your OS, e.g. `uname -s`-`uname -r|tr '.' '-'`" >&2
56 *.
*) echo "platform name must not contain '.'" >&2; exit 1;;
62 if [ -f Makefile
]; then
63 COMMAND
="make distclean"
64 [ "$VERBOSE" ] && echo "$COMMAND"
65 $COMMAND >/dev
/null
2>&1 ||
echo "*** failed: $COMMAND" 1>&2
68 # implicitly generates Makefile, config.h, config.log
69 COMMAND
="./configure $CONFOPTS"
71 [ "$VERBOSE" ] && echo "$COMMAND"
72 if [ "$LOGGING" ]; then
73 { $COMMAND; echo "$?" >socat.rc
; } 2>&1 |
tee $LOGFILE;
74 if [ `cat socat.rc` -ne 0 ]; then echo "*** failed: $COMMAND" 1>&2; exit 1; fi
76 $COMMAND >$LOGFILE 2>&1 ||
{ echo "*** failed: $COMMAND" 1>&2; exit 1; }
81 [ "$VERBOSE" ] && echo "$COMMAND"
82 if [ "$LOGGING" ]; then
83 { $COMMAND; echo "$?" >socat.rc
; } 2>&1 |
tee -a $LOGFILE;
84 if [ `cat socat.rc` -ne 0 ]; then echo "*** failed: $COMMAND" 1>&2; exit 1; fi
86 $COMMAND >>$LOGFILE 2>&1 ||
{ echo "*** failed: $COMMAND" 1>&2; exit 1; }
91 [ "$VERBOSE" ] && echo "$COMMAND"
92 $COMMAND >/dev
/null ||
echo "*** failed: $COMMAND" 1>&2
96 [ "$VERBOSE" ] && echo "$COMMAND"
97 if [ "$LOGGING" ]; then
98 { $COMMAND; echo "$?" >socat.rc
; } 2>&1 |
tee $LOGFILE;
99 if [ `cat socat.rc` -ne 0 ]; then
100 echo "*** failed: $COMMAND" 1>&2
101 if [ `cat socat.rc` -ge 128 ]; then
106 $COMMAND >$LOGFILE 2>&1 ||
echo "*** failed: $COMMAND" 1>&2
111 b
=Makefile
; e
=; f
=$b; p
=Config
/$b.
$PLATFORM
112 if [ "$INTERACTIVE" -a -f $p ]; then
113 if ! diff $p $f; then
121 b
=config
; e
=h
; f
=$b.
$e; p
=Config
/$b.
$PLATFORM.
$e
122 if [ "$INTERACTIVE" -a -f $p ]; then
123 if ! diff $p $f; then
131 b
=socat
; e
=out
; f
=$b.
$e; p
=Config
/$b.
$PLATFORM.
$e
132 if [ "$INTERACTIVE" -a -f $p ]; then
133 if ! diff $p $f; then
141 b
=config
; e
=log
; f
=$b.
$e; p
=Config
/$b.
$PLATFORM.
$e
142 if [ "$INTERACTIVE" -a -f $p ]; then
143 if ! diff $p $f; then
151 b
=compile
; e
=log
; f
=$b.
$e; p
=Config
/$b.
$PLATFORM.
$e
152 if [ "$INTERACTIVE" -a -f $p ]; then
153 if ! diff $p $f; then
161 b
=test; e
=log
; f
=$b.
$e; p
=Config
/$b.
$PLATFORM.
$e
162 if [ "$INTERACTIVE" -a -f $p ]; then
163 if ! diff $p $f; then