AC_DEFINE_UNQUOTED with unresolved shell variables

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

 



Dear autoconf developers,

in a software package I have found code like this:

FOO_DIR="${bindir}"
AC_SUBST(FOO_DIR)
AC_DEFINE_UNQUOTED(FOO_DIR, "$FOO_DIR",
                   [Directory where foo files are installed])

The problem with that is that the value of bindir is usually '${prefix}/bin', so the above code leads to the following line in config.h:

    #define FOO_DIR "${prefix}/bin"

Since the C preprocessor does not know about variable expansion, this reference will never be resolved, and as a result, the programs will not find the files.

What is the most elegant way of solving this? One way I could imagine is to drop the AC_DEFINE_UNQUOTED line and reintroduce the line via

    AM_CPPFLAGS = -DFOO_DIR="@FOO_DIR@"

Is that the preferred solution?

Thanks,

Roland

--
PS: Please CC me


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux