Bug 83: fixes for building when $srcdir != $builddir from David Lee
authorTim Potter <tpot@samba.org>
Fri, 23 May 2003 01:59:43 +0000 (01:59 +0000)
committerTim Potter <tpot@samba.org>
Fri, 23 May 2003 01:59:43 +0000 (01:59 +0000)
<t.d.lee@durham.ac.uk>
(This used to be commit e48a8b5e9c1a75c6e4bffe022d0e25edae89bc58)

source3/Makefile.in
source3/configure.in
source3/nsswitch/winbindd.h
source3/script/mkproto.sh.in [moved from source3/script/mkproto.sh with 73% similarity]

index b957d7594b0b575a534195cedfb78c38e9eaad29..28b99c6f62b597c1e9bcd717b445872c31986b58 100644 (file)
@@ -318,6 +318,8 @@ MANGLE_OBJ = smbd/mangle.o smbd/mangle_hash.o smbd/mangle_map.o smbd/mangle_hash
 
 SMBD_OBJ_MAIN = smbd/server.o
 
+BUILDOPT_OBJ = smbd/build_options.o
+
 SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
               smbd/utmp.o smbd/session.o \
                smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o \
@@ -330,19 +332,19 @@ SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
                smbd/posix_acls.o lib/sysacls.o lib/server_mutex.o \
               smbd/process.o smbd/service.o smbd/error.o \
               printing/printfsp.o lib/util_seaccess.o \
-               smbd/build_options.o lib/sysquotas.o \
-              smbd/change_trust_pw.o smbd/fake_file.o \
+               lib/sysquotas.o smbd/change_trust_pw.o smbd/fake_file.o \
               smbd/quotas.o smbd/ntquotas.o \
               $(MANGLE_OBJ) @VFS_STATIC@
 
 SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(MSDFS_OBJ) $(LIBSMB_OBJ) \
-               $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) $(UBIQX_OBJ) \
+               $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) \
                $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) \
                $(LIB_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) \
                $(NOTIFY_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \
                $(LIBMSRPC_OBJ) $(LIBMSRPC_SERVER_OBJ) \
                $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
-               $(LIB_SMBD_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) $(IDMAP_OBJ)
+               $(LIB_SMBD_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) $(IDMAP_OBJ) \
+               $(UBIQX_OBJ) $(BUILDOPT_OBJ)
 
 PRINTING_OBJ = printing/pcap.o printing/print_svid.o \
                                printing/print_cups.o printing/print_generic.o \
@@ -701,7 +703,7 @@ smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/bui
 
 smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk
        @echo Generating $@
-       @$(AWK) -f $(srcdir)/script/mkbuildoptions.awk > $(builddir)/smbd/build_options.c < $(srcdir)/include/config.h.in
+       @dir=smbd $(MAKEDIR) && $(AWK) -f $(srcdir)/script/mkbuildoptions.awk > $(builddir)/smbd/build_options.c < $(srcdir)/include/config.h.in
 
 .c.po: 
        @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
@@ -1246,42 +1248,47 @@ delheaders:
        @/bin/rm -f include/proto.h include/build_env.h include/wrepld_proto.h \
                    nsswitch/winbindd_proto.h web/swat_proto.h \
                    client/client_proto.h utils/net_proto.h smbd/build_options.c
+# Location of mkproto.sh
+
+MKPROTO_SH = $(builddir)/script/mkproto.sh
 
 include/proto.h: smbd/build_options.c
        @echo Building include/proto.h
-       @cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
+       @$(SHELL) $(MKPROTO_SH) $(AWK) \
          -h _PROTO_H_ $(builddir)/include/proto.h \
-         $(PROTO_OBJ)
+         $(builddir)/smbd/build_options.o \
+         `echo $(PROTO_OBJ) | sed -e 's%\([^ \t]*\)%$(srcdir)/\1%g'`
 
 include/build_env.h: script/build_env.sh
        @echo Building include/build_env.h
-       @cd $(srcdir) && $(SHELL) script/build_env.sh $(srcdir) $(builddir) $(CC) > $(builddir)/include/build_env.h
+       @$(SHELL) $(srcdir)/script/build_env.sh $(srcdir) $(builddir) $(CC) \
+         > $(builddir)/include/build_env.h
 
 include/wrepld_proto.h:
        @echo Building include/wrepld_proto.h
-       @cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
+       @$(SHELL) $(MKPROTO_SH) $(AWK) \
          -h _WREPLD_PROTO_H_ $(builddir)/include/wrepld_proto.h \
-         $(WREPL_OBJ1)
+         `echo $(WREPL_OBJ1) | sed -e 's%\([^ \t]*\)%$(srcdir)/\1%g'`
 
 nsswitch/winbindd_proto.h: 
-       @cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
+       @$(SHELL) $(MKPROTO_SH) $(AWK) \
          -h _WINBINDD_PROTO_H_ nsswitch/winbindd_proto.h \
-         $(WINBINDD_OBJ1)
+         `echo $(WINBINDD_OBJ1) | sed -e 's%\([^ \t]*\)%$(srcdir)/\1%g'`
 
 web/swat_proto.h: 
-       @cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
+       @$(SHELL) $(MKPROTO_SH) $(AWK) \
          -h _SWAT_PROTO_H_ web/swat_proto.h \
-         $(SWAT_OBJ1)
+         `echo $(SWAT_OBJ1) | sed -e 's%\([^ \t]*\)%$(srcdir)/\1%g'`
 
 client/client_proto.h: 
-       @cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
+       @$(SHELL) $(MKPROTO_SH) $(AWK) \
          -h _CLIENT_PROTO_H_ client/client_proto.h \
-         $(CLIENT_OBJ1)
+         `echo $(CLIENT_OBJ1) | sed -e 's%\([^ \t]*\)%$(srcdir)/\1%g'`
 
 utils/net_proto.h: 
-       @cd $(srcdir) && $(SHELL) script/mkproto.sh $(AWK) \
+       @$(SHELL) $(MKPROTO_SH) $(AWK) \
          -h _CLIENT_PROTO_H_ utils/net_proto.h \
-         $(NET_OBJ1)
+         `echo $(NET_OBJ1) | sed -e 's%\([^ \t]*\)%$(srcdir)/\1%g'`
 
 # "make headers" or "make proto" calls a subshell because we need to
 # make sure these commands are executed in sequence even for a
index ebe0d44192bf1b61cf8773b66dea0a89a9919d2d..ccc7148c6eec43518fb136aff854d056f785a273 100644 (file)
@@ -3797,7 +3797,7 @@ dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
 CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
 CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
 
-AC_OUTPUT(include/stamp-h Makefile script/findsmb)
+AC_OUTPUT(include/stamp-h Makefile script/findsmb script/mkproto.sh)
 
 #################################################
 # Print very concise instructions on building/use
index 2d9a0b59499d61b479783529ff84a6c00426ac82..987a58e502fc868aa8d98be0cc80a1f1ff311cbf 100644 (file)
@@ -219,7 +219,7 @@ struct winbindd_idmap_methods {
   void (*status)(void);
 };
 
-#include "winbindd_proto.h"
+#include "../nsswitch/winbindd_proto.h"
 
 #include "rpc_parse.h"
 #include "rpc_client.h"
similarity index 73%
rename from source3/script/mkproto.sh
rename to source3/script/mkproto.sh.in
index 2bf96c9b41de714e761b13851a6e15aa09f03263..8d7d300ff5df20c54c4f3ebafebf9a8d50dc80ff 100755 (executable)
@@ -1,9 +1,13 @@
-#! /bin/sh
+#! /bin/sh -x
 
 LANG=C; export LANG
 LC_ALL=C; export LC_ALL
 LC_COLLATE=C; export LC_COLLATE
 
+# Need reference point for "mkproto.awk", including when "srcdir != builddir".
+# Use of "abs_..." is unpleasant.  Is there another way?
+abs_srcdir=@abs_srcdir@
+
 if [ $# -lt 3 ]
 then
   echo "Usage: $0 awk [-h headerdefine] outputheader proto_obj"
@@ -32,7 +36,7 @@ echo creating $header
 mkdir -p `dirname $header`
 
 ${awk} $headeropt \
-  -f script/mkproto.awk $proto_src > $headertmp
+  -f $abs_srcdir/mkproto.awk $proto_src > $headertmp
 
 if cmp -s $header $headertmp 2>/dev/null
 then