objcopy. Instead, we are now using "od" to generate C source code.
AM_CFLAGS = -g -std=gnu99 -Wall
AM_LDFLAGS = -g -lm
-OBJCOPY ?= objcopy
-OBJDUMP ?= objdump
-
noinst_LTLIBRARIES = libhttp.la \
liblogging.la
noinst_DATA = $(top_srcdir)/demo/demo.js
shellinabox/keyboard-layout.html \
shellinabox/beep.wav \
config.h
+BUILT_SOURCES = shellinabox/beep.h \
+ shellinabox/cgi_root.h \
+ shellinabox/enabled.h \
+ shellinabox/favicon.h \
+ shellinabox/keyboard.h \
+ shellinabox/keyboard-layout.h \
+ shellinabox/print-styles.h \
+ shellinabox/root_page.h \
+ shellinabox/shell_in_a_box.h \
+ shellinabox/shell_in_a_box.js \
+ shellinabox/styles.h \
+ shellinabox/vt100.h \
+ shellinabox/vt100.js
+
+
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';; \
- *) trap 'rm -f /tmp/probe$$$$.o' EXIT; \
- $(CC) $(AM_CFLAGS) $(CFLAGS) -c -xc \
- -o /tmp/probe$$$$.o /dev/null && \
- $(OBJDUMP) -f /tmp/probe$$$$.o | \
- sed -e 's/.*file format */-O /;t; \
- s/architecture: *\([^,]*\).*/-B \1/;t; \
- d';; \
- esac
-
-renamesymbols = \
- sed -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \
- -e 't0' \
- -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \
+symbolname = \
+ sed -e 's/.*\/\([^.]*\)[.].*/\1/' \
-e 't0' \
- -e 's/.*/&=& /' \
+ -e 's/\([^.]*\)[.].*/\1/' \
-e ':0' \
- -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \
+ -e 's/$$/ aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \
-e ':1' \
- -e 's/\(=[^-_]*\)[-_]\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \
+ -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/'
+ -e 's/[-/.]/_/g'
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
debian/shellinabox*.debhelper* \
debian/shellinabox.substvars \
debian/tmp
- -rm -rf GNU-stack
-
-.css.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.gif.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.png.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.html.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-
-.ico.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-
-shellinabox/shell_in_a_box.o: ${top_srcdir}/shellinabox/shell_in_a_box.js \
- ${top_srcdir}/config.h
-
-${top_srcdir}/shellinabox/vt100.js: ${top_srcdir}/shellinabox/vt100.jspp
+ -rm -rf shellinabox/beep.h \
+ shellinabox/cgi_root.h \
+ shellinabox/enabled.h \
+ shellinabox/favicon.h \
+ shellinabox/keyboard.h \
+ shellinabox/keyboard-layout.h \
+ shellinabox/print-styles.h \
+ shellinabox/root_page.h \
+ shellinabox/shell_in_a_box.h \
+ shellinabox/styles.h \
+ shellinabox/vt100.h
+
+.css.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.gif.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.png.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.html.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+
+.ico.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
.jspp.js:
@echo preprocess "$<" "$@"
+ @mkdir -p "`dirname "$@"`"
sed -e "`sed -e 's/^#define *\([^ ]*\) *\(.*\)/\/^[^#]\/s\/\1\/\2 \\\\\/* \1 *\\\\\/\/g/' \
-e t \
-e d "$<"`" \
-e "s/VERSION/\"@VERSION@ (revision @VCS_REVISION@)\"/g" \
"$<" >"$@"
-.js.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-
-.wav.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
+.js.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+
+.wav.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
"$(DESTDIR)$(docdir)"
PROGRAMS = $(bin_PROGRAMS)
-am__dirstamp = $(am__leading_dot)dirstamp
am_shellinaboxd_OBJECTS = shellinaboxd.$(OBJEXT) \
externalfile.$(OBJEXT) launcher.$(OBJEXT) privileges.$(OBJEXT) \
- service.$(OBJEXT) session.$(OBJEXT) usercss.$(OBJEXT) \
- shellinabox/cgi_root.$(OBJEXT) shellinabox/root_page.$(OBJEXT) \
- shellinabox/vt100.$(OBJEXT) \
- shellinabox/shell_in_a_box.$(OBJEXT) \
- shellinabox/styles.$(OBJEXT) \
- shellinabox/print-styles.$(OBJEXT) \
- shellinabox/enabled.$(OBJEXT) shellinabox/favicon.$(OBJEXT) \
- shellinabox/keyboard.$(OBJEXT) \
- shellinabox/keyboard-layout.$(OBJEXT) \
- shellinabox/beep.$(OBJEXT)
+ service.$(OBJEXT) session.$(OBJEXT) usercss.$(OBJEXT)
shellinaboxd_OBJECTS = $(am_shellinaboxd_OBJECTS)
shellinaboxd_DEPENDENCIES = liblogging.la libhttp.la
shellinaboxd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
shellinabox/beep.wav \
config.h
+BUILT_SOURCES = shellinabox/beep.h \
+ shellinabox/cgi_root.h \
+ shellinabox/enabled.h \
+ shellinabox/favicon.h \
+ shellinabox/keyboard.h \
+ shellinabox/keyboard-layout.h \
+ shellinabox/print-styles.h \
+ shellinabox/root_page.h \
+ shellinabox/shell_in_a_box.h \
+ shellinabox/shell_in_a_box.js \
+ shellinabox/styles.h \
+ shellinabox/vt100.h \
+ shellinabox/vt100.js
+
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';; \
- *) trap 'rm -f /tmp/probe$$$$.o' EXIT; \
- $(CC) $(AM_CFLAGS) $(CFLAGS) -c -xc \
- -o /tmp/probe$$$$.o /dev/null && \
- $(OBJDUMP) -f /tmp/probe$$$$.o | \
- sed -e 's/.*file format */-O /;t; \
- s/architecture: *\([^,]*\).*/-B \1/;t; \
- d';; \
- esac
-
-renamesymbols = \
- sed -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /' \
- -e 't0' \
- -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /' \
+symbolname = \
+ sed -e 's/.*\/\([^.]*\)[.].*/\1/' \
-e 't0' \
- -e 's/.*/&=& /' \
+ -e 's/\([^.]*\)[.].*/\1/' \
-e ':0' \
- -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \
+ -e 's/$$/ aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/' \
-e ':1' \
- -e 's/\(=[^-_]*\)[-_]\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/' \
+ -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/'
+ -e 's/[-/.]/_/g'
-all: config.h
+all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: .c .css .gif .html .ico .js .jspp .lo .o .obj .png .wav
+.SUFFIXES: .c .css .gif .h .html .ico .js .jspp .lo .o .obj .png .wav
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-shellinabox/$(am__dirstamp):
- @$(MKDIR_P) shellinabox
- @: > shellinabox/$(am__dirstamp)
-shellinabox/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) shellinabox/$(DEPDIR)
- @: > shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/cgi_root.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/root_page.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/vt100.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/shell_in_a_box.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/styles.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/print-styles.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/enabled.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/favicon.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/keyboard.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/keyboard-layout.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
-shellinabox/beep.$(OBJEXT): shellinabox/$(am__dirstamp) \
- shellinabox/$(DEPDIR)/$(am__dirstamp)
shellinaboxd$(EXEEXT): $(shellinaboxd_OBJECTS) $(shellinaboxd_DEPENDENCIES)
@rm -f shellinaboxd$(EXEEXT)
$(shellinaboxd_LINK) $(shellinaboxd_OBJECTS) $(shellinaboxd_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
- -rm -f shellinabox/beep.$(OBJEXT)
- -rm -f shellinabox/cgi_root.$(OBJEXT)
- -rm -f shellinabox/enabled.$(OBJEXT)
- -rm -f shellinabox/favicon.$(OBJEXT)
- -rm -f shellinabox/keyboard-layout.$(OBJEXT)
- -rm -f shellinabox/keyboard.$(OBJEXT)
- -rm -f shellinabox/print-styles.$(OBJEXT)
- -rm -f shellinabox/root_page.$(OBJEXT)
- -rm -f shellinabox/shell_in_a_box.$(OBJEXT)
- -rm -f shellinabox/styles.$(OBJEXT)
- -rm -f shellinabox/vt100.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
-check: check-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \
config.h
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -rm -f shellinabox/$(DEPDIR)/$(am__dirstamp)
- -rm -f shellinabox/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
uninstall-man: uninstall-man1
-.MAKE: all install-am install-strip
+.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic clean-libtool clean-local \
uninstall-man uninstall-man1
-OBJCOPY ?= objcopy
-OBJDUMP ?= objdump
-
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
debian/shellinabox*.debhelper* \
debian/shellinabox.substvars \
debian/tmp
- -rm -rf GNU-stack
-
-.css.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.gif.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.png.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.html.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.ico.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-shellinabox/shell_in_a_box.o: ${top_srcdir}/shellinabox/shell_in_a_box.js \
- ${top_srcdir}/config.h
-
-${top_srcdir}/shellinabox/vt100.js: ${top_srcdir}/shellinabox/vt100.jspp
+ -rm -rf shellinabox/beep.h \
+ shellinabox/cgi_root.h \
+ shellinabox/enabled.h \
+ shellinabox/favicon.h \
+ shellinabox/keyboard.h \
+ shellinabox/keyboard-layout.h \
+ shellinabox/print-styles.h \
+ shellinabox/root_page.h \
+ shellinabox/shell_in_a_box.h \
+ shellinabox/styles.h \
+ shellinabox/vt100.h
+
+.css.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.gif.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.png.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.html.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.ico.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
.jspp.js:
@echo preprocess "$<" "$@"
+ @mkdir -p "`dirname "$@"`"
sed -e "`sed -e 's/^#define *\([^ ]*\) *\(.*\)/\/^[^#]\/s\/\1\/\2 \\\\\/* \1 *\\\\\/\/g/' \
-e t \
-e d "$<"`" \
-e "s/VERSION/\"@VERSION@ (revision @VCS_REVISION@)\"/g" \
"$<" >"$@"
-.js.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
-
-.wav.o:
- @echo $(OBJCOPY) "$<" "$@"
- @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
- "$<" "$@"
- @-printf '\000' >GNU-stack && \
- $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@"; \
- rm -f GNU-stack
+.js.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
+
+.wav.h:
+ @echo od "$<" '>'"$@"
+ @mkdir -p "`dirname "$@"`"
+ @{ sym="`echo "$<" | $(symbolname)`"; \
+ echo "static const char $${sym}Start[]="; \
+ od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \
+ echo ';'; \
+ echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \
+ } >"$@"
# 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.
#define STDC_HEADERS 1
/* Most recent revision number in the version control system */
-#define VCS_REVISION "229"
+#define VCS_REVISION "230"
/* Version number of package */
#define VERSION "2.10"
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-VCS_REVISION=229
+VCS_REVISION=230
cat >>confdefs.h <<_ACEOF
dnl This is the one location where the authoritative version number is stored
AC_INIT(shellinabox, 2.10, markus@shellinabox.com)
-VCS_REVISION=229
+VCS_REVISION=230
AC_SUBST(VCS_REVISION)
AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
[Most recent revision number in the version control system])
};
VT100.prototype.about = function() {
- alert("VT100 Terminal Emulator " + "2.10 (revision 229)" +
+ alert("VT100 Terminal Emulator " + "2.10 (revision 230)" +
"\nCopyright 2008-2010 by Markus Gutschke\n" +
"For more information check http://shellinabox.com");
};
// Finish all pending PAM operations.
int status, rc;
check(NOINTR(waitpid(pid, &status, 0)) == pid);
- pam_close_session(pam, PAM_SILENT);
- pam_end(pam, rc);
+ rc = pam_close_session(pam, PAM_SILENT);
+ pam_end(pam, rc | PAM_DATA_SILENT);
_exit(WIFEXITED(status) ? WEXITSTATUS(status) : -WTERMSIG(status));
}
}
};
ShellInABox.prototype.about = function() {
- alert("Shell In A Box version " + "2.10 (revision 229)" +
+ alert("Shell In A Box version " + "2.10 (revision 230)" +
"\nCopyright 2008-2010 by Markus Gutschke\n" +
"For more information check http://shellinabox.com" +
(typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?
#include "shellinabox/session.h"
#include "shellinabox/usercss.h"
+// Embedded resources
+#include "shellinabox/beep.h"
+#include "shellinabox/cgi_root.h"
+#include "shellinabox/enabled.h"
+#include "shellinabox/favicon.h"
+#include "shellinabox/keyboard.h"
+#include "shellinabox/keyboard-layout.h"
+#include "shellinabox/print-styles.h"
+#include "shellinabox/root_page.h"
+#include "shellinabox/shell_in_a_box.h"
+#include "shellinabox/styles.h"
+#include "shellinabox/vt100.h"
+
+
#define PORTNUM 4200
#define MAX_RESPONSE 2048
httpTransfer(http, response, len);
}
-static const char *addr(const char *a) {
- // Work-around for a gcc bug that could occasionally generate invalid
- // assembly instructions when optimizing code too agressively.
- asm volatile("");
- return a;
-}
-
static int shellInABoxHttpHandler(HttpConnection *http, void *arg,
const char *buf, int len) {
checkGraveyard();
// client session.
return dataHandler(http, arg, buf, len, url);
}
- extern char rootPageStart[];
- extern char rootPageEnd[];
- char *rootPage;
- check(rootPage = malloc(rootPageEnd - rootPageStart + 1));
- memcpy(rootPage, rootPageStart, rootPageEnd - rootPageStart);
- rootPage[rootPageEnd - rootPageStart] = '\000';
- char *html = stringPrintf(NULL, rootPage,
+ char *html = stringPrintf(NULL, rootPageStart,
enableSSL ? "true" : "false");
serveStaticFile(http, "text/html", html, strrchr(html, '\000'));
free(html);
- free(rootPage);
} else if (pathInfoLength == 8 && !memcmp(pathInfo, "beep.wav", 8)) {
// Serve the audio sample for the console bell.
- extern char beepStart[];
- extern char beepEnd[];
- serveStaticFile(http, "audio/x-wav", beepStart, beepEnd);
+ serveStaticFile(http, "audio/x-wav", beepStart, beepStart + beepSize - 1);
} else if (pathInfoLength == 11 && !memcmp(pathInfo, "enabled.gif", 11)) {
// Serve the checkmark icon used in the context menu
- extern char enabledStart[];
- extern char enabledEnd[];
- serveStaticFile(http, "image/gif", enabledStart, enabledEnd);
+ serveStaticFile(http, "image/gif", enabledStart,
+ enabledStart + enabledSize - 1);
} else if (pathInfoLength == 11 && !memcmp(pathInfo, "favicon.ico", 11)) {
// Serve the favicon
- extern char faviconStart[];
- extern char faviconEnd[];
- serveStaticFile(http, "image/x-icon", faviconStart, faviconEnd);
+ serveStaticFile(http, "image/x-icon", faviconStart,
+ faviconStart + faviconSize - 1);
} else if (pathInfoLength == 13 && !memcmp(pathInfo, "keyboard.html", 13)) {
// Serve the keyboard layout
- extern char keyboardLayoutStart[];
- extern char keyboardLayoutEnd[];
- serveStaticFile(http, "text/html", keyboardLayoutStart, keyboardLayoutEnd);
+ serveStaticFile(http, "text/html", keyboardLayoutStart,
+ keyboardLayoutStart + keyboardLayoutSize - 1);
} else if (pathInfoLength == 12 && !memcmp(pathInfo, "keyboard.png", 12)) {
// Serve the keyboard icon
- extern char keyboardStart[];
- extern char keyboardEnd[];
- serveStaticFile(http, "image/png", keyboardStart, keyboardEnd);
+ serveStaticFile(http, "image/png", keyboardStart,
+ keyboardStart + keyboardSize - 1);
} else if (pathInfoLength == 14 && !memcmp(pathInfo, "ShellInABox.js", 14)) {
// Serve both vt100.js and shell_in_a_box.js in the same transaction.
// Also, indicate to the client whether the server is SSL enabled.
- extern char vt100Start[];
- extern char vt100End[];
- extern char shellInABoxStart[];
- extern char shellInABoxEnd[];
char *userCSSString = getUserCSSString(userCSSList);
char *stateVars = stringPrintf(NULL,
"serverSupportsSSL = %s;\n"
free(userCSSString);
int stateVarsLength = strlen(stateVars);
int contentLength = stateVarsLength +
- (addr(vt100End) - addr(vt100Start)) +
- (addr(shellInABoxEnd) - addr(shellInABoxStart));
+ vt100Size - 1 +
+ shellInABoxSize - 1;
char *response = stringPrintf(NULL,
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/javascript; charset=utf-8\r\n"
check(response = realloc(response, headerLength + contentLength));
memcpy(memcpy(memcpy(
response + headerLength, stateVars, stateVarsLength)+stateVarsLength,
- vt100Start, vt100End - vt100Start) + (vt100End - vt100Start),
- shellInABoxStart, shellInABoxEnd - shellInABoxStart);
+ vt100Start, vt100Size - 1) + vt100Size - 1,
+ shellInABoxStart, shellInABoxSize - 1);
} else {
contentLength = 0;
}
cssStyleSheet, strrchr(cssStyleSheet, '\000'));
} else if (pathInfoLength == 16 && !memcmp(pathInfo, "print-styles.css",16)){
// Serve the style sheet.
- extern char printStylesStart[];
- extern char printStylesEnd[];
serveStaticFile(http, "text/css; charset=utf-8",
- printStylesStart, printStylesEnd);
+ printStylesStart, printStylesStart + printStylesSize - 1);
} else if (pathInfoLength > 8 && !memcmp(pathInfo, "usercss-", 8)) {
// Server user style sheets (if any)
struct UserCSS *css = userCSSList;
int verbosity = MSG_DEFAULT;
externalFiles = newHashMap(destroyExternalFileHashEntry, NULL);
HashMap *serviceTable = newHashMap(destroyServiceHashEntry, NULL);
- extern char stylesStart[];
- extern char stylesEnd[];
- check(cssStyleSheet = malloc(stylesEnd - stylesStart + 1));
- memcpy(cssStyleSheet, stylesStart, stylesEnd - stylesStart);
- cssStyleSheet[stylesEnd - stylesStart] = '\000';
+ check(cssStyleSheet = strdup(stylesStart));
for (;;) {
static const char optstring[] = "+hb::c:df:g:np:s:tqu:v";
// Output a <frameset> that includes our root page
check(port = serverGetListeningPort(server));
- extern char cgiRootStart[];
- extern char cgiRootEnd[];
- char *cgiRoot;
- check(cgiRoot = malloc(cgiRootEnd - cgiRootStart + 1));
- memcpy(cgiRoot, cgiRootStart, cgiRootEnd - cgiRootStart);
- cgiRoot[cgiRootEnd - cgiRootStart] = '\000';
printf("X-ShellInABox-Port: %d\r\n"
"X-ShellInABox-Pid: %d\r\n"
"Content-type: text/html; charset=utf-8\r\n\r\n",
port, getpid());
- printfUnchecked(cgiRoot, port, cgiSessionKey);
+ printfUnchecked(cgiRootStart, port, cgiSessionKey);
fflush(stdout);
- free(cgiRoot);
check(!NOINTR(close(fds[1])));
closeAllFds((int []){ launcherFd, serverGetFd(server) }, 2);
logSetLogLevel(MSG_QUIET);
};
VT100.prototype.about = function() {
- alert("VT100 Terminal Emulator " + "2.10 (revision 229)" +
+ alert("VT100 Terminal Emulator " + "2.10 (revision 230)" +
"\nCopyright 2008-2010 by Markus Gutschke\n" +
"For more information check http://shellinabox.com");
};