Bug 210736 - Implement autotools build system
Summary: Implement autotools build system
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.0.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Viktor Ashirov
URL:
Whiteboard:
: 159371 (view as bug list)
Depends On:
Blocks: 152373 240316
TreeView+ depends on / blocked
 
Reported: 2006-10-13 23:13 UTC by Nathan Kinder
Modified: 2015-12-07 17:16 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:16:36 UTC
Embargoed:


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

Description Nathan Kinder 2006-10-13 23:13:53 UTC
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 23:18:42 UTC
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 23:21:13 UTC
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 23:23:20 UTC
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 23:26:04 UTC
Created attachment 138471 [details]
ICU m4 file

This is the m4 file for locating ICU.

Comment 5 Nathan Kinder 2006-10-13 23:27:03 UTC
Created attachment 138472 [details]
Mozldap m4 file

This is the m4 file for locating Mozldap.

Comment 6 Nathan Kinder 2006-10-13 23:28:38 UTC
Created attachment 138473 [details]
Net-SNMP m4 file

This is the m4 file for locating Net-SNMP.

Comment 7 Nathan Kinder 2006-10-13 23:29:17 UTC
Created attachment 138474 [details]
NSPR m4 file

This is the m4 file for locating NSPR.

Comment 8 Nathan Kinder 2006-10-13 23:30:28 UTC
Created attachment 138475 [details]
NSS m4 file

This is the m4 file for locating NSS.

Comment 9 Nathan Kinder 2006-10-13 23:32:09 UTC
Created attachment 138476 [details]
Cyrus-SASL m4 file

This is the m4 file for locating Cyrus-SASL.

Comment 10 Nathan Kinder 2006-10-13 23:33:21 UTC
Created attachment 138477 [details]
Svrcore m4 file

This is the m4 file for locating Svrcore.

Comment 11 Nathan Kinder 2006-10-13 23:38:32 UTC
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 23:43:21 UTC
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 16:39:34 UTC
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 16:42:51 UTC
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 16:54:09 UTC
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 17:01:26 UTC
(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 17:02:43 UTC
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 17:04:53 UTC
(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 17:14:25 UTC
(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 22:33:31 UTC
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 22:36:38 UTC
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 22:40:09 UTC
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 22:43:29 UTC
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-17 03:05:58 UTC
Looks good.

Comment 26 Nathan Kinder 2006-10-17 17:12:40 UTC
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-25 02:34:46 UTC
*** Bug 159371 has been marked as a duplicate of this bug. ***

Comment 28 Nathan Kinder 2007-12-21 17:54:03 UTC
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.