aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-21 14:33:38 +0000
committerng0 <ng0@n0.is>2019-11-21 14:33:38 +0000
commit8ac3f324acfab33841efdba01187e19892c324f4 (patch)
tree6818c49d6d56d546b6b3a6ce739feb90e2abcc53 /contrib
parent641a5ee4f43a109a84110d90731f18b653a1e394 (diff)
downloadgnunet-8ac3f324acfab33841efdba01187e19892c324f4.tar.gz
gnunet-8ac3f324acfab33841efdba01187e19892c324f4.zip
gnunet-bugreport: fix compiling tests, add usage with -h
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/gnunet-bugreport67
1 files changed, 48 insertions, 19 deletions
diff --git a/contrib/scripts/gnunet-bugreport b/contrib/scripts/gnunet-bugreport
index 5f090a350..f6a28fded 100755
--- a/contrib/scripts/gnunet-bugreport
+++ b/contrib/scripts/gnunet-bugreport
@@ -230,7 +230,7 @@ gnunet010x_check()
230 TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null` 230 TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null`
231 if test -n "$TEST"; then 231 if test -n "$TEST"; then
232 VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'` 232 VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'`
233 VER9=`echo $VER | grep ^0\.10\.` 233 VER10=`echo $VER | grep ^0\.10\.`
234 if test -n "$VER10"; then 234 if test -n "$VER10"; then
235 warningmsg "GNUnet 0.10 : $VER" 235 warningmsg "GNUnet 0.10 : $VER"
236 else 236 else
@@ -470,8 +470,9 @@ gnurl_check()
470 470
471libmicrohttpd_check() 471libmicrohttpd_check()
472{ 472{
473 TMPFILE=`mktemp /tmp/mhd-version-testXXXXXX` 473 # TMPFILE=`mktemp /tmp/mhd-version-testXXXXXX`
474 cat - >$TMPFILE.c <<EOF 474 TMPFILE="bugreport-test_lmhd.c"
475 cat - >$TMPFILE <<EOF
475#include <microhttpd.h> 476#include <microhttpd.h>
476#include <stdio.h> 477#include <stdio.h>
477int main() 478int main()
@@ -480,17 +481,24 @@ int main()
480 return 0; 481 return 0;
481} 482}
482EOF 483EOF
483 VER="Not found" 484 if test -x `$WHICH gcc | awk '{print $NF}'`; then
484 gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` 485 gcc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin "$TMPFILE"
485 cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` 486 VER=`./"$TMPFILE".bin`
486 rm -f $TMPFILE $TMPFILE.bin 487 elif test -x `$WHICH cc | awk '{print $NF}'`; then
488 cc $CPPFLAGS $CFLAGS -o $TMPFILE.bin $TMPFILE
489 VER=`./$TMPFILE.bin`
490 else
491 VER="Not found"
492 fi
487 infomsg "libmicrohttpd : $VER" 493 infomsg "libmicrohttpd : $VER"
494 rm -f $TMPFILE.c $TMPFILE $TMPFILE.bin
488} 495}
489 496
490glpk_check() 497glpk_check()
491{ 498{
492 TMPFILE=`mktemp /tmp/glpk-version-testXXXXXX` 499 # TMPFILE=`mktemp /tmp/glpk-version-testXXXXXX`
493 cat - >$TMPFILE.c <<EOF 500 TMPFILE="bugreport-glpk_check.c"
501 cat - >$TMPFILE <<EOF
494#include <glpk.h> 502#include <glpk.h>
495#include <stdio.h> 503#include <stdio.h>
496int main() 504int main()
@@ -499,17 +507,24 @@ int main()
499 return 0; 507 return 0;
500} 508}
501EOF 509EOF
502 VER="Not found" 510 if test -x `$WHICH gcc | awk '{print $NF}'`; then
503 gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` 511 gcc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
504 cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` 512 VER=`./$TMPFILE.bin`
505 rm -f $TMPFILE $TMPFILE.bin 513 elif test -x `$WHICH cc | awk '{print $NF}'`; then
514 cc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
515 VER=`./"$TMPFILE".bin`
516 else
517 VER="Not found"
518 fi
506 infomsg "GNU GLPK : $VER" 519 infomsg "GNU GLPK : $VER"
520 rm -f $TMPFILE.c $TMPFILE $TMPFILE.bin
507} 521}
508 522
509gnutls_check() 523gnutls_check()
510{ 524{
511 TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX` 525 # TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX`
512 cat - >$TMPFILE.c <<EOF 526 TMPFILE="bugreport-gnutls_check.c"
527 cat - >$TMPFILE <<EOF
513#include <gnutls/gnutls.h> 528#include <gnutls/gnutls.h>
514#include <stdio.h> 529#include <stdio.h>
515int main() 530int main()
@@ -518,15 +533,29 @@ int main()
518 return 0; 533 return 0;
519} 534}
520EOF 535EOF
521 VER="Not found" 536 if test -x `$WHICH gcc | awk '{print $NF}'`; then
522 gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` 537 gcc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
523 cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` 538 VER=`./"$TMPFILE".bin`
524 rm -f $TMPFILE $TMPFILE.bin 539 elif test -x `$WHICH cc | awk '{print $NF}'`; then
540 cc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
541 VER=`./"$TMPFILE".bin`
542 else
543 VER="Not found"
544 fi
525 infomsg "GnuTLS : $VER" 545 infomsg "GnuTLS : $VER"
546 rm -f $TMPFILE.c $TMPFILE $TMPFILE.bin
526} 547}
527 548
528main() 549main()
529{ 550{
551 if test -n "$1" -a "$1" = "-h"; then
552 echo "Usage: ${progname} [-h]"
553 echo "If CPPFLAGS and LDFLAGS are unset, try:"
554 echo "CPPFLAGS='-I/usr/pkg/include' LDFLAGS='-L/usr/pkg/lib' ${progname}"
555 return 0
556 fi
557 echo $LDFLAGS
558 echo $CPPFLAGS
530 infomsg "${progname} 0.11.0" 559 infomsg "${progname} 0.11.0"
531 infomsg 560 infomsg
532 infomsg "Please submit the following" 561 infomsg "Please submit the following"