Fix null pointer dereference in process_debug_info()
[binutils-gdb.git] / gdb / transform.m4
blobef2c41c9e398925895f326ca89be61165e9812d1
1 # Copyright (C) 2015-2024 Free Software Foundation, Inc.
3 # This file is free software; the Free Software Foundation gives
4 # unlimited permission to copy and/or distribute it, with or without
5 # modifications, as long as this notice is preserved.
7 # GDB_AC_TRANSFORM([PROGRAM], [VAR])
9 # Transform a tool name to get the installed name of PROGRAM and store
10 # it in the output variable VAR.
12 # This macro uses the SED command stored in $program_transform_name,
13 # but it undoes the Makefile-like escaping of $s performed by
14 # AC_ARG_PROGRAM.
16 AC_DEFUN([GDB_AC_TRANSFORM], [
17   gdb_ac_transform=`echo "$program_transform_name" | sed -e 's/[\\$][\\$]/\\$/g'`
18   $2=`echo $1 | sed -e "$gdb_ac_transform"`
19   if test "x$$2" = x; then
20      $2=$1
21   fi
22   AC_SUBST($2)