make depend to work with cross-gcc, compensate for msys glitch.
authorAndy Polyakov <appro@openssl.org>
Fri, 19 Dec 2008 13:35:09 +0000 (13:35 +0000)
committerAndy Polyakov <appro@openssl.org>
Fri, 19 Dec 2008 13:35:09 +0000 (13:35 +0000)
PR: 1753
Submitted by: Alon Bar-Lev

Configure
util/domd
util/mklink.pl

index 6ca7f4350951ad6bdb1b994177c1c25e23309104..97d50bacc4fcd3ca1aa107703c6585b9818d1775 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1432,12 +1432,13 @@ while (<IN>)
                s/^AR=\s*/AR= \$\(CROSS_COMPILE_PREFIX\)/;
                s/^NM=\s*/NM= \$\(CROSS_COMPILE_PREFIX\)/;
                s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE_PREFIX\)/;
+               s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE_PREFIX\)$cc/ if $cc eq "gcc";
                }
        else    {
                s/^CC=.*$/CC= $cc/;
                s/^RANLIB=.*/RANLIB= $ranlib/;
+               s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
                }
-       s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
        s/^CFLAG=.*$/CFLAG= $cflags/;
        s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
        s/^PEX_LIBS=.*$/PEX_LIBS= $prelflags/;
index 1d783cf80377704b2d8da6768b0f83d57c1658b9..27c0211a5a06280be178196750338f98a574e900 100755 (executable)
--- a/util/domd
+++ b/util/domd
@@ -14,7 +14,7 @@ if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
 cp Makefile Makefile.save
 # fake the presence of Kerberos
 touch $TOP/krb5.h
-if [ "$MAKEDEPEND" = "gcc" ]; then
+if expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then
     args=""
     while [ $# -gt 0 ]; do
        if [ "$1" != "--" ]; then args="$args $1"; fi
@@ -22,7 +22,7 @@ if [ "$MAKEDEPEND" = "gcc" ]; then
     done
     sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp
     echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
-    gcc -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit
+    ${MAKEDEPEND} -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit
     ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
     rm -f Makefile.tmp
 else
index d9bc98aab8788cdcca76aecfa3e1a835537df856..61db12c68f3156475f4f44e2dde2e01d8be001ee 100755 (executable)
@@ -51,6 +51,7 @@ my $to = join('/', @to_path);
 
 my $file;
 $symlink_exists=eval {symlink("",""); 1};
+if ($^O eq "msys") { $symlink_exists=0 };
 foreach $file (@files) {
     my $err = "";
     if ($symlink_exists) {