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)
Can we have a 'build environment' component for storing makefile/configure/install bugs like this?
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.)
moving to build environment component
I'll take this one.
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?
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.
The applied variant of my patch seemed to break portability, causing "make proto" et al to fail on some OSes.
The build farm Solaris machine says 'Output line too long' for make proto. Stupid crappy vendor tools. )-:
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. )-:
I think we need to move the appending of $(srcdir) into mkproto.sh instead of trying to get it working in the Makefile.
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).
originally reported against 3.0aph24. Bugzilla spring cleaning. Removing old alpha versions.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.