bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong size program used when cross-compiling


From: Dirk Gouders
Subject: Re: Wrong size program used when cross-compiling
Date: Fri, 21 Jan 2005 12:15:04 +0100

 > So provide a fix against the existing Makefile.in and configure.in, or
 > simply describe it.

Here is a patch for Makefile.in and configure.in.

With this patch, a user can specify a size program by setting the
environment variable SIZE.

In case of cross-compilation (and if the SIZE variable is not set),
the name of the size program is prefixed with the tool prefix (same as
with ranlib).  That program is used if it is found in PATH otherwise
size is used.

Dirk

------------------------------------------------------------------------

diff -r -u bash-3.0/Makefile.in bash-3.0.new/Makefile.in
--- bash-3.0/Makefile.in        2004-03-17 14:34:39.000000000 +0100
+++ bash-3.0.new/Makefile.in    2005-01-21 11:09:41.552632829 +0100
@@ -67,6 +67,7 @@
 AR = @AR@
 ARFLAGS = @ARFLAGS@
 RANLIB = @RANLIB@
+SIZE = @SIZE@
 
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -513,7 +514,7 @@
        $(RM) $@
        $(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o 
$(Program) $(OBJECTS) $(LIBS)
        ls -l $(Program)
-       size $(Program)
+       $(SIZE) $(Program)
 
 .build:        $(SOURCES) config.h Makefile version.h $(VERSPROG)
        @echo
@@ -535,7 +536,7 @@
 strip: $(Program) .made
        strip $(Program)
        ls -l $(Program)
-       size $(Program)
+       $(SIZE) $(Program)
 
 lint:
        ${MAKE} ${MFLAGS} CFLAGS='${GCC_LINT_FLAGS}' .made
diff -r -u bash-3.0/configure.in bash-3.0.new/configure.in
--- bash-3.0/configure.in       2004-07-21 22:06:54.000000000 +0200
+++ bash-3.0.new/configure.in   2005-01-21 11:10:30.548437803 +0100
@@ -1014,6 +1014,27 @@
 #AC_SUBST(ALLOCA_SOURCE)
 #AC_SUBST(ALLOCA_OBJECT)
 
+if test x$SIZE = x ; then
+    if test x$ac_tool_prefix = x ; then
+        SIZE=size
+    else
+        SIZE=${ac_tool_prefix}size
+        save_IFS=$IFS ; IFS=:
+        size_found=0
+        for dir in $PATH ; do
+            if test -x $dir/$SIZE ; then
+               size_found=1
+               break
+            fi
+        done
+        if test $size_found -eq 0 ; then
+           SIZE=size
+        fi
+        IFS=$save_IFS
+    fi
+fi
+AC_SUBST(SIZE)
+
 AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \
          lib/intl/Makefile \
          lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \




reply via email to

[Prev in Thread] Current Thread [Next in Thread]