From 697765c71511331a82acfe1a6a23e0956c8dd37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Fri, 20 Nov 2015 15:14:00 +0000 Subject: [PATCH] updated --- scripts/ax_init_standard_project.m4 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/ax_init_standard_project.m4 b/scripts/ax_init_standard_project.m4 index c0d5d72..a7e207d 100644 --- a/scripts/ax_init_standard_project.m4 +++ b/scripts/ax_init_standard_project.m4 @@ -90,16 +90,19 @@ AC_DEFUN([AX_ADD_MAKEFILE_TARGET_DEP], [ fi ]) -# Same as AC_SUBST, but adds -Dname="value" option to CPPFLAGS +# Same as AC_SUBST, but adds -Dname="value" option to CPPFLAGS and a +# notz only a @name@ replacement, but also a @name_ENCODED@ one to be +# used in code. # - parameters: # $1 = variable name AC_DEFUN([AX_SUBST], [ + [$1]_ENCODED=$(echo "${$1}" | awk 1 ORS='\\n' | sed 's,\\n$,,') + [$1]_ENCODED=${[$1]_ENCODED//\"/\\\"} + [$1]_ENCODED=${[$1]_ENCODED//\'/\'\"\'\"\'} + [$1]_ENCODED=${[$1]_ENCODED//#/\\#} + AM_CPPFLAGS+=" '-D$1=\"${[$1]_ENCODED}\"'" AC_SUBST([$1]) - tmp_var=$(echo "${$1}" | awk 1 ORS='\\n' | sed 's,\\n$,,') - tmp_var=${tmp_var//\"/\\\"} - tmp_var=${tmp_var//\'/\'\"\'\"\'} - tmp_var=${tmp_var//#/\\#} - AM_CPPFLAGS+=" '-D$1=\"${tmp_var}\"'" + AC_SUBST([$1]_ENCODED) AC_SUBST(AM_CPPFLAGS) ])