aboutsummaryrefslogtreecommitdiff
path: root/configure
blob: 0457f09fdb5e2aaf74147843920b2cc9120d1558 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /bin/sh

if [ sed --version >/dev/null 2>&1 ]; then
  GSED=sed
else
  GSED=gsed
fi

if [ "$#" -lt 2 ]; then
  echo "Usage:"
  echo "  $0 <bpt_key_t> <bpt_key_bitmask_t>"
  echo
  echo "Example:"
  echo "  $0 intptr_t int64_t"
  exit 2
fi

KEY_T=$1
BITMASK_T=$2

make config ADDITIONAL_CFLAGS="-DBPT_KEY_T=$KEY_T -DBPT_KEY_BITMASK_T=$BITMASK_T"
CONFIG_CFLAGS=$(./config)
make cleanconfig

"$GSED" --in-place "s/ADDITIONAL_CFLAGS =.*\$/ADDITIONAL_CFLAGS = $CONFIG_CFLAGS -DBPT_EXPLICIT_CONFIGURATION -DBPT_KEY_T=$KEY_T -DBPT_KEY_BITMASK_T=$BITMASK_T/" Makefile