[PATCH 2/2] Remove support for automatically generated prototype
headers.
James Peach
jpeach at samba.org
Tue Jun 5 19:32:56 GMT 2007
as per subject.
---
source/Makefile.in | 57 +--------------
source/script/mkproto.awk | 174
---------------------------------------------
source/script/mkproto.sh | 43 -----------
3 files changed, 4 insertions(+), 270 deletions(-)
delete mode 100644 source/script/mkproto.awk
delete mode 100755 source/script/mkproto.sh
diff --git a/source/Makefile.in b/source/Makefile.in
index f39c568..cf95682 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -1947,69 +1947,20 @@ proto_exists: include/proto.h include/
build_env.h \
delheaders:
@echo Removing prototype headers
- @rm -f include/proto.h include/build_env.h \
- nsswitch/winbindd_proto.h web/swat_proto.h \
- client/client_proto.h utils/net_proto.h \
- smbd/build_options.c utils/ntlm_auth_proto.h \
- utils/passwd_proto.h
-
-MKPROTO_SH = $(srcdir)/script/mkproto.sh
-
-include/proto.h: smbd/build_options.c
- @echo Building include/proto.h
- @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
- -h _PROTO_H_ $(builddir)/include/proto.h \
- $(PROTO_OBJ)
+ @rm -f include/build_env.h smbd/build_options.c
include/build_env.h: script/build_env.sh
@echo Building include/build_env.h
@$(SHELL) $(srcdir)/script/build_env.sh $(srcdir) $(builddir) $(CC) \
> $(builddir)/include/build_env.h
-nsswitch/winbindd_proto.h:
- @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
- -h _WINBINDD_PROTO_H_ $(builddir)/nsswitch/winbindd_proto.h \
- $(WINBINDD_OBJ1)
-
-web/swat_proto.h:
- @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
- -h _SWAT_PROTO_H_ $(builddir)/web/swat_proto.h \
- $(SWAT_OBJ1)
-
-client/client_proto.h:
- @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
- -h _CLIENT_PROTO_H_ $(builddir)/client/client_proto.h \
- $(CLIENT_OBJ1)
-
-utils/net_proto.h:
- @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
- -h _NET_PROTO_H_ $(builddir)/utils/net_proto.h \
- $(NET_OBJ1)
-
-utils/passwd_proto.h:
- @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
- -h _PASSWD_PROTO_H_ $(builddir)/utils/passwd_proto.h \
- $(PASSWD_UTIL_OBJ)
-
-utils/ntlm_auth_proto.h:
- @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
- -h _NTLM_AUTH_PROTO_H_ $(builddir)/utils/ntlm_auth_proto.h \
- $(NTLM_AUTH_OBJ1)
-
# "make headers" or "make proto" calls a subshell because we need to
# make sure these commands are executed in sequence even for a
# parallel make.
headers:
- $(MAKE) delheaders; \
- $(MAKE) smbd/build_options.c; \
- $(MAKE) include/proto.h; \
- $(MAKE) include/build_env.h; \
- $(MAKE) nsswitch/winbindd_proto.h; \
- $(MAKE) web/swat_proto.h; \
- $(MAKE) client/client_proto.h; \
- $(MAKE) utils/ntlm_auth_proto.h; \
- $(MAKE) utils/net_proto.h; \
- $(MAKE) utils/passwd_proto.h;
+ $(MAKE) delheaders
+ $(MAKE) smbd/build_options.c
+ $(MAKE) include/build_env.h
proto: headers
diff --git a/source/script/mkproto.awk b/source/script/mkproto.awk
deleted file mode 100644
index 65a10c8..0000000
--- a/source/script/mkproto.awk
+++ /dev/null
@@ -1,174 +0,0 @@
-BEGIN {
- inheader=0;
-# use_ldap_define = 0;
- current_file="";
- if (headername=="") {
- headername="_PROTO_H_";
- }
-
- print "#ifndef",headername
- print "#define",headername
- print ""
- print "/* This file is automatically generated with \"make proto
\". DO NOT EDIT */"
- print ""
-}
-
-END {
- print ""
- print "#endif /* ",headername," */"
-}
-
-{
- if (FILENAME!=current_file) {
-# if (use_ldap_define)
-# {
-# print "#endif /* USE_LDAP */"
-# use_ldap_define = 0;
-# }
- print ""
- print "/* The following definitions come from",FILENAME," */"
- print ""
- current_file=FILENAME
- }
- if (inheader) {
- if (match($0,"[)][ \t]*$")) {
- inheader = 0;
- printf "%s;\n",$0;
- } else {
- printf "%s\n",$0;
- }
- next;
- }
-}
-
-# we handle the loadparm.c fns separately
-
-/^FN_LOCAL_BOOL/ {
- split($0,a,"[,()]")
- printf "BOOL %s(int );\n", a[2]
-}
-
-/^FN_LOCAL_PARM_BOOL/ {
- split($0,a,"[,()]")
- printf "BOOL %s(const struct share_params *p );\n", a[2]
-}
-
-/^FN_LOCAL_PARM_INTEGER/ {
- split($0,a,"[,()]")
- printf "int %s(const struct share_params *p );\n", a[2]
-}
-
-/^FN_LOCAL_LIST/ {
- split($0,a,"[,()]")
- printf "const char **%s(int );\n", a[2]
-}
-
-/^FN_LOCAL_STRING/ {
- split($0,a,"[,()]")
- printf "char *%s(int );\n", a[2]
-}
-
-/^FN_LOCAL_PARM_STRING/ {
- split($0,a,"[,()]")
- printf "char *%s(const struct share_params *p );\n", a[2]
-}
-
-/^FN_LOCAL_CONST_STRING/ {
- split($0,a,"[,()]")
- printf "const char *%s(int );\n", a[2]
-}
-
-/^FN_LOCAL_INT/ {
- split($0,a,"[,()]")
- printf "int %s(int );\n", a[2]
-}
-
-/^FN_LOCAL_CHAR/ {
- split($0,a,"[,()]")
- printf "char %s(const struct share_params *p );\n", a[2]
-}
-
-/^FN_GLOBAL_BOOL/ {
- split($0,a,"[,()]")
- printf "BOOL %s(void);\n", a[2]
-}
-
-/^FN_GLOBAL_LIST/ {
- split($0,a,"[,()]")
- printf "const char **%s(void);\n", a[2]
-}
-
-/^FN_GLOBAL_STRING/ {
- split($0,a,"[,()]")
- printf "char *%s(void);\n", a[2]
-}
-
-/^FN_GLOBAL_CONST_STRING/ {
- split($0,a,"[,()]")
- printf "const char *%s(void);\n", a[2]
-}
-
-/^FN_GLOBAL_INT/ {
- split($0,a,"[,()]")
- printf "int %s(void);\n", a[2]
-}
-
-/^static|^extern/ || !/^[a-zA-Z]/ || /[;]/ {
- next;
-}
-
-#
-# We have to split up the start
-# matching as we now have so many start
-# types that it can cause some versions
-# of nawk/awk to choke and fail on
-# the full match. JRA.
-#
-
-{
- gotstart = 0;
- if( $0 ~ /^const|^connection_struct|^pipes_struct|^smb_np_struct|
^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|
^unsigned|^mode_t|^DIR|^user|^int|^pid_t|^ino_t|^off_t|^double/ ) {
- gotstart = 1;
- }
-
- if( $0 ~ /^vuser_key|^UNISTR2|^LOCAL_GRP|^DOMAIN_GRP|
^SMB_STRUCT_DIRENT|^SEC_ACL|^SEC_DESC|^SEC_DESC_BUF|^DOM_SID|
^RPC_HND_NODE|^BYTE/ ) {
- gotstart = 1;
- }
-
- if( $0 ~ /^ADS_STRUCT|^ADS_STATUS|^DATA_BLOB|^ASN1_DATA|
^TDB_CONTEXT|^TDB_DATA|^smb_ucs2_t|^TALLOC_CTX|^hash_element|
^NT_DEVICEMODE|^enum.*\(|^NT_USER_TOKEN|^SAM_ACCOUNT|^NTTIME/ ) {
- gotstart = 1;
- }
-
- if( $0 ~ /^smb_iconv_t|^long|^char|^uint|^NTSTATUS|^WERROR|
^CLI_POLICY_HND|^struct|^BOOL|^void|^time|^smb_shm_offset_t|
^shm_offset_t|^FILE|^XFILE|^SMB_OFF_T|^size_t|^ssize_t|^SMB_BIG_UINT|
^SMB_BIG_INT/ ) {
- gotstart = 1;
- }
-
- if( $0 ~ /^SAM_ACCT_INFO_NODE|^SMB_ACL_T|^ADS_MODLIST|^PyObject|
^SORTED_TREE|^REGISTRY_HOOK|^REGISTRY_VALUE|^REGVAL_CTR|^DEVICEMODE|
^PAC_DATA|^NET_USER_INFO_3|^smb_event_id_t/ ) {
- gotstart = 1;
- }
-
- if( $0 ~ /^WINBINDD_PW|^WINBINDD_GR|^NT_PRINTER_INFO_LEVEL_2|
^LOGIN_CACHE|^krb5_error_code|^LDAP|^u32|^LUID_ATTR|^NSS_STATUS/ ) {
- gotstart = 1;
- }
-
- if( $0 ~ /^NODE_STATUS_STRUCT|SMB_STRUCT_DIR|ELOG_TDB|
codepoint_t/ ) {
- gotstart = 1;
- }
-
- if(!gotstart) {
- next;
- }
-}
-
-
-/[(].*[)][ \t]*$/ {
- printf "%s;\n",$0;
- next;
-}
-
-/[(]/ {
- inheader=1;
- printf "%s\n",$0;
- next;
-}
-
diff --git a/source/script/mkproto.sh b/source/script/mkproto.sh
deleted file mode 100755
index e46e73e..0000000
--- a/source/script/mkproto.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#! /bin/sh
-
-LANG=C; export LANG
-LC_ALL=C; export LC_ALL
-LC_COLLATE=C; export LC_COLLATE
-
-if [ $# -lt 3 ]
-then
- echo "Usage: $0 awk [-h headerdefine] outputheader proto_obj"
- exit 1
-fi
-
-awk="$1"
-shift
-
-if [ x"$1" = x-h ]
-then
- headeropt="-v headername=$2"
- shift; shift;
-else
- headeropt=""
-fi
-
-header="$1"
-shift
-headertmp="$header.$$.tmp~"
-
-proto_src="`echo $@ | tr ' ' '\n' | sed -e 's/\.o/\.c/g' | sort |
uniq | egrep -v 'tdb/|wrapped|modules/getdate'`"
-
-echo creating $header
-
-mkdir -p `dirname $header`
-
-${awk} $headeropt \
- -f script/mkproto.awk $proto_src > $headertmp
-
-if cmp -s $header $headertmp 2>/dev/null
-then
- echo "$header unchanged"
- rm $headertmp
-else
- mv $headertmp $header
-fi
--
1.5.2.1
--
James Peach | jpeach at samba.org
More information about the samba-technical
mailing list