From 6dbbe62310a1c195a14784b29ac96f83f8770927 Mon Sep 17 00:00:00 2001 From: "zodiac@gmail.com" Date: Sun, 21 Jun 2009 19:41:32 +0000 Subject: [PATCH] Added code so that "objcopy" picks an appropriate target architecture when building for ARM. git-svn-id: https://shellinabox.googlecode.com/svn/trunk@124 0da03de8-d603-11dd-86c2-0f8696b7b6f9 --- Makefile.am | 141 ++++++++-------------------------- Makefile.in | 141 ++++++++-------------------------- config.h | 2 +- configure | 2 +- configure.ac | 2 +- demo/vt100.js | 2 +- shellinabox/shell_in_a_box.js | 2 +- shellinabox/vt100.js | 2 +- 8 files changed, 66 insertions(+), 228 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6cd5a2b..e185878 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,6 +87,30 @@ shellinaboxd_LDADD = liblogging.la \ libhttp.la shellinaboxd_LDFLAGS = -static +objcopyflags = case "$(host_cpu)" in \ + i[0-9]86) echo '-O elf32-i386 -B i386';; \ + x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ + arm*) echo '-O elf32-littlearm -B arm';; \ + esac + +renamesymbols = \ + sed -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ + -e 't0' \ + -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ + -e 't0' \ + -e 's/.*/&=& /' \ + -e ':0' \ + -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ + -e ':1' \ + -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ + -e 't1' \ + -e 's/.\{53\}$$//' \ + -e 's/[/.]/_/g' \ + -e 's/^/--redefine-sym _binary_/' \ + -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ + -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ + -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/' + libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck @@ -144,80 +168,17 @@ clean-local: .css.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" .html.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" .ico.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" shellinabox/shell_in_a_box.o: shellinabox/shell_in_a_box.js config.h @@ -229,57 +190,15 @@ shellinabox/shell_in_a_box.o: shellinabox/shell_in_a_box.js config.h -e d "$<"`" \ -e "s/^#/\/\/ #/" \ -e "s/VERSION/\"@VERSION@ (revision @VCS_REVISION@)\"/g" \ - "$<" >"$@" + "$<" >"$@" .js.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo $(host_cpu) | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2.js=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" .wav.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" diff --git a/Makefile.in b/Makefile.in index 4b99cb1..f19a145 100644 --- a/Makefile.in +++ b/Makefile.in @@ -331,6 +331,30 @@ shellinaboxd_LDADD = liblogging.la \ libhttp.la shellinaboxd_LDFLAGS = -static +objcopyflags = case "$(host_cpu)" in \ + i[0-9]86) echo '-O elf32-i386 -B i386';; \ + x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ + arm*) echo '-O elf32-littlearm -B arm';; \ + esac + +renamesymbols = \ + sed -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ + -e 't0' \ + -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ + -e 't0' \ + -e 's/.*/&=& /' \ + -e ':0' \ + -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ + -e ':1' \ + -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ + -e 't1' \ + -e 's/.\{53\}$$//' \ + -e 's/[/.]/_/g' \ + -e 's/^/--redefine-sym _binary_/' \ + -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ + -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ + -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/' + all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -1058,80 +1082,17 @@ clean-local: .css.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" .html.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" .ico.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" shellinabox/shell_in_a_box.o: shellinabox/shell_in_a_box.js config.h @@ -1143,58 +1104,16 @@ shellinabox/shell_in_a_box.o: shellinabox/shell_in_a_box.js config.h -e d "$<"`" \ -e "s/^#/\/\/ #/" \ -e "s/VERSION/\"@VERSION@ (revision @VCS_REVISION@)\"/g" \ - "$<" >"$@" + "$<" >"$@" .js.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo $(host_cpu) | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2.js=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" .wav.o: @echo objcopy "$<" "$@" - @objcopy \ - -I binary `echo "$(host_cpu)" | \ - grep -q '^i[0-9]86$$' && \ - echo ' -O elf32-i386 -B i386' || \ - echo ' -O elf64-x86-64 -B i386:x86-64'` \ - `echo "$<" | sed \ - -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \ - -e 't0' \ - -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \ - -e 't0' \ - -e 's/.*/&=& /' \ - -e ':0' \ - -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \ - -e ':1' \ - -e 's/\(=[^_]*\)_\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \ - -e 't1' \ - -e 's/.\{53\}$$//' \ - -e 's/[/.]/_/g' \ - -e 's/^/--redefine-sym _binary_/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/' \ - -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/' \ - -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'` \ + @objcopy -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)` \ "$<" "$@" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/config.h b/config.h index 9e4a64f..00cdb47 100644 --- a/config.h +++ b/config.h @@ -132,7 +132,7 @@ #define STDC_HEADERS 1 /* Most recent revision number in the version control system */ -#define VCS_REVISION "123" +#define VCS_REVISION "124" /* Version number of package */ #define VERSION "2.8" diff --git a/configure b/configure index c7363a3..f91b6f0 100755 --- a/configure +++ b/configure @@ -2037,7 +2037,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -VCS_REVISION=123 +VCS_REVISION=124 cat >>confdefs.h <<_ACEOF diff --git a/configure.ac b/configure.ac index 097c11a..5417270 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ(2.57) dnl This is the one location where the authoritative version number is stored AC_INIT(shellinabox, 2.8, markus@shellinabox.com) -VCS_REVISION=123 +VCS_REVISION=124 AC_SUBST(VCS_REVISION) AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}", [Most recent revision number in the version control system]) diff --git a/demo/vt100.js b/demo/vt100.js index 4bbc7b7..24a0154 100644 --- a/demo/vt100.js +++ b/demo/vt100.js @@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() { }; VT100.prototype.about = function() { - alert("VT100 Terminal Emulator " + "2.8 (revision 123)" + + alert("VT100 Terminal Emulator " + "2.8 (revision 124)" + "\nCopyright 2008-2009 by Markus Gutschke\n" + "For more information check http://shellinabox.com"); }; diff --git a/shellinabox/shell_in_a_box.js b/shellinabox/shell_in_a_box.js index 51435ae..81c9a23 100644 --- a/shellinabox/shell_in_a_box.js +++ b/shellinabox/shell_in_a_box.js @@ -355,7 +355,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) { }; ShellInABox.prototype.about = function() { - alert("Shell In A Box version " + "2.8 (revision 123)" + + alert("Shell In A Box version " + "2.8 (revision 124)" + "\nCopyright 2008-2009 by Markus Gutschke\n" + "For more information check http://shellinabox.com" + (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ? diff --git a/shellinabox/vt100.js b/shellinabox/vt100.js index 4bbc7b7..24a0154 100644 --- a/shellinabox/vt100.js +++ b/shellinabox/vt100.js @@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() { }; VT100.prototype.about = function() { - alert("VT100 Terminal Emulator " + "2.8 (revision 123)" + + alert("VT100 Terminal Emulator " + "2.8 (revision 124)" + "\nCopyright 2008-2009 by Markus Gutschke\n" + "For more information check http://shellinabox.com"); };