autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using @bindir@ etc. in C headers


From: Florian Weimer
Subject: Using @bindir@ etc. in C headers
Date: Fri, 05 Jun 2020 12:57:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

I would like to define macros containing the standard paths, like this:

#define BINDIR "@bindir@"

It does not work due to this code in lib/autoconf/general.m4 (which
appears to be predate DESTDIR support):

# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
AC_SUBST([bindir],         ['${exec_prefix}/bin'])dnl
AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl

Is there are generally approved way to work around this?  The manual
tells us to use -D preprocessor arguments, but I'd prefer the
explicitness of defining the macros via a header file.

Thanks,
Florian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]