Fix make import with compat sources.

Use -lmd for MD5 if available.
This commit is contained in:
Roy Marples 2014-02-03 13:09:13 +00:00
parent 2d468029e1
commit 90ada440ec
2 changed files with 12 additions and 4 deletions

View File

@ -161,7 +161,9 @@ import: ${SRCS}
sort -u) /tmp/${DISTPREFIX}; \ sort -u) /tmp/${DISTPREFIX}; \
if test -n "${CRYPT_SRCS}"; then \ if test -n "${CRYPT_SRCS}"; then \
${INSTALL} -d /tmp/${DISTPREFIX}/crypt; \ ${INSTALL} -d /tmp/${DISTPREFIX}/crypt; \
cp crypt/${CRYPT_SRCS} /tmp/${DISTPREFIX}/crypt; \ cp $$(echo ${CRYPT_SRCS} | tr ' ' '\n' | \
sed -e 's:^:crypt/:g') \
/tmp/${DISTPREFIX}/crypt; \
cp $$(cd crypt && ${CC} ${CPPFLAGS} -MM ${CRYPT_SRCS} | \ cp $$(cd crypt && ${CC} ${CPPFLAGS} -MM ${CRYPT_SRCS} | \
sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \ sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
tr ' ' '\n' | sed -e 's:^:crypt/:g' | \ tr ' ' '\n' | sed -e 's:^:crypt/:g' | \
@ -169,10 +171,10 @@ import: ${SRCS}
fi; fi;
if test -n "${COMPAT_SRCS}"; then \ if test -n "${COMPAT_SRCS}"; then \
${INSTALL} -d /tmp/${DISTPREFIX}/compat; \ ${INSTALL} -d /tmp/${DISTPREFIX}/compat; \
cp compat/${COMPAT_SRCS} /tmp/${DISTPREFIX}/compat; \ cp ${COMPAT_SRCS} /tmp/${DISTPREFIX}/compat; \
cp $$(cd compat && ${CC} ${CPPFLAGS} -MM ${COMPAT_SRCS} | \ cp $$(${CC} ${CPPFLAGS} -MM ${COMPAT_SRCS} | \
sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \ sed -e 's/^.*c //g' -e 's/.*\.c$$//g' -e 's/\\//g' | \
tr ' ' '\n' | sed -e 's:^:compat/:g' | \ tr ' ' '\n' | \
sort -u) /tmp/${DISTPREFIX}/compat; \ sort -u) /tmp/${DISTPREFIX}/compat; \
fi; fi;
if test -n "${IMPORT_RCSID}"; then \ if test -n "${IMPORT_RCSID}"; then \

6
configure vendored
View File

@ -626,8 +626,10 @@ pselect)
esac esac
if [ -z "$MD5" ]; then if [ -z "$MD5" ]; then
MD5_LIB=
printf "Testing for MD5Init ... " printf "Testing for MD5Init ... "
cat <<EOF >_md5.c cat <<EOF >_md5.c
#include <sys/types.h>
#include <md5.h> #include <md5.h>
#include <stdlib.h> #include <stdlib.h>
int main(void) { int main(void) {
@ -638,6 +640,9 @@ int main(void) {
EOF EOF
if $XCC _md5.c -o _md5 2>/dev/null; then if $XCC _md5.c -o _md5 2>/dev/null; then
MD5=yes MD5=yes
elif $XCC _md5.c -lmd -o _md5; then
MD5="yes (-lmd)"
MD5_LIB=-lmd
else else
MD5=no MD5=no
fi fi
@ -649,6 +654,7 @@ if [ "$MD5" = no ]; then
else else
echo "MD5_SRC=" >>$CONFIG_MK echo "MD5_SRC=" >>$CONFIG_MK
echo "CPPFLAGS+= -DHAVE_MD5_H" >>$CONFIG_MK echo "CPPFLAGS+= -DHAVE_MD5_H" >>$CONFIG_MK
[ -n "$MD5_LIB" ] && echo "LDADD+= $MD5_LIB" >>$CONFIG_MK
fi fi
if [ "$DEV" != no -a "$UDEV" != no ]; then if [ "$DEV" != no -a "$UDEV" != no ]; then