openssl/util/domd.in
Rich Salz f1f07a2367 Better check for gcc/clang
Iteratively improved with Richard and Andy.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-01 09:42:10 -05:00

26 lines
660 B
Bash
Executable file

#!/bin/sh
## Wrapper to portably run makedepend or equivalent compiler built-in.
## Runs on Makefile.in, generates Makefile
## {- join("\n## ", @autowarntext) -}
{- "MAKEDEPEND=" . quotify1($config{makedepprog}) -}
case "${MAKEDEPEND}" in
cat)
;;
makedepend)
${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1
;;
*)
args="-Werror -MM"
while [ $# -gt 0 ]; do
if [ "$1" != '--' ] ; then
args="$args $1"
fi
shift
done
sed -e '/DO NOT DELETE THIS LINE/q' Makefile >Makefile.tmp
${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $args >>Makefile.tmp || exit 1
mv Makefile.tmp Makefile
;;
esac