summaryrefslogtreecommitdiffstats
path: root/etc/ccdefs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:30:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:30:43 +0000
commitbd4909a899a4663c3f51ea80d3c75db80c0cf30f (patch)
tree9d0d5021c4bd770b385bf1b8bd202d3e898f5b65 /etc/ccdefs
parentInitial commit. (diff)
downloadscreen-bd4909a899a4663c3f51ea80d3c75db80c0cf30f.tar.xz
screen-bd4909a899a4663c3f51ea80d3c75db80c0cf30f.zip
Adding upstream version 4.9.1.upstream/4.9.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'etc/ccdefs')
-rwxr-xr-xetc/ccdefs46
1 files changed, 46 insertions, 0 deletions
diff --git a/etc/ccdefs b/etc/ccdefs
new file mode 100755
index 0000000..2fc98ff
--- /dev/null
+++ b/etc/ccdefs
@@ -0,0 +1,46 @@
+#!/bin/sh
+cd /tmp
+umask 022
+
+CC=cc
+CPP=cpp
+PATH="$PATH:/lib"
+
+TEMP=def$$
+trap 'rm -f ${TEMP}*; trap 0; exit' 0 1 2 3 15
+
+set `type $CC`
+q=$#
+set x `type $CC`
+shift $q
+cc=$1
+
+set `type $CPP`
+q=$#
+set x `type $CPP`
+shift $q
+cpp=$1
+
+strings - "$cc" 2>/dev/null | tr ' ' '\012' > ${TEMP}.x
+
+if test -x "$cpp"; then
+strings - "$cpp" 2>/dev/null | tr ' ' '\012' >> ${TEMP}.x
+else
+echo "Warning: cpp not found."
+fi
+
+sort < ${TEMP}.x | uniq | awk '
+/^-D[A-Za-z_][A-Za-z_0-9]*$/ {
+ printf("#ifdef %s\n", substr($0,3))
+ printf("\"%s\": %s\n", substr($0,3), substr($0,3))
+ print "#endif"
+ }
+/^[A-Za-z_][A-Za-z_0-9]*$/ {
+ printf("#ifdef %s\n", $0)
+ printf("\"%s\": %s\n", $0, $0)
+ print "#endif"
+ }
+' > ${TEMP}.c
+
+echo "Defines in cc are:"
+cc -E ${TEMP}.c | sed -n -e 's/"\([^:]*\)":/\1:/p' | sort | uniq