From: danieldg Date: Mon, 28 Sep 2009 15:39:46 +0000 (+0000) Subject: Work around BSD make chdir bug with symlinks X-Git-Tag: v2.0.23~1477 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=5e1d239f3d94bd1afd3ce64c2f47a64305f1e1f0;p=user%2Fhenk%2Fcode%2Finspircd.git Work around BSD make chdir bug with symlinks git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11775 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/make/calcdep.pl b/make/calcdep.pl index ad25875cf..8cc2632e3 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -18,10 +18,12 @@ sub run() { my $build = $ENV{BUILDPATH}; mkdir $build; chdir $build or die "Could not open build directory: $!"; - mkdir 'bin'; - mkdir 'obj'; - mkdir 'modules'; symlink "$ENV{SOURCEPATH}/include", 'include'; + mkdir $_ for qw/bin modules obj/; +# BSD make has a horribly annoying bug resulting in an extra chdir of the make process +# Create symlinks to work around it + symlink "../$_", "obj/$_" for qw/bin modules obj/; + $build = getcwd(); open MAKE, '>real.mk' or die "Could not write real.mk: $!"; chdir "$ENV{SOURCEPATH}/src"; @@ -73,7 +75,7 @@ END print MAKE < + \$(RUNCC) -o \$\@ \$(CORELDFLAGS) \$(LDLIBS) \$^ \$> inspircd: bin/inspircd modules: $mods @@ -154,7 +156,7 @@ sub dep_dir($) { closedir DIR; if (@ofiles) { my $ofiles = join ' ', @ofiles; - print MAKE "$dir.so: $ofiles\n\tcd \$(BUILDPATH); \$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^ \$>\n"; + print MAKE "$dir.so: $ofiles\n\t\$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^ \$>\n"; return 1; } else { return 0;