summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2007-04-02 17:02:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:42 -0500
commitbd2380978db03f93ff5af54e98f3dc3f9ff0f1ec (patch)
tree920e06fe8e01003408c24533b1fb9dde0a508535 /source4
parent15ceca1956620711a062631e8cc0fed391edd4d2 (diff)
downloadsamba-bd2380978db03f93ff5af54e98f3dc3f9ff0f1ec.tar.gz
samba-bd2380978db03f93ff5af54e98f3dc3f9ff0f1ec.tar.bz2
samba-bd2380978db03f93ff5af54e98f3dc3f9ff0f1ec.zip
r22027: Allow separate build and source directories. Don't follow symlinks
when copying hemidal_build since this leads to traversal loops. (This used to be commit ef32ad83d2edbd8fe638d1f5493b960d2e09b6ae)
Diffstat (limited to 'source4')
-rw-r--r--source4/configure.ac35
1 files changed, 27 insertions, 8 deletions
diff --git a/source4/configure.ac b/source4/configure.ac
index 02e6eb3710..f8450b01d1 100644
--- a/source4/configure.ac
+++ b/source4/configure.ac
@@ -78,6 +78,10 @@ CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
AC_SUBST(ac_default_prefix)
+for d in build/smb_build bin include ; do
+ test -d ${builddir}/$d || AS_MKDIR_P(${builddir}/$d)
+done
+
echo "configure: creating build/smb_build/config.pm"
cat >build/smb_build/config.pm<<CEOF
# config.pm - Autogenerate by configure. DO NOT EDIT!
@@ -107,15 +111,30 @@ $SMB_INFO_LIBRARIES
CEOF
AC_OUTPUT_COMMANDS(
-[test "x$ac_abs_srcdir" != "x$ac_abs_builddir" &&
- (cd $builddir;
- test -d heimdal || cp -r $srcdir/heimdal $builddir/
- test -d heimdal_build || cp -r $srcdir/heimdal_build $builddir/
- test -d build || samba_builddir="$builddir" samba_srcdir="$srcdir" $PERL $srcdir/script/buildtree.pl
- test -f $builddir/include/smb.h || cp $srcdir/include/smb.h $builddir/include
+[
+test "x$ac_abs_srcdir" != "x$ac_abs_builddir" && (
+ cd $builddir;
+ # NOTE: We *must* use -R so we don't follow symlinks (at least on BSD
+ # systems).
+ test -d heimdal || cp -R $srcdir/heimdal $builddir/
+ test -d heimdal_build || cp -R $srcdir/heimdal_build $builddir/
+ test -d build || builddir="$builddir" \
+ srcdir="$srcdir" \
+ $PERL ${srcdir}/script/buildtree.pl
)
-$PERL -I${builddir} -I${srcdir} -I${srcdir}/build ${srcdir}/build/smb_build/main.pl || exit $?],[
-PERL="$PERL";export PERL;export srcdir; export builddir;
+
+$PERL -I${builddir} -I${builddir}/build \
+ -I${srcdir} -I${srcdir}/build \
+ ${srcdir}/build/smb_build/main.pl || exit $?
+],
+[
+srcdir="$srcdir"
+builddir="$builddir"
+PERL="$PERL"
+
+export PERL
+export srcdir
+export builddir
])
AC_OUTPUT