On Wed, Jul 24, 2002 at 11:08:10PM +0100, Will Newton wrote:
> I am packaging a program that needs to have a path defined in config.h. I 
> tried:
> 
> AC_DEFINE_UNQUOTED(BASE_PATH, $datadir )
> 
> but this evaluates to $prefix/share. I need it to evaluate to /usr/share.
 
> What's the best way to do this?

Some time back, I found this macro on the net, which might be helpful:

dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
dnl
dnl This macro _AC_DEFINEs VARNAME to the expansion of the DIR
dnl variable, taking care of fixing up ${prefix} and such.
dnl
dnl Note that the 3 argument form is only supported with autoconf 2.13
and
dnl later (i.e. only where _AC_DEFINE supports 3 arguments).
dnl
dnl Examples:
dnl
dnl    AC_DEFINE_DIR(DATADIR, datadir)
dnl    AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed
binaries])
dnl
dnl @version $Id: acinclude.m4,v 1.2 2002/01/25 18:46:42 cljanss Exp $
dnl @author Guido Draheim <[EMAIL PROTECTED]>, original by Alexandre Oliva

AC_DEFUN([AC_DEFINE_DIR], [
  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  ac_define_dir=`eval echo [$]$2`
  ac_define_dir=`eval echo [$]ac_define_dir`
  ifelse($3, ,
    AC_DEFINE_UNQUOTED($1, "$ac_define_dir"),
    AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3))
])

Michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to