17 statusmsg "WARNING: $@"
27 statusmsg "========================================="
30 # It is okay to assume which(1) here because we provide
31 # more than 1 fallback.
32 TEST=`type type|grep not`
33 if test -n "$TEST"; then
41 OS=`uname -s 2>/dev/null`
43 REL=`uname -r 2>/dev/null`
44 infomsg "OS RELEASE : $REL"
45 HW=`uname -m 2>/dev/null`
46 infomsg "HARDWARE : $HW"
49 # We shouldn't use awk to test for awk... but if
50 # awk isn't there it can't be found.
53 if test -n "`awk 2>&1 | tail -1 | awk '{print $1}'`"; then
56 warningmsg "awk : Not found!"
62 TEST=`$WHICH gcc | grep -v "not found" 2>/dev/null`
63 if test -n "$TEST"; then
64 VERS=`gcc --version 2>/dev/null | head -n 1`
66 elif test -n "`gcc 2>&1 | tail -1 | awk '{print $1}'`"; then
67 VERS=`gcc --version 2>/dev/null | head -n 1`
70 warningmsg "gcc : Not Found";
76 TEST=`$WHICH cc | grep -v "not found" 2>/dev/null`
77 if test -n "$TEST"; then
78 VERS=`cc --version 2>/dev/null | head -n 1`
81 warningmsg "cc : Not Found";
87 TEST=`$WHICH c++ | grep -v "not found" 2>/dev/null`
88 if test -n "$TEST"; then
89 VERS=`c++ --version 2>/dev/null | head -n 1`
92 warningmsg "c++ : Not Found";
98 TEST=`$WHICH clang | grep -v "not found" 2>/dev/null`
99 if test -n "$TEST"; then
100 VERS=`clang --version 2>/dev/null | head -n 1`
101 infomsg "clang : $VERS"
102 elif test -n "`clang 2>&1 | tail -1 | awk '{print $1}'`"; then
103 VERS=`clang --version 2>/dev/null | head -n 1`
104 infomsg "clang : $VERS"
106 warningmsg "clang : Not Found";
110 clangplusplus_check()
112 TEST=`$WHICH clang++ | grep -v "not found" 2>/dev/null`
113 if test -n "$TEST"; then
114 VERS=`clang++ --version 2>/dev/null | head -n 1`
115 infomsg "clang++ : $VERS"
116 elif test -n "`clang++ 2>&1 | tail -1 | awk '{print $1}'`"; then
117 VERS=`clang++ --version 2>/dev/null | head -n 1`
118 infomsg "clang++ : $VERS"
120 warningmsg "clang++ : Not Found";
126 TEST=`$WHICH gmake | grep -v "not found" 2>/dev/null`
127 if test -n "$TEST" ; then
128 VER=$(gmake --version 2>/dev/null | awk '/GNU Make/ {print $3}')
129 infomsg "gmake : $VER"
131 TEST=`make --version 2>/dev/null`
132 if test -n "$TEST"; then
133 VER=$(make --version 2>/dev/null | awk '/GNU Make/ {print $3}')
134 infomsg "gmake : $VER"
136 warningmsg "gmake : Not Found"
141 # Applies for NetBSD make and possibly every make.
144 if test -n "`make 2>/dev/null`"; then
145 infomsg "make : Found"
147 warningmsg "make : Not Found"
153 TEST=`$WHICH autoconf | grep -v "not found" 2>/dev/null`
154 if test -n "$TEST"; then
155 autoconf --version |\
158 if (length($4) == 0) {\
159 print " INFO: autoconf : "$3\
161 print " INFO: autoconf : "$4\
164 warningmsg "autoconf : Not Found"
170 TEST=`$WHICH automake | grep -v "not found" 2>/dev/null`
171 if test -n "$TEST"; then
172 VER=`automake --version 2>/dev/null | head -n 1 | awk '{print $4}'`
173 infomsg "automake : $VER"
175 warningmsg "automake : Not Found"
179 # TODO: More libtool variants.
182 TEST=`$WHICH libtoolize | grep -v "not found" 2>/dev/null`
183 if test -n "$TEST"; then
184 VER=`libtoolize --version 2>/dev/null | head -n 1 | awk '{print $4}'`
185 infomsg "libtool : $VER"
187 warningmsg "libtool : Not Found"
193 TEST=`$WHICH extract | grep -v "not found" 2>/dev/null`
194 if test -n "$TEST"; then
195 VER=`extract -v 2>/dev/null | head -n 1 | awk '{print $2}'`
196 infomsg "libextractor : $VER"
198 warningmsg "libextractor : Not Found"
204 if test -x gnunetd; then
205 VER=`gnunetd -v | sed -e "s/v//" 2>/dev/null`
206 warningmsg "GNUnet 0.8 : $VER (may conflict!)"
208 infomsg "GNUnet 0.8 : Not Found (good)"
214 TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null`
215 if test -n "$TEST"; then
216 VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'`
217 VER9=`echo $VER | grep ^0\.9\.`
218 if test -n "$VER9"; then
219 warningmsg "GNUnet 0.9 : $VER"
221 infomsg "GNUnet 0.9 : Not Found (good)"
224 infomsg "GNUnet 0.9 : Not Found (good)"
230 TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null`
231 if test -n "$TEST"; then
232 VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'`
233 VER10=`echo $VER | grep ^0\.10\.`
234 if test -n "$VER10"; then
235 warningmsg "GNUnet 0.10 : $VER"
237 infomsg "GNUnet 0.10 : Not Found (good)"
240 infomsg "GNUnet 0.10 : Not Found (good)"
246 TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null`
247 if test -n "$TEST"; then
248 VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'`
249 infomsg "GNUnet 0.11 : $VER"
251 warningmsg "GNUnet 0.11.x : Not Found"
257 TEST=$(git | grep -v "not found" 2> /dev/null)
258 if test -n "$TEST"; then
259 VER=$(git rev-parse HEAD)
260 infomsg "git commit : $VER"
262 warningmsg "git commit : Not a git checkout"
268 TEST=`$WHICH libgcrypt-config | grep -v "not found" 2> /dev/null`
269 if test -n "$TEST"; then
270 VER=`libgcrypt-config --version 2> /dev/null`
271 infomsg "libgcrypt : $VER"
273 warningmsg "libgcrypt : Not Found"
279 TEST=`$WHICH mysql_config | grep -v "not found" 2> /dev/null`
280 if test -n "$TEST"; then
281 VER=`mysql_config --version 2> /dev/null`
282 infomsg "mysql : $VER"
284 infomsg "mysql : Not Found"
290 TEST=`$WHICH pkgconf | grep -v "not found" 2> /dev/null`
291 if test -n "$TEST"; then
292 pkgconf --version 2> /dev/null | awk '{print " INFO: pkgconf : "$1}'
294 infomsg "pkgconf : Not Found"
300 TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
301 if test -n "$TEST"; then
302 VER=`pkg-config --version 2> /dev/null | awk '{print $1}'`
303 infomsg "pkg-config : $VER"
305 infomsg "pkg-config : Not Found"
311 TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
312 if test -n "$TEST"; then
313 VER=`pkg-config --modversion glib-2.0 2> /dev/null | awk '{print $1}'`
314 infomsg "glib2 : $VER"
316 infomsg "glib2 : Not Found"
322 TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
323 if test -n "$TEST"; then
324 VER=`pkg-config --modversion gtk+-2.0 2> /dev/null | awk '{print $1}'`
325 if test -n "$VER"; then
326 infomsg "gtk2+ : $VER"
328 infomsg "gtk2+ : Not found"
331 infomsg "gtk2+ : Not Found"
337 TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
338 if test -n "$TEST"; then
339 VER=`pkg-config --modversion gtk+-3.0 2> /dev/null | awk '{print $1}'`
340 if test -n "$VER"; then
341 infomsg "gtk3+ : $VER"
343 infomsg "gtk3+ : Not found"
346 infomsg "gtk3+ : Not Found"
352 TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null`
353 if test -n "$TEST"; then
354 VER=`pkg-config --modversion gtk+-4.0 2> /dev/null | awk '{print $1}'`
355 if test -n "$VER"; then
356 infomsg "gtk4+ : $VER"
358 infomsg "gtk4+ : Not found"
361 infomsg "gtk4+ : Not Found"
367 TEST=`$WHICH dpkg | grep -v "not found" 2> /dev/null`
368 if test -n "$TEST"; then
369 LINES=`dpkg -s libgmp-dev | grep Version | wc -l 2> /dev/null`
370 if test "$LINES" = "1"
372 VERSION=`dpkg -s libgmp-dev | grep Version | awk '{print $2}'`
373 infomsg "GMP : libgmp-dev-$VERSION.deb"
375 errormsg "GMP : dpkg: libgmp-dev not installed"
378 TEST=`$WHICH rpm | grep -v "not found" 2> /dev/null`
379 if test -n "$TEST"; then
380 rpm -q gmp | sed -e "s/gmp-//" 2> /dev/null | \
381 infomsg "GMP : $1.rpm"
383 infomsg "GMP : Test not available"
385 TEST=$($WHICH pkg_info | grep -v "not found" 2> /dev/null)
386 if test -n "$TEST"; then
387 VER=$(pkg_info -e gmp)
390 infomsg "GMP : Test not available"
397 TEST=`$WHICH dpkg | grep -v "not found" 2> /dev/null`
398 if test -n "$TEST"; then
399 LINES=`dpkg -s libunistring-dev | grep Version | wc -l`
400 if test "$LINES" = "1"
402 VERSION=`dpkg -s libunistring-dev | grep Version | awk '{print $2}'`
403 infomsg "libunistring : libunistring3-dev-$VERSION.deb"
405 errormsg "libunistring : dpkg: libunistring3-dev not installed"
408 TEST=`$WHICH rpm | grep -v "not found" 2> /dev/null`
409 if test -n "$TEST"; then
410 rpm -q unistring | sed -e "s/unistring-//" 2> /dev/null | \
411 awk '{print "libunistring : "$1.rpm}'
413 infomsg "libunistring : Test not available"
415 TEST=$($WHICH pkg_info | grep -v "not found" 2> /dev/null)
416 if test -n "$TEST"; then
417 VER=$(pkg_info -e libunistring)
418 infomsg "libunistring : $VER"
420 infomsg "libunistring : Test not available"
427 TEST=`$WHICH gettext | grep -v "not found" 2> /dev/null`
428 if test -n "$TEST"; then
429 if test -n "$(gettext --version 2>&1 | awk '/unknown option/')"; then
430 infomsg "GNU gettext : Not found"
432 VER=`gettext --version | awk '/GNU gettext/ {print $4}'`
433 infomsg "GNU gettext : $VER"
440 if test -n "`$WHICH getext 2>/dev/null`"; then
441 infomsg "gettext : Found"
443 infomsg "gettext : Not Found"
447 # Merge curl_check + gnurl_check -> error if neither is
448 # found (yes those systems exist)
451 TEST=`$WHICH curl-config | grep -v "not found" 2> /dev/null`
452 if test -n "$TEST"; then
453 VER=`curl-config --version | head -n1 2> /dev/null | awk '{print $2}'`
454 infomsg "libcurl : $VER"
456 infomsg "libcurl : Not found"
462 TEST=`$WHICH gnurl-config | grep -v "not found" 2> /dev/null`
463 if test -n "$TEST"; then
464 VER=`gnurl-config --version | head -n1 2> /dev/null | awk '{print $2}'`
465 infomsg "libgnurl : $VER"
467 infomsg "libgnurl : Not found"
471 libmicrohttpd_check()
473 # TMPFILE=`mktemp /tmp/mhd-version-testXXXXXX`
474 TMPFILE="bugreport-test_lmhd.c"
475 cat - >$TMPFILE <<EOF
476 #include <microhttpd.h>
480 fprintf (stdout, "%X\n", MHD_VERSION);
484 if test -x `$WHICH gcc | awk '{print $NF}'`; then
485 gcc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin "$TMPFILE"
486 VER=`./"$TMPFILE".bin`
487 elif test -x `$WHICH cc | awk '{print $NF}'`; then
488 cc $CPPFLAGS $CFLAGS -o $TMPFILE.bin $TMPFILE
493 infomsg "libmicrohttpd : $VER"
494 rm -f $TMPFILE.c $TMPFILE $TMPFILE.bin
499 # TMPFILE=`mktemp /tmp/glpk-version-testXXXXXX`
500 TMPFILE="bugreport-glpk_check.c"
501 cat - >$TMPFILE <<EOF
506 fprintf (stdout, "%u.%u\n", GLP_MAJOR_VERSION, GLP_MINOR_VERSION);
510 if test -x `$WHICH gcc | awk '{print $NF}'`; then
511 gcc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
513 elif test -x `$WHICH cc | awk '{print $NF}'`; then
514 cc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
515 VER=`./"$TMPFILE".bin`
519 infomsg "GNU GLPK : $VER"
520 rm -f $TMPFILE.c $TMPFILE $TMPFILE.bin
525 # TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX`
526 TMPFILE="bugreport-gnutls_check.c"
527 cat - >$TMPFILE <<EOF
528 #include <gnutls/gnutls.h>
532 fprintf (stdout, "%s\n", GNUTLS_VERSION);
536 if test -x `$WHICH gcc | awk '{print $NF}'`; then
537 gcc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
538 VER=`./"$TMPFILE".bin`
539 elif test -x `$WHICH cc | awk '{print $NF}'`; then
540 cc $CPPFLAGS $CFLAGS -o "$TMPFILE".bin $TMPFILE
541 VER=`./"$TMPFILE".bin`
545 infomsg "GnuTLS : $VER"
546 rm -f $TMPFILE.c $TMPFILE $TMPFILE.bin
551 if test -n "$1" -a "$1" = "-h" -o "$1" = "--help"; 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}"
559 infomsg "${progname} 0.11.0"
561 infomsg "Please submit the following"
562 infomsg "information with your bug report:"
600 infomsg "Bug report saved in ./my_gnunet_bugreport.log"
603 main "$@" 2>&1 | tee "my_gnunet_bugreport.log"