[oe-commits] Koen Kooi : gcc-cross: fix gfortran -> g77 linking logic

git version control git at git.openembedded.org
Wed Mar 31 09:01:49 UTC 2010


Module: openembedded.git
Branch: shr/unstable
Commit: cdff13c73dbf704a7c1904f4c245aa3ac4ff4932
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=cdff13c73dbf704a7c1904f4c245aa3ac4ff4932

Author: Koen Kooi <koen at openembedded.org>
Date:   Mon Mar 29 19:36:57 2010 +0200

gcc-cross: fix gfortran -> g77 linking logic

Acked-by: Tom Rini <tom_rini at mentor.com>
Signed-off-by: Koen Kooi <koen at openembedded.org>

---

 recipes/gcc/gcc-configure-cross.inc |   13 +++++++++++++
 recipes/gcc/gcc-package-cross.inc   |   14 ++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/recipes/gcc/gcc-configure-cross.inc b/recipes/gcc/gcc-configure-cross.inc
index 1c37de8..7dde9de 100644
--- a/recipes/gcc/gcc-configure-cross.inc
+++ b/recipes/gcc/gcc-configure-cross.inc
@@ -51,5 +51,18 @@ do_stage_append () {
 		sed -i "s|dependency_libs\s*=\s*.*|dependency_libs='-L${CROSS_DIR}/${TARGET_SYS}/$d ${LIBGCCS_VAR} -lc -lm '|" ${CROSS_DIR}/${TARGET_SYS}/$d/libsupc++.la || true
 		sed -i "s|dependency_libs\s*=\s*.*|dependency_libs='-L${CROSS_DIR}/${TARGET_SYS}/$d ${LIBGCCS_VAR} -lc -lm '|" ${CROSS_DIR}/${TARGET_SYS}/$d/libstdc++.la || true
 	done
+
+    # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
+    # gfortran is fully backwards compatible. This is a safe and practical solution.
+    if [ -f ${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ]; then
+           currdir="$PWD"
+           cd ${CROSS_DIR}/bin/
+           ln -sf ${TARGET_PREFIX}gfortran ${TARGET_PREFIX}g77 || true
+           if [ -d ${CROSS_DIR}/${TARGET_SYS}/bin/ ] ; then 
+               cd ${CROSS_DIR}/${TARGET_SYS}/bin/
+               ln -sf gfortran g77 || true
+           fi
+           cd $currdir
+    fi
 }
 
diff --git a/recipes/gcc/gcc-package-cross.inc b/recipes/gcc/gcc-package-cross.inc
index 6c4f9bb..0f91861 100644
--- a/recipes/gcc/gcc-package-cross.inc
+++ b/recipes/gcc/gcc-package-cross.inc
@@ -63,16 +63,18 @@ do_install () {
                ${TARGET_PREFIX}strip ${D}${target_libdir}/libg2c.so.* || true
                ${TARGET_PREFIX}strip ${D}${target_base_libdir}/libgcc_s.so.* || true
                ${TARGET_PREFIX}strip ${D}${target_libdir}/libgfortran*.so* || true
-	fi
+       fi
      
        # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
        # gfortran is fully backwards compatible. This is a safe and practical solution.
-       if [ -f ${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ]; then
+       if [ -f ${D}${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ]; then
               currdir="$PWD"
-              cd ${CROSS_DIR}/bin/
+              cd ${D}${CROSS_DIR}/bin/
               ln -sf ${TARGET_PREFIX}gfortran ${TARGET_PREFIX}g77 || true
-              cd ${CROSS_DIR}/${TARGET_SYS}/bin/
-              ln -sf gfortran g77 || true
+              if [ -d ${CROSS_DIR}/${TARGET_SYS}/bin/ ] ; then 
+                  cd ${CROSS_DIR}/${TARGET_SYS}/bin/
+                  ln -sf gfortran g77 || true
+              fi
               cd $currdir
-       fi
+        fi
 }





More information about the Openembedded-commits mailing list