1 # $NetBSD: bsd.pkg.debug.mk,v 1.21 2008/02/07 21:36:13 rillig Exp $
6 # outputs the values of some commonly used variables and the
7 # contents of some files which are useful for tracking bugs,
8 # especially for packages that use the GNU autotools.
13 # Note: In the many cases where ${x} is used, the quoting is left out
14 # intentionally, since x is an element of a list of shell words, and
15 # passing such a shell word to the shell should still result in one
16 # word. That way, no extra level of quoting is introduced.
18 # The only exception is the "<" character in CONFIGURE_ARGS, where it
19 # is often used to redirect the input coming from another source. That
20 # character has to be quoted.
24 _show-dbginfo-file-versions \
26 _show-dbginfo-configure \
27 _show-dbginfo-config.status \
28 _show-dbginfo-config.h \
30 _show-dbginfo-install \
31 _show-dbginfo-plist-subst
34 _show-dbginfo-file-versions \
36 _show-dbginfo-configure \
37 _show-dbginfo-config.status \
38 _show-dbginfo-config.h \
40 _show-dbginfo-install \
41 _show-dbginfo-plist-subst
43 _show-dbginfo-file-versions:
44 @${PRINTF} "File versions:\\n"
46 sedexpr='s,^.*\([$$]NetBSD:[^$$]*\$$\).*,\1,p'; \
47 ${FIND} * -type f -print \
48 | while read fname; do \
50 -e 's,^.*\\([$$]NetBSD:[^$$]*\\$$\\).*,\\1,p' \
51 -e 's,^.*\\([$$]Id:[^$$]*\\$$\\).*,\\1,p' \
52 "$${fname}" | ${SED} 1q` || continue; \
54 *?*) ${PRINTF} "\\t%s: %s\\n" "$${fname}" "$${ident}";; \
60 @${PRINTF} "TOOLS:\\n"
61 @${USE_TOOLS:C/:.*//:O:u:@t@${_TOOLS_VARNAME.${t}:D${PRINTF} "\\t%s=%s\\n" ${_TOOLS_VARNAME.${t}} ${${_TOOLS_VARNAME.${t}}:Q};}@}
64 _show-dbginfo-configure:
65 @${PRINTF} "CONFIGURE_DIRS:\\n"; ${CONFIGURE_DIRS:@x@${PRINTF} "\\t%s\\n" ${x};@}
67 @${PRINTF} "CONFIGURE_ENV (sorted alphabetically):\\n"; ${CONFIGURE_ENV:O:@x@${PRINTF} "\\t%s\\n" ${x};@}
69 @${PRINTF} "CONFIGURE_SCRIPT:\\n\\t%s\\n" ${CONFIGURE_SCRIPT}
71 @${PRINTF} "CONFIGURE_ARGS:\\n"; ${CONFIGURE_ARGS:@x@${PRINTF} "\\t%s\\n" ${x:S,<,\<,};@}
74 _show-dbginfo-config.status:
75 .if !empty(CONFIGURE_DIRS:M*)
77 if ${TEST} -d ${WRKSRC:Q}; then cd ${WRKSRC:Q}; \
78 for cs in ${CONFIGURE_DIRS:=/config.status}; do \
79 if ${TEST} ! -f "$${cs}"; then continue; fi; \
80 ${PRINTF} "%s:\\n" "$${cs}"; \
81 ${SED} -n -e 's,|#_!!_#|,,g' \
82 -e '/s,^\\(\[ #\]\*\\)/d' \
83 -e 's:^s,@\([^@]*\)@,\(.*\),;t t$$: \1=\2:p' \
84 -e 's:^s&@\([^@]*\)@&\(.*\)&;t t$$: \1=\2:p' \
85 -e 's:^s,@\([^@]*\)@,\(.*\),g$$: \1=\2:p' \
86 -e 's:^s%@\([^@]*\)@%\(.*\)%g$$: \1=\2:p' \
87 -e 's:^s&@\([^@]*\)@&\(.*\)&g$$: \1=\2:p' \
88 -e 's:^\(s[^[:alnum:]].*\): &:p' \
98 _show-dbginfo-config.h:
99 .if !empty(CONFIGURE_DIRS:M*)
101 [ -d ${WRKSRC} ] || exit 0; \
103 printf "%s:\\n" "`pwd`/$$1"; \
104 awk '/^#define / { print "\t"$$0; } /^\/\* #undef / { print "\t" $$2 " " $$3; }' < "$$1"; \
107 for cdir in ${CONFIGURE_DIRS}; do \
108 cd ${WRKSRC}; [ -d "$$cdir" ] || continue; cd "$$cdir"; \
109 [ ! -f config.h ] || { print_config_h config.h; continue; }; \
110 [ ! -f config.status ] || { \
112 chs=`sed -n 's,^config_headers="\([^:]*\).*".*,\1,p' config.status || true`; \
114 [ "$$chs" ] || chs=`sed -n 's,^ CONFIG_HEADERS="\([^:"]*\).*,\1,p' config.status || true`; \
116 for ch in $$chs; do print_config_h "$$ch"; done=yes; done; \
117 [ $$done = no ] || continue; \
119 printf "WARNING: No config header found in `pwd`.\\n\\n"; \
126 @${PRINTF} "PKGSRC_MAKE_ENV (sorted alphabetically):\\n"; ${PKGSRC_MAKE_ENV:O:@x@${PRINTF} "\\t%s\\n" ${x};@}
128 @${PRINTF} "BUILD_DIRS:\\n"; ${BUILD_DIRS:@x@${PRINTF} "\\t%s\\n" ${x};@}
130 @${PRINTF} "MAKE_ENV (sorted alphabetically):\\n"; ${MAKE_ENV:O:@x@${PRINTF} "\\t%s\\n" ${x};@}
132 @${PRINTF} "MAKE_PROGRAM:\\n\\t%s\\n" ${MAKE_PROGRAM:Q}
134 @${PRINTF} "MAKE_FLAGS:\\n"; ${MAKE_FLAGS:@x@${PRINTF} "\\t%s\\n" ${x};@}
136 @${PRINTF} "BUILD_MAKE_FLAGS:\\n"; ${BUILD_MAKE_FLAGS:@x@${PRINTF} "\\t%s\\n" ${x};@}
139 _show-dbginfo-install:
140 @${PRINTF} "INSTALL_DIRS:\\n"; ${INSTALL_DIRS:@x@${PRINTF} "\\t%s\\n" ${x};@}
142 @${PRINTF} "INSTALL_MAKE_FLAGS:\\n"; ${INSTALL_MAKE_FLAGS:@x@${PRINTF} "\\t%s\\n" ${x};@}
145 _show-dbginfo-plist-subst:
146 @${PRINTF} "PLIST_SUBST (sorted alphabetically):\\n"; ${PLIST_SUBST:O:@x@${PRINTF} "\\t%s\\n" ${x};@}