configure: use autoconf-archive ax_pthread.m4

The configuration script "AX_PTHREAD" was added to the build specification
so that corresponding special parameters will be taken into account.

Reference: http://www.gnu.org/software/autoconf-archive/ax_pthread.html
Reviewed-by: SF Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
add missing space to --version print out

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
csstoh.sh: check every single return value

Earlier the script continued processing at errors.

$ ./csstoh.sh powertop.css /dev/full
./csstoh.sh: line 36: echo: write error: No space left on device
./csstoh.sh: line 37: echo: write error: No space left on device
[...]

Now the script will fail immediately when an error occurs.

$ ./csstoh.sh powertop.css /dev/full ; echo $?
cat: write error: No space left on device
1

As a minor improvement the script now writes errors to stderr rather than
stdout, that is more appropriate.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
configure: use AC_USE_SYSTEM_EXTENSIONS to determine features

The AC_USE_SYSTEM_EXTENSIONS will enable everything that a system allows
to be enabled, so there is no longer need for a source file specific
*_SOURCE definitions.  Secondly the uses of _BSD_SOURCE that are removed
in this change are part of deprecated API.  See reference link for
details.

Reference: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=c941736c92fa3a319221f65f6755659b2a5e0a20
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
powertop.m4: GCC_FORTIFY_SOURCE_CC copy idea of macro from Archlinux pacman

The powertop.m4 is a collection file for autoconf m4 helper macros, such
as GCC_FORTIFY_SOURCE_CC.  The macro in case will define feature
_FORTIFY_SOURCE=2 when it is possible, instead of trying to enable when
it will not work, such as at times when optimization is turned off.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
configure: use autoconf-archive ax_cxx_compile_stdcxx_11.m4

Ensure the C++11 is supported, and fail when it is not.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
main: fix incompatible operand type

main.cpp:430:35: error: incompatible operand types ('char *' and 'char')
                        sprintf(workload, "%s", optarg ? optarg : '\0');

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
move variables to protected scope

This fixes series of issues reported by clang++ compiler the same way.

cpu/rapl/rapl_interface.h:37:6: error: private field
'measurment_interval' is not used [-Werror,-Wunused-private-field]
        int measurment_interval;

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
make --quiet option to suppress various info messages

When --quiet is defined messages such as'RAPL device for cpu 0' and
'Leaving PowerTOP' are not expected to be printed.  This change makes
them to be printed to stderr, that the --quiet is redirecting to
/dev/null.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
squeeze all extra bits from size of binary and html report

This change makes the css text smaller by removing unnecessary leading
white spaces, and the logo got 'pngcrush -brute' treatment.

-rw-r--r-- 1 root root 62722 Oct 20 22:12 before.html
-rw-r--r-- 1 root root 60224 Oct 20 22:13 after.html

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
add timestamp to html report

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
fix typo in message

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
add missing include

In file included from measurement/sysfs.cpp:27:
In file included from measurement/../lib.h:59:
In file included from /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/string:52:
In file included from /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/bits/basic_string.h:2850:
In file included from /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/ext/string_conversions.h:41:
/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/cstdlib:153:11: error:
      no member named 'realloc' in the global namespace
  using ::realloc;
        ~~^

Signed-off-by: Sami Kerola <kerolasa@iki.fi>