stx_libbasic3-config.sh
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 17 Feb 2021 15:24:09 +0100
branchjv
changeset 4568 524471ef6575
parent 4395 96eb18f215e5
permissions -rwxr-xr-x
Changing the encoding style header for fileOutAs

#!/usr/bin/env bash
#
# Simple script to (auto)create libprofiler-config.h
# based on what is available on current system
#

HEADER=stx_libbasic3-config.h
INCLUDE_DIRS="/usr/include /usr/local/include"

function out() {
    echo "$1" >> $HEADER
}

echo -n > $HEADER
out "/* Do not edit! Automatically generated at $(date) */"
out ""
for inc in $INCLUDE_DIRS; do
    if [ -r "$inc/valgrind/valgrind.h" ]; then
    	out "#if !defined(_WIN32) && !defined(_WIN64)"    	
        out "# define HAS_VALGRIND"        
        if [ -r "$inc/valgrind/callgrind.h" ]; then
            out "# define HAS_CALLGRIND"        
        fi        
        out "#endif"
    fi        
done

out ""