Bug 83 - "make" fails early in non-source-directory builds
Summary: "make" fails early in non-source-directory builds
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.0preX
Hardware: Other other
: P2 major
Target Milestone: none
Assignee: Tim Potter
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-15 02:29 UTC by David Lee
Modified: 2005-08-24 10:22 UTC (History)
0 users

See Also:


Attachments
Makefile.in : applied patch was non-portable. (1.78 KB, patch)
2003-05-23 07:16 UTC, David Lee
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Lee 2003-05-15 02:29:32 UTC
When the build directory is not the source directory,
"make" falls at the first hurdle:
   ./smbd/build_options.c: cannote create

because the directory "smbd" does not yet exist.

Reproduce:
  cd source
  mkdir mybuilddir_1
  cd mybuilddir_1
  ../configure
  make

Fix:  In "Makefile.in" insert line in target "smbd/build_options.c:"
   @dir=smbd $(MAKEDIR)
Comment 1 Tim Potter 2003-05-18 20:48:04 UTC
Can we have a 'build environment' component for storing
makefile/configure/install bugs like this?
Comment 2 David Lee 2003-05-19 02:07:24 UTC
Fixing this bug then quickly exposes further problems
for non-srcdir builds.

There has been discussion of this, and a proposed patch,
in the samba-technical thread:
   3.0alpha24: make bug (or more...)

That subsequent proposed patch in fact tidies up a somewhat
unclean interface to "script/mkproto.sh" and enhances
functionality.  (In a sense, the fixing of the subsequent
bug can be regarded as a mere side-effect to this improvement.)
Comment 3 Gerald (Jerry) Carter (dead mail address) 2003-05-22 07:01:11 UTC
moving to build environment component
Comment 4 Tim Potter 2003-05-22 16:41:18 UTC
I'll take this one.
Comment 5 Tim Potter 2003-05-22 19:00:20 UTC
I've checked your changes in and everything seems to work OK.

I simplified the sed script in the Makefile.in file a bit which I think makes it
clearer.

Also created bug 112 which addresses the issue of autogen.sh creating files in
$srcdir instead of $builddir.

David, can you retest and mark as verified if the problem is fixed?
Comment 6 David Lee 2003-05-23 07:16:40 UTC
Created attachment 15 [details]
Makefile.in :  applied patch was non-portable.

The adjustments made to the checked-in version of my original patch seem OK
on Linux (and others?) but not on Solaris (and others?).  That is, those
sunsequent adjustments seems non-portable.  Different "sed%...%...%g" seems
to do different things.

The attached patch seems to work on both Linux and Solaris, as it separates
out the listing of the filenames (into one per line) from the "sed" upon each.
Comment 7 David Lee 2003-05-23 07:19:15 UTC
The applied variant of my patch seemed to break portability,
causing "make proto" et al to fail on some OSes.
Comment 8 Tim Potter 2003-05-23 17:18:37 UTC
The build farm Solaris machine says 'Output line too long' for make proto.

Stupid crappy vendor tools.  )-:
Comment 9 Tim Potter 2003-05-23 18:59:01 UTC
OK we can use awk instead of sed which should solve the portability problem with
using '%' instead of '/'.

include/proto.h: smbd/build_options.c
        @echo Building include/proto.h
        @$(SHELL) $(MKPROTO_SH) $(AWK) \
          -h _PROTO_H_ $(builddir)/include/proto.h \
          $(builddir)/smbd/build_options.o \
          `echo $(PROTO_OBJ) | tr ' ' '\n' | \
          $(AWK) '{ printf("$(srcdir)/%s", $$0); }'`

However, the command line is now too long.  )-:
Comment 10 Tim Potter 2003-05-23 19:18:39 UTC
I think we need to move the appending of $(srcdir) into mkproto.sh instead
of trying to get it working in the Makefile.
Comment 11 Tim Potter 2003-05-26 23:26:37 UTC
I think my latest patches have fixed this bug.  The compile farm solaris
machines are broken, but not because of proto related problems.

Marking as fixed (again).
Comment 12 Gerald (Jerry) Carter (dead mail address) 2005-02-07 07:57:19 UTC
originally reported against 3.0aph24.  Bugzilla spring cleaning.  
Removing old alpha versions.
Comment 13 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:22:40 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.