From a269b9cabbf0e5fc8a5ff8f8d9becba784879ba0 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 15 Nov 2006 17:17:39 +0000 Subject: Resolves: bug 215669 Bug Description: Define LIBDIR, BINDIR, etc. in Makefile Reviewed by: nkinder (Thanks!) Fix Description: The paths LIBDIR, BINDIR, et. al. are #define'd in create_instance.h to hard coded values. We should be able to set these values in configure and override the built in values. We can't simply set them via AC_DEFINE in configure.ac because we are using config.h and this would render the definition like this: #define BINDIR "${exec_prefix}/bin" instead of #define BINDIR "/usr/bin" So we instead define them in Makefile.am and add their definitions to AM_CPPFLAGS, and quote them properly to make sure the value includes the quotation marks when expanded in the C code. I tested this with both an rpmbuild and a regular developer type build. Platforms tested: RHEL4/FC5 Flag Day: no Doc impact: no --- ldap/admin/src/create_instance.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ldap/admin/src/create_instance.h') diff --git a/ldap/admin/src/create_instance.h b/ldap/admin/src/create_instance.h index 3616dc48..f3eac0ea 100644 --- a/ldap/admin/src/create_instance.h +++ b/ldap/admin/src/create_instance.h @@ -54,23 +54,45 @@ extern "C" { /* Assume C declarations for C++ */ #endif /* __cplusplus */ +#ifndef BRAND_DS #define BRAND_DS "fedora-ds" +#endif #ifdef XP_UNIX #define PRODUCT_NAME "slapd" #define PRODUCT_BIN "ns-slapd" +#ifndef LOCALSTATEDIR #define LOCALSTATEDIR "/var" +#endif +#ifndef SYSCONFDIR #define SYSCONFDIR "/etc" +#endif #if defined (IS_FHS) +#ifndef LIBDIR #define LIBDIR "/usr/lib" +#endif +#ifndef BINDIR #define BINDIR "/usr/bin" +#endif +#ifndef DATADIR #define DATADIR "/usr/share" +#endif +#ifndef DOCDIR #define DOCDIR "/usr/doc" +#endif #else /* RPM */ +#ifndef LIBDIR #define LIBDIR "/lib" +#endif +#ifndef BINDIR #define BINDIR "/bin" +#endif +#ifndef DATADIR #define DATADIR "/share" +#endif +#ifndef DOCDIR #define DOCDIR "/doc" +#endif #endif /* IS_FHS */ #else /* Windows */ #define PRODUCT_NAME "slapd" -- cgit