|
From: | Bob Friesenhahn |
Subject: | Re: finding datadir from executable |
Date: | Sun, 5 Sep 2004 19:16:48 -0500 (CDT) |
On Sun, 5 Sep 2004, Nicholas R. Markham wrote:
I recently decided to try to apply the suggestion mentioned in section 17.5 of the autoconf manual - namely, to hardcode only the relative path from prefix to datadir (or maybe from bindir to datadir) and try to determine prefix at runtime. However, I'm not sure how to determine prefix at runtime. Can anyone give me an example of how they did it? Thanks.
# # Evaluate shell variable equivalents to Makefile directory variables # if test "x$prefix" = xNONE then prefix=$ac_default_prefix fi # Let make expand exec_prefix. if test "x$exec_prefix" = xNONE then exec_prefix='${prefix}' fi # eval "eval PREFIX_DIR=${prefix}" AC_SUBST(PREFIX_DIR) eval "eval EXEC_PREFIX_DIR=${exec_prefix}" AC_SUBST(EXEC_PREFIX_DIR) eval "eval BIN_DIR=$bindir" AC_SUBST(BIN_DIR) eval "eval SBIN_DIR=$sbindir" AC_SUBST(SBIN_DIR) eval "eval LIBEXEC_DIR=$libexecdir" AC_SUBST(LIBEXEC_DIR) eval "eval DATA_DIR=$datadir" AC_SUBST(DATA_DIR) eval "eval SYSCONF_DIR=$sysconfdir" AC_SUBST(SYSCONF_DIR) eval "eval SHAREDSTATE_DIR=$sharedstatedir" AC_SUBST(SHAREDSTATE_DIR) eval "eval LOCALSTATE_DIR=$localstatedir" AC_SUBST(LOCALSTATE_DIR) eval "eval LIB_DIR=$libdir" AC_SUBST(LIB_DIR) eval "eval INCLUDE_DIR=$includedir" AC_SUBST(INCLUDE_DIR) eval "eval OLDINCLUDE_DIR=$oldincludedir" AC_SUBST(OLDINCLUDE_DIR) eval "eval INFO_DIR=$infodir" AC_SUBST(INFO_DIR) eval "eval MAN_DIR=$mandir" AC_SUBST(MAN_DIR) ====================================== Bob Friesenhahn address@hidden http://www.simplesystems.org/users/bfriesen
[Prev in Thread] | Current Thread | [Next in Thread] |