Bug 210736 - Implement autotools build system
Implement autotools build system
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Directory Server (Show other bugs)
1.0.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nathan Kinder
Viktor Ashirov
:
: 159371 (view as bug list)
Depends On:
Blocks: 152373 240316
  Show dependency treegraph
 
Reported: 2006-10-13 19:13 EDT by Nathan Kinder
Modified: 2015-12-07 12:16 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 12:16:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Top-level Automake Makefile (26.81 KB, text/plain)
2006-10-13 19:18 EDT, Nathan Kinder
no flags Details
configure.ac script (2.93 KB, text/plain)
2006-10-13 19:21 EDT, Nathan Kinder
no flags Details
Berkeley DB m4 file (1.40 KB, text/plain)
2006-10-13 19:23 EDT, Nathan Kinder
no flags Details
ICU m4 file (2.52 KB, text/plain)
2006-10-13 19:26 EDT, Nathan Kinder
no flags Details
Mozldap m4 file (2.52 KB, text/plain)
2006-10-13 19:27 EDT, Nathan Kinder
no flags Details
Net-SNMP m4 file (3.25 KB, text/plain)
2006-10-13 19:28 EDT, Nathan Kinder
no flags Details
NSPR m4 file (2.40 KB, text/plain)
2006-10-13 19:29 EDT, Nathan Kinder
no flags Details
NSS m4 file (2.36 KB, text/plain)
2006-10-13 19:30 EDT, Nathan Kinder
no flags Details
Cyrus-SASL m4 file (2.82 KB, text/plain)
2006-10-13 19:32 EDT, Nathan Kinder
no flags Details
Svrcore m4 file (1.90 KB, text/plain)
2006-10-13 19:33 EDT, Nathan Kinder
no flags Details
CVS Diffs (1.94 KB, patch)
2006-10-13 19:38 EDT, Nathan Kinder
no flags Details | Diff
New configure.ac script (3.07 KB, text/plain)
2006-10-16 18:33 EDT, Nathan Kinder
no flags Details
New top-level Automake Makefile (26.47 KB, text/plain)
2006-10-16 18:36 EDT, Nathan Kinder
no flags Details
New Berkeley DB m4 file (1.91 KB, text/plain)
2006-10-16 18:40 EDT, Nathan Kinder
no flags Details
New Net-SNMP m4 file (3.04 KB, text/plain)
2006-10-16 18:43 EDT, Nathan Kinder
no flags Details
CVS Commit Message (3.27 KB, text/plain)
2006-10-17 13:12 EDT, Nathan Kinder
no flags Details

  None (edit)
Description Nathan Kinder 2006-10-13 19:13:53 EDT
We need to make the Directory Server build system use GNU Autoconf and GNU
Automake.  The build system needs to support RHEL/FC systems, Solaris 9, and
HP-UX IPF systems at a minimum for the first cut.  Other platform support can be
added in as needed.

Implementing the new build system is going to be done in multiple phases.  We
need to leave the existing Makefiles around for a while until the new build
system stabilizes.
Comment 1 Nathan Kinder 2006-10-13 19:18:42 EDT
Created attachment 138468 [details]
Top-level Automake Makefile

This is the new top-level Automake Makefile.  The new build system will only
use this one makefile instead of doing a recursive make.
Comment 2 Nathan Kinder 2006-10-13 19:21:13 EDT
Created attachment 138469 [details]
configure.ac script

This is the new configure.ac script.  I am not going to attach the generated
configure script as it will be huge and unreadable.
Comment 3 Nathan Kinder 2006-10-13 19:23:20 EDT
Created attachment 138470 [details]
Berkeley DB m4 file

This is the m4 file for locating Berkeley DB.  This and other m4 files will be
placed in the "ldapserver/m4" directory in the source tree.
Comment 4 Nathan Kinder 2006-10-13 19:26:04 EDT
Created attachment 138471 [details]
ICU m4 file

This is the m4 file for locating ICU.
Comment 5 Nathan Kinder 2006-10-13 19:27:03 EDT
Created attachment 138472 [details]
Mozldap m4 file

This is the m4 file for locating Mozldap.
Comment 6 Nathan Kinder 2006-10-13 19:28:38 EDT
Created attachment 138473 [details]
Net-SNMP m4 file

This is the m4 file for locating Net-SNMP.
Comment 7 Nathan Kinder 2006-10-13 19:29:17 EDT
Created attachment 138474 [details]
NSPR m4 file

This is the m4 file for locating NSPR.
Comment 8 Nathan Kinder 2006-10-13 19:30:28 EDT
Created attachment 138475 [details]
NSS m4 file

This is the m4 file for locating NSS.
Comment 9 Nathan Kinder 2006-10-13 19:32:09 EDT
Created attachment 138476 [details]
Cyrus-SASL m4 file

This is the m4 file for locating Cyrus-SASL.
Comment 10 Nathan Kinder 2006-10-13 19:33:21 EDT
Created attachment 138477 [details]
Svrcore m4 file

This is the m4 file for locating Svrcore.
Comment 11 Nathan Kinder 2006-10-13 19:38:32 EDT
Created attachment 138478 [details]
CVS Diffs

These changes are needed for the new build system to work.  The changes are:

- Modify buildnum.pl to just return the build number if the platform argument 
  is not supplied.  The new build system generated the build number at
configure
  time and puts it in the generated Makefile instead of a buildnum.dat file.

- The include line for ldap-agent.h was formatted for a system header file,
  would cause the new build system to not locate it when compiling the SNMP
  subagent.
Comment 12 Nathan Kinder 2006-10-13 19:43:21 EDT
The above attachments comprise the first phase of implementing the new build
system.  There are a number of files generated by autoconf that will need to be
checked in as well, but they are all generated from the above attachments.

The second phase will need to clean up some of the conditional defines as well
as add configure options for things like an optimized build and 64-bit.  All of
this is possible with the current implementation by using CFLAGS, CXXFLAGS, etc.
Comment 13 Rich Megginson 2006-10-16 12:39:34 EDT
Re: comment #1 - looks good.  Some minor points
ns-slapd.properties is a bin_PROGRAM?  I think it should be a nodist_DATA or
something like that.
I think we should just get rid of keyupg and liblitekey.  And do we still need
libldif?  Can't we just use mozldap?
The sources for some of the libraries include the sources for libavl, libldif,
etc. Is that necessary?  Shouldn't we just build/link the lib/prog that uses
them with -lavl etc.?
Comment 14 Rich Megginson 2006-10-16 12:42:51 EDT
re: comment#2 - looks good.  We'll have to make the platform_defs for hpux
figure out if using parisc or ipf.
Comment 15 Noriko Hosoi 2006-10-16 12:54:09 EDT
Your new autotool files/scripts look good.
One question and one request:
I guess it would be independent from the autotoolize itself, but how the
branding script is run with this new way of building?
A favor I'd like to ask you...  When all the job is done, could you write down
Howto 1) add/delete a source file to the server, 2) add/delete linking a
component, 3) add a new plugin?  It'd be a great help not just for me, but for
the community. ;)
Comment 16 Nathan Kinder 2006-10-16 13:01:26 EDT
(In reply to comment #13)
> ns-slapd.properties is a bin_PROGRAM?  I think it should be a nodist_DATA or
> something like that.

It probably shouldn't be a bin_PROGRAM, but we do distribute the properties file
in "bin/slapd/property", so it's not a nodist.

> I think we should just get rid of keyupg and liblitekey.  And do we still need
> libldif?  Can't we just use mozldap?

It's possible that we can use mozldap instead, but I tried not to change the way
things are built for the first phase too much.  We need to look into this for
phase 2.

> The sources for some of the libraries include the sources for libavl, libldif,
> etc. Is that necessary?  Shouldn't we just build/link the lib/prog that uses
> them with -lavl etc.?

Libtool warns that linking static libraries to shared libraries is not portable,
and it in fact doesn't link them on HP-UX.  We could make them shared libraries
instead if that seems to be a better approach.
Comment 17 Rich Megginson 2006-10-16 13:02:43 EDT
For the m4 file for db, we should try to figure out where db4.2 is on the
system, if the user doesn't specify --with-db or if they specify --with-db
(which is passed as --with-db=yes to configure).  For example, on RHEL4, it
should just work if you omit --with-db - it should find -ldb-4.2 in the default
lib path, and db.h in the default include path.

icu looks good

mozldap looks good

net-snmp looks good

for nspr and nss, we might want to look for dirsec-nspr and dirsec-nss in
pkg-config if nspr or nss is not found.  This will make it easier to support
RHEL4 and other platforms where we have to use the dirsec-nspr and dirsec-nss.

sasl looks good

svrcore looks good

One thing we can use is AC_CHECK_LIB/FUNC and the related macros.  This will
attempt to do a compile/link.  This is the usual way to see if a particular
library is in the default link path and contains some symbol you're interested
in.  We use this in the mozldap sasl.m4 to find libsasl2.
Comment 18 Nathan Kinder 2006-10-16 13:04:53 EDT
(In reply to comment #14)
> re: comment#2 - looks good.  We'll have to make the platform_defs for hpux
> figure out if using parisc or ipf.
> 

The $host variable contains the cpu arch in configure.ac, so this will be pretty
easy to do.
Comment 20 Rich Megginson 2006-10-16 13:14:25 EDT
(In reply to comment #16)
>> ns-slapd.properties is a bin_PROGRAM?  I think it should be a nodist_DATA or
>> something like that.

> It probably shouldn't be a bin_PROGRAM, but we do distribute the properties file
> in "bin/slapd/property", so it's not a nodist.

In autotool-speak, the dist_ prefix means source distribution - it denotes files
which you want to be included in the source distribution.  I think all sources
mentioned in the Makefile are distributed by default unless you mark them as
nodist_.  The inst_ prefix is used to denote files which are to be installed. 
By default, files mentioned in targets such as bin_, lib_ etc. are installed in
those locations (e.g. bin == /usr/bin, lib == /usr/lib).  Using noinst_ means
not to install those files.

> It's possible that we can use mozldap instead, but I tried not to change the way
> things are built for the first phase too much.  We need to look into this for
phase 2.

Ok.

>> The sources for some of the libraries include the sources for libavl, libldif,
>> etc. Is that necessary?  Shouldn't we just build/link the lib/prog that uses
>> them with -lavl etc.?

> Libtool warns that linking static libraries to shared libraries is not portable,
> and it in fact doesn't link them on HP-UX.  We could make them shared libraries
> instead if that seems to be a better approach.

Hmm - ok.  Linking a static library is exactly the same as including those .o
files in the shared library/program, so I guess what you have is ok.  Linking a
static lib into a shared lib should be portable - I wonder why it isn't?  Just
leave it as is for now.
Comment 21 Nathan Kinder 2006-10-16 18:33:31 EDT
Created attachment 138631 [details]
New configure.ac script

This new version of configure.ac addresses the HP-UX cpu architecture issue
raised in comment #14.
Comment 22 Nathan Kinder 2006-10-16 18:36:38 EDT
Created attachment 138633 [details]
New top-level Automake Makefile

This new Makefile.am addresses the issues raised in Comemnt #13.  I got rid of
litlitekey and keyupg.	I also changed ns-slapd.properties to be a
nodist_data_DATA file.
Comment 23 Nathan Kinder 2006-10-16 18:40:09 EDT
Created attachment 138634 [details]
New Berkeley DB m4 file

The new db.m4 file addresses the issues brought up in comment #17 about finding
libdb.	It will now check the system locations without needing to specify
"--with-db" when running configure.
Comment 24 Nathan Kinder 2006-10-16 18:43:29 EDT
Created attachment 138636 [details]
New Net-SNMP m4 file

I ran into some issues where the include path was set incorrectly for locating
the Net-SNMP headers.  This new file fixes these issues.  Basically, our source
files contain the "net-snmp" directory in the include statements (like
<net-snmp/net-snmp-includes.h>.  This means the "$netsnmp_inc" variable needed
to have the "net-snmp" directory removed from the include path.
Comment 25 Rich Megginson 2006-10-16 23:05:58 EDT
Looks good.
Comment 26 Nathan Kinder 2006-10-17 13:12:40 EDT
Created attachment 138699 [details]
CVS Commit Message

Checked into the ldapserver trunk.  Thanks to Rich and Noriko for their
reviews!
Comment 27 Nathan Kinder 2006-10-24 22:34:46 EDT
*** Bug 159371 has been marked as a duplicate of this bug. ***
Comment 28 Nathan Kinder 2007-12-21 12:54:03 EST
We have been using the autotools based build-system for some time now.  Marking
as VERIFIED.

Note You need to log in before you can comment on or make changes to this bug.