aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2016-01-29 13:29:45 -0500
committerRich Salz <rsalz@openssl.org>2016-01-29 16:56:07 -0500
commitced2c2c598e195175950a67756d426052d38c228 (patch)
tree96426030f0ca1099c33d147e67b619bb73a77f6a /util
parent56087077d81e2b888f4cbe7f70b2077dc5add90d (diff)
downloadopenssl-ced2c2c598e195175950a67756d426052d38c228.tar.gz
Templatize util/domd
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/domd34
-rwxr-xr-xutil/domd.in25
-rwxr-xr-xutil/mk1mf.pl2
3 files changed, 26 insertions, 35 deletions
diff --git a/util/domd b/util/domd
deleted file mode 100755
index 9dd7ce59ba..0000000000
--- a/util/domd
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-# Wrapper to portably run makedepend or equivalent compiler built-in.
-# Runs on Makefile.in, generates Makefile
-
-TOP=$1
-shift
-if [ "$1" = "-MD" ]; then
- shift
- MAKEDEPEND=$1
- shift
- if [ "$MAKEDEPEND" = "ccache" ]; then
- MAKEDEPEND="$MAKEDEPEND $1"
- shift
- fi
-fi
-if [ -z "$MAKEDEPEND" ] ; then
- MAKEDEPEND=makedepend
-fi
-
-if ${MAKEDEPEND} --version 2>&1 | egrep "clang|gcc" >/dev/null ; then
- args=""
- while [ $# -gt 0 ]; do
- if [ "$1" != '--' ] ; then
- args="$args $1"
- fi
- shift
- done
- ${MAKEDEPEND} -Werror -DOPENSSL_DOING_MAKEDEPEND -M $args >Makefile.tmp || exit 1
- cat Makefile.in Makefile.tmp >Makefile
- rm Makefile.tmp
-else
- cp Makefile.in Makefile
- ${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1
-fi
diff --git a/util/domd.in b/util/domd.in
new file mode 100755
index 0000000000..ede2733754
--- /dev/null
+++ b/util/domd.in
@@ -0,0 +1,25 @@
+#!/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
+makedepend)
+ cp Makefile.in Makefile
+ ${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1
+ ;;
+*)
+ args="-Werror -M"
+ while [ $# -gt 0 ]; do
+ if [ "$1" != '--' ] ; then
+ args="$args $1"
+ fi
+ shift
+ done
+ ${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $args >Makefile.tmp || exit 1
+ cat Makefile.in Makefile.tmp >Makefile
+ rm Makefile.tmp
+ ;;
+esac
diff --git a/util/mk1mf.pl b/util/mk1mf.pl
index 98e44b05ce..f9eeea8e65 100755
--- a/util/mk1mf.pl
+++ b/util/mk1mf.pl
@@ -50,7 +50,7 @@ my %mf_import = (
PLATFORM => \$mf_platform,
CC => \$mf_cc,
CFLAG => \$mf_cflag,
- DEPFLAG => \$mf_depflag,
+ DEPFLAG => \$mf_depflag,
CPUID_OBJ => \$mf_cpuid_asm,
BN_ASM => \$mf_bn_asm,
DES_ENC => \$mf_des_asm,