Browse code

enable logging in configure by default, and print some advice on failure

Originally committed as revision 5509 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2006/06/23 03:57:40
Showing 1 changed files
... ...
@@ -9,7 +9,7 @@ show_help(){
9 9
   echo
10 10
   echo "Standard options:"
11 11
   echo "  --help                   print this message"
12
-  echo "  --log                    log tests and output to config.err"
12
+  echo "  --log[=FILE|yes|no]      log tests and output to FILE [config.err]"
13 13
   echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
14 14
   echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
15 15
   echo "  --incdir=DIR             install includes in DIR [PREFIX/include/ffmpeg]"
... ...
@@ -107,9 +107,29 @@ logfile(){
107 107
     log END $1
108 108
 }
109 109
 
110
-die(){
110
+echolog(){
111 111
     log "$@"
112 112
     echo "$@"
113
+}
114
+
115
+die(){
116
+    echolog "$@"
117
+    cat <<EOF
118
+If you think configure made a mistake, make sure you are using the latest
119
+version from SVN.  If the latest version fails, report the problem to the
120
+ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
121
+EOF
122
+    if enabled log; then
123
+        cat <<EOF
124
+Include the log file "$logfile" produced by configure as this will help
125
+solving the problem.
126
+EOF
127
+    else
128
+cat <<EOF
129
+Rerun configure with logging enabled (do not use --log=no), and include the
130
+log this produces with your report.
131
+EOF
132
+    fi
113 133
     rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
114 134
     exit 1
115 135
 }
... ...
@@ -278,8 +298,8 @@ TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
278 278
 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
279 279
 
280 280
 # default parameters
281
-log="no"
282
-logfile="/dev/null"
281
+log="yes"
282
+logfile="config.err"
283 283
 prefix="/usr/local"
284 284
 libdir=""
285 285
 incdir=""
... ...
@@ -631,7 +651,9 @@ CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c
631 631
 
632 632
 for opt do
633 633
   case "$opt" in
634
-  --log) log=yes
634
+  --log)
635
+  ;;
636
+  --log=*) log="${opt#*-}"
635 637
   ;;
636 638
   --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
637 639
   ;;
... ...
@@ -797,10 +819,12 @@ for opt do
797 797
   esac
798 798
 done
799 799
 
800
-if enabled log; then
801
-    logfile=config.err
800
+if test "$log" != no; then
801
+    test "$log" = yes || logfile="$log"
802 802
     echo "# $0 $@" >$logfile
803 803
     set >>$logfile
804
+else
805
+    logfile=/dev/null
804 806
 fi
805 807
 
806 808
 # Combine FFLDFLAGS and the LDFLAGS environment variable