Bug 214533
Summary: | configure needs to support --with-fhs | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] 389 | Reporter: | Noriko Hosoi <nhosoi> | ||||||||||||||||
Component: | Install/Uninstall | Assignee: | Noriko Hosoi <nhosoi> | ||||||||||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Viktor Ashirov <vashirov> | ||||||||||||||||
Severity: | medium | Docs Contact: | |||||||||||||||||
Priority: | medium | ||||||||||||||||||
Version: | 1.0.2 | CC: | nkinder, rmeggins | ||||||||||||||||
Target Milestone: | --- | ||||||||||||||||||
Target Release: | --- | ||||||||||||||||||
Hardware: | All | ||||||||||||||||||
OS: | Linux | ||||||||||||||||||
Whiteboard: | |||||||||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||||||||
Doc Text: | Story Points: | --- | |||||||||||||||||
Clone Of: | Environment: | ||||||||||||||||||
Last Closed: | 2015-12-07 16:57:55 UTC | Type: | --- | ||||||||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||||||||
Documentation: | --- | CRM: | |||||||||||||||||
Verified Versions: | Category: | --- | |||||||||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||||||
Embargoed: | |||||||||||||||||||
Bug Depends On: | |||||||||||||||||||
Bug Blocks: | 152373, 240316, 427409 | ||||||||||||||||||
Attachments: |
|
Description
Noriko Hosoi
2006-11-08 00:33:54 UTC
Created attachment 140927 [details]
cvs diffs (configure.ac Makefile.am), new file m4/fhs.m4
Files:
configure.ac
Makefile.am
m4/fhs.m4
Changes:
1. introduced a new option --with-fhs
2. instead of passing the define macro with -D, generate config.h
I verified that the changes in Comment #1 generates config.h with the following define: with_fhs/config.h:#define IS_FHS 1 without_fhs:/* #undef IS_FHS */ And the build command line (on RHEL4) looks like this: if gcc -DHAVE_CONFIG_H -I. -I.. -I. -DXP_UNIX -DLinux -DLINUX -DLINUX2_0 -DLINUX2_2 -DLINUX2_4 -DBUILD_NUM=\"2006.314.1857\" -I../ldap/include -I../ldap/servers/slapd -I../include -I. -I../lib/ldaputil -I/usr/include/mozldap6 -I/usr/include/dirsec/nspr4 -I/usr/include/dirsec/nss3 -I/usr/include/dirsec/nss3 -I/usr/include/dirsec/nspr4 -g -O2 -MT lib/ldaputil/libldaputil_a-ldapdb.o -MD -MP -MF "lib/ldaputil/.deps/libldaputil_a-ldapdb.Tpo" -c -o lib/ldaputil/libldaputil_a-ldapdb.o `test -f 'lib/ldaputil/ldapdb.c' || echo '../'`lib/ldaputil/ldapdb.c; Now, each source file can have this include at the top of the code? #ifdef HAVE_CONFIG_H # include <config.h> #endif (In reply to comment #2) > Now, each source file can have this include at the top of the code? > #ifdef HAVE_CONFIG_H > # include <config.h> > #endif Yes. If there are already common include files, we might be able to save some work and just put that code in the common include files. OTOH, it's probably not a big deal to write a script to add this to all our source code. (In reply to comment #3) > (In reply to comment #2) > > Now, each source file can have this include at the top of the code? > > #ifdef HAVE_CONFIG_H > > # include <config.h> > > #endif > > Yes. If there are already common include files, we might be able to save some > work and just put that code in the common include files. OTOH, it's probably > not a big deal to write a script to add this to all our source code. Thanks, Rich! The autoconf manual writes "The package should '#include' the configuration header file before any other header files, to prevent inconsistencies in declarations (for example, if it redefines const)." So, I think it'd be safer in the long run to add the include to all... Let me work on it. Ok. Created attachment 140943 [details]
cvs diffs (all the source codes)
Changes:
Added the following include next to the end of the copyright block.
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
I updated all the *.h, *.c, *.cpp, and *.cc files under ldapserver.
(In reply to comment #5) > Ok. I assume this "Ok" includes this note "to add this to all our source code." :) And Nathan gave me a verbal ok, too. I'm going to check in ALL the source code files in 15 min (starting from 3:30pm) ... Please stop me now if you have any issue. Created attachment 140948 [details] cvs commit message (ldapserver) Checked in the diffs in Comment #6 into HEAD. Created attachment 140949 [details]
cvs commit (autoconf tools)
Reviewed by Rich (Thank you!)
Checked in the files reviewed (configure.ac, Makefile.am, and m4/fhs.m4) as
well as the generated files by autogen.sh (Makefile.in configure) into HEAD.
File: configure.ac Changes: if --with-fhs is set, bindir, libdir, and datadir starts from $prefix/usr: Index: configure.ac =================================================================== RCS file: /cvs/dirsec/ldapserver/configure.ac,v retrieving revision 1.8 diff -t -w -U4 -r1.8 configure.ac --- configure.ac 10 Nov 2006 23:59:15 -0000 1.8 +++ configure.ac 11 Nov 2006 01:11:45 -0000 @@ -127,9 +127,13 @@ AC_SUBST(netsnmp_libdir) AC_SUBST(netsnmp_link) # installation paths -dnl bindir=/usr/bin +if test "$with_fhs" = "yes"; then + bindir=$prefix/usr/bin + libdir=$prefix/usr/lib + datadir=$prefix/usr/share +fi # relative to sysconfdir configdir=/fedora-ds/config # relative to datadir sampledatadir=/fedora-ds/data Now, ds_newinst.pl works without any changes. $ cd <prefix> $ ls usr bin/ lib/ share/ $ ls usr/* usr/bin: dbgen.pl* infadd* infadd-bin* ldclt* ldclt-bin* rsearch* rsearch-bin* usr/lib: fedora-ds/ usr/share: fedora-ds/ $ perl usr/lib/fedora-ds/ds_newinst.pl /tmp/install.inf [nhosoi@laputa ds72_core]$ perl usr/lib/fedora-ds/ds_newinst.pl /tmp/install.infSuccess! Your new directory server instance was created Note: create_instance is going to be updated to support --without-fhs, too. Note: if $prefix is not added, bindir starts from /usr/bin although I set --prefix=... Created attachment 141084 [details]
cvs commit message (confiugre.ac configure)
Reviewed by Nathan (Thank you!!)
Checked in into HEAD.
Created attachment 141108 [details]
cvs diffs
Modified Files:
configure.ac
ldap/admin/src/create_instance.c
ldap/admin/src/create_instance.h
New File:
ldap/admin/src/ds_newinst.pl.in
Changes:
configure.ac: $prefix should have been @prefix@. $prefix is replaced with the
value of --prefix, but not with AC_PREFIX_DEFAULT when --prefix is not given.
create_instance.[ch]: depending upon the macro IS_FHS, change swich the LIBDIR,
BINDIR, DATADIR, and DOCDIR.
ds_newinst.pl.in: use @libdir@ to get the ds_newinst path.
Created attachment 141122 [details]
cvs commit message
Reviewed by Rich (Thank you!!!)
Checked in into HEAD.
$ cvs st configure =================================================================== File: configure Status: Up-to-date Working revision: 1.77 Repository revision: 1.77 /cvs/dirsec/ldapserver/configure,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) $ ./configure --help | egrep with-fhs --with-fhs Use FHS layout --with-fhs-opt Use FHS optional layout The package built with --with-fhs is installed at the directories defined with FHS. If --prefix=<path> is added to it, FHS under <prefix> is used. If an inf file is passed to setup (setup-ds.pl or setup-ds-admin.pl), the directory instance is created at the locations specified in the inf file (quickinstall does it). I.e., verified. |