#!/bin/sh # # $Id: cppdef,v 1.6 2006/05/15 17:43:13 vogelke Exp $ # # NAME: # cppdef # # SYNOPSIS: # cppdef # # DESCRIPTION: # "cppdef" will find out what strings are defined by cpp. # Does not work with GNU preprocessor. # # AUTHOR: # brandy@tramp.Colorado.EDU (Carl Brandauer) # Comments added by Karl Vogel # Additional error checking and sed hacking by Ken Phelps PATH=/bin:/usr/bin export PATH CPP=/usr/libexec/cpp0 # BSD CPP=/usr/sfw/bin/cpp # Solaris-10 CPP=/usr/lib/cpp # Solaris strings -3 $CPP | sed -n ' /^[a-zA-Z_][a-zA-Z0-9_]*$/{ s/.*/#ifdef &/p s/.* \(.*\)/"\1";/p s/.*/#endif/p } ' | $CPP |sed ' /^[ ]*$/d /^#/d s/.*"\(.*\)".*/\1/' exit 0