building on a separate tree
oliva at dcc.unicamp.br
Sat Sep 12 08:52:17 GMT 1998
I've recently checked out a copy of SAMBA with anonymous CVS, and I
found some trouble building it in a separate tree. I have also found
some errors and inconsistencies in configure.in and Makefile.in, which
I have cleaned up.
The patch that fixes all these problems is attached. I have ommitted
configure, since it can be easily re-created from configure.in. I
have created four new files: one is named stamp-h.in, and three other
three, dummy.in. Patches that create them are at the end of the patch
file, but they won't be added to the CVS repository automatically by
applying the patch (as if you didn't know! :-) :-)
stamp-h.in is part of a technique used in automake for automagically
updating files that are automatically generated from configure.in. I
have modified Makefile.in so that it implements this technique. Now,
when you modify configure.in, configure is rebuild and rerun, which
creates a new config.status. Then, this new config.status is used to
rebuild the Makefile itself. However, it is not working well for
include/config.h, because no files depend on it. Setting
INCLUDES=include/config.h did not work, I don't understand why. I
have tried to arrange that Makefile depends on include/config.h, but
this has some strange implications for GNU make. Anyway, it is an
alternative if we can't find anything else.
The dummy.in files are for the directories that would not be created
in the build tree, because a dummy file would not be created in them
by the configure script. I have also modified the existing dummy.in
files so that they contain at least one byte: some platforms don't
like empty files :-(
-Iinclude had to be included in list of preprocessor flags, otherwise
include/config.h, that does not live in the source tree, would not be
Another problem was that installbin.sh and the other scripts would not
create the root of the installation tree ($prefix), only their
subdirectories. I have fixed this problem by using the install-sh
script to create all needed directories; it will create parent
directories too, if needed. However, I haven't gone to the trouble of
removing the now-obsolete parts of the scripts, that used to be
responsible for creating directories.
Note that installdirs will sometimes creates some unneeded
directories. It might have been better to arrange that each install
target calls install-sh with the list of directories is uses by
I have modified the `clean' and `realclean' targets, so that `clean'
will only clean up intermediate build files, `realclean' will remove
the executables too, and `distclean' (new target) will remove
In acconfig.h, I have added a typedef whose lack autoheader was
complaining about. From the patch to config.h.in, it looks like
someone has modified config.h.in instead of acconfig.h.
In configure.in, I have reduced the number of autoconf warnings about
cross-compilation due to the use of AC_TRY_RUN, and added a fatal
error to prevent SAMBA from being cross-compiled unless the results of
all tests are provided manually, by editing config.cache or defining
the corresponding environment variables.
I have modified all tests that would explicitly print `checking ...'
with calls to AC_CACHE_CHECK, that will not print checking messages
and results if configure --quiet is run.
I have created cache variables where appropriate, so that
reconfiguration is now much faster.
The code for auto-detecting crypt, pam_authenticate and connect would
write incorrect information in the cache, causing reconfigurations to
not include the appropriate libraries in the LIBS variable. Now it
does the right thing.
The source files for some tests would not be found when
builddir!=srcdir; now they will.
In lib/netmask.c, I have removed a warning message that would be
printed if struct in_addr were not defined in any system header file:
gcc would complain because it would be declared inside an argument
list. I have provided a forward declaration.
installcp.sh would not find the codepage_def.* files when
builddir!=srcdir; I have modified it so that it accepts the srcdir as
its first argument. I found that safer than tweaking with $0 within
Since the patch ended up quite large, I have compressed it with bzip2.
I hope this helps.
mailto:oliva at dcc.unicamp.br mailto:aoliva at acm.org
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6553 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/19980912/90b687cd/build-tree.diff.obj
More information about the samba-technical