Changeset 420 for trunk/configure


Ignore:
Timestamp:
Jun 20, 2006, 11:29:11 PM (17 years ago)
Author:
joshe
Message:

Add a --verbose option to configure to aid debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure

    r265 r420  
    1818CXXFLAGS="${CXXFLAGS}"
    1919LDFLAGS="${LDFLAGS}"
     20VERBOSE=no
    2021
    2122#
     
    3031  --disable-gtk          Don't build the GTK+ GUI
    3132  --prefix=PATH          Installation path
     33  --verbose              Display additional information for debugging
    3234
    3335Some influential environment variables:
     
    4143}
    4244
     45runcmd()
     46{
     47  if [ "$VERBOSE" = yes ]
     48  then
     49    echo "$@" >&2
     50    "$@"
     51  else
     52    "$@" > /dev/null 2>&1
     53  fi
     54  return $!
     55}
     56
     57verbose()
     58{
     59  if [ "$VERBOSE" = yes ]
     60  then
     61    echo "$@"
     62  fi
     63}
     64
    4365cc_test()
    4466{
     67  verbose cc_test
    4568  cat > testconf.c <<EOF
    4669  int main()
     
    4972  }
    5073EOF
    51   if ! $CC -o testconf testconf.c > /dev/null 2>&1; then
     74  if ! runcmd $CC -o testconf testconf.c
     75  then
    5276    rm -f testconf.c testconf
    5377    echo "Could not find a working compiler"
     
    5983openssl_test()
    6084{
     85  verbose openssl_test
    6186  cat > testconf.c << EOF
    6287  #include <stdio.h>
     
    6792  }
    6893EOF
    69   if $CC $CFLAGS $LDFLAGS -o testconf testconf.c -lcrypto > /dev/null 2>&1
     94  if runcmd $CC $CFLAGS $LDFLAGS -o testconf testconf.c -lcrypto
    7095  then
    7196    echo "yes"
     
    80105lm_test()
    81106{
     107  verbose lm_test
    82108  cat > testconf.c << EOF
    83109  int main()
     
    86112  }
    87113EOF
    88   if ! $CC -o testconf testconf.c > /dev/null 2>&1
    89   then
    90     if $CC -o testconf testconf.c -lm > /dev/null 2>&1
     114  if ! runcmd $CC -o testconf testconf.c
     115  then
     116    if runcmd $CC -o testconf testconf.c -lm
    91117    then
    92118      LDFLAGS="$LDFLAGS -lm"
     
    98124lrintf_test()
    99125{
     126  verbose lrintf_test
    100127  cat > testconf.c << EOF
    101128  int main()
     
    104131  }
    105132EOF
    106   if ( $CC -o testconf testconf.c $LDFLAGS && ./testconf ) > /dev/null 2>&1
     133  if runcmd $CC -o testconf testconf.c $LDFLAGS && runcmd ./testconf
    107134  then
    108135    CFLAGS="$CFLAGS -DHAVE_LRINTF"
     
    113140gettext_test()
    114141{
     142  verbose gettext_test
    115143  cat > testconf.c <<EOF
    116144  #include <libintl.h>
     
    121149EOF
    122150
    123   if $CC $CFLAGS_GTK $LDFLAGS_GTK -o testconf testconf.c > /dev/null 2>&1
     151  if runcmd $CC $CFLAGS_GTK $LDFLAGS_GTK -o testconf testconf.c
    124152  then
    125153    rm -f testconf.c testconf
     
    130158      /usr/local/include /usr/X11R6/include /usr/pkg/include
    131159  do
    132     if $CC $CFLAGS_GTK -I$intl_testdir $LDFLAGS_GTK -o testconf testconf.c > /dev/null 2>&1
     160    if runcmd $CC $CFLAGS_GTK -I$intl_testdir $LDFLAGS_GTK -o testconf testconf.c
    133161    then
    134162      CFLAGS_GTK="CFLAGS_GTK -I$intl_testdir"
     
    143171gtk_test()
    144172{
    145   if pkg-config gtk+-2.0 > /dev/null 2>&1
    146   then
    147     if expr `pkg-config --modversion gtk+-2.0` '>=' 2.6.0 > /dev/null 2>&1
     173  verbose gtk_test
     174  if runcmd pkg-config gtk+-2.0
     175  then
     176    if runcmd expr `pkg-config --modversion gtk+-2.0` '>=' 2.6.0
    148177    then
    149178      cat > testconf.c << EOF
     
    154183      }
    155184EOF
    156       if $CC `pkg-config gtk+-2.0 --cflags --libs` -o testconf testconf.c > /dev/null 2>&1
     185      if runcmd $CC `pkg-config gtk+-2.0 --cflags --libs` -o testconf testconf.c
    157186      then
    158187        CFLAGS_GTK=`pkg-config gtk+-2.0 --cflags`
     
    199228      PREFIX="$param"
    200229      ;;
     230    x--verbose)
     231      VERBOSE=yes
     232      ;;
    201233    x--help)
    202234      usage
Note: See TracChangeset for help on using the changeset viewer.