X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/01386fc8db473eac03c5aaaa53f3790cde319a76..bbe59354d97fa30184f6a95cf1f31ce447d0fa29:/.ext/cfd/m4/mdw-define-paths.m4 diff --git a/.ext/cfd/m4/mdw-define-paths.m4 b/.ext/cfd/m4/mdw-define-paths.m4 new file mode 100644 index 00000000..ff5dc08f --- /dev/null +++ b/.ext/cfd/m4/mdw-define-paths.m4 @@ -0,0 +1,78 @@ +dnl -*-autoconf-*- + +### SYNOPSIS +### +### mdw_DEFINE_PATHS(BODY) +### +### mdw_PROG(PROG) +### mdw_PATH(PATH) +### mdw_DEFINE_PROG(SYMBOL, PROG) +### mdw_DEFINE_PATH(SYMBOL, PATH) +### +### DESCRIPTION +### +### This collection of macros is useful for hardcoding pathname strings +### into binary programs. +### +### Within the BODY of `mdw_DEFINE_PATHS', a number of variables are `fixed +### up' so that they can be properly expanded. The other macros are only +### really useful within this body. +### +### `mdw_PROG' expands, in the shell, to the transformed name of the +### program PROG. +### +### `mdw_PATH' expands, in the shell, to the recursive expansion of PATH, +### which should be a string containing parameter expansions. +### +### `mdw_DEFINE_PROG' is a convenience macro which defines the preprocessor +### SYMBOL to the result of `mdw_PROG(PROG)'; similarly `mdw_DEFINE_PATH' +### defines SYMBOL to the result of `mdw_PATH(PATH)'. +### +### LICENSE +### +### Copyright (c) 2002 Mark Wooding +### +### This program is free software: you can redistribute it and/or modify it +### under the terms of the GNU General Public License as published by the +### Free Software Foundation, either version 2 of the License, or (at your +### option) any later version. +### +### This program is distributed in the hope that it will be useful, but +### WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +### General Public License for more details. +### +### You should have received a copy of the GNU General Public License along +### with this program. If not, see . +### +### As a special exception, the respective Autoconf Macro's copyright owner +### gives unlimited permission to copy, distribute and modify the configure +### scripts that are the output of Autoconf when processing the Macro. You +### need not follow the terms of the GNU General Public License when using +### or distributing such scripts, even though portions of the text of the +### Macro appear in them. The GNU General Public License (GPL) does govern +### all other use of the material that constitutes the Autoconf Macro. +### +### This special exception to the GPL applies to versions of the Autoconf +### Macro released by the Autoconf Archive. When you make and distribute a +### modified version of the Autoconf Macro, you may extend this special +### exception to the GPL to apply to your modified version as well. + +# serial 1 +AC_DEFUN([mdw_DEFINE_PATHS], +[mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix +mdw_transform=$(echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g') +test "$prefix" = "NONE" && prefix=$ac_default_prefix +test "$exec_prefix" = "NONE" && exec_prefix=$prefix +$1 +prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix]) + +AC_DEFUN([mdw_PROG], [$(echo "$1" | sed "$mdw_transform")]) +AC_DEFUN([mdw_PATH], +[$(t="$1"; dnl +while :; do case "$t" in *\$[]*) eval t=\"$t\" ;; *) break ;; esac; done; dnl +echo "$t")]) +AC_DEFUN([mdw_DEFINE_PROG], + [AC_DEFINE_UNQUOTED([$1], ["mdw_PROG([$2])"], [Program name for $2.])]) +AC_DEFUN([mdw_DEFINE_PATH], + [AC_DEFINE_UNQUOTED([$1], ["mdw_PATH([$2])"], [Pathname for $2.])])