Commit ca15a1be authored by Ryan Jackson's avatar Ryan Jackson
Browse files

Add tcsh to linux MFS

Also rename old fake tcsh to tcsh.fake, and run a new script that
symlinks tcsh and csh to tcsh.fake if tcsh doesn't exist.  This way tcsh
can be removed from the build but tcsh/csh users can still log in.
parent 6dd90912
......@@ -14,7 +14,7 @@ INITRAMFS = $(BOOT_PATH)/initramfs.gz
FAKEROOT_BIN = fakeroot
MODULES := busybox zlib linux dropbear testbed hdparm target_template sudo \
e2fsprogs openssl wget perl portmap file ethtool ncurses jove
e2fsprogs openssl wget perl portmap file ethtool ncurses jove tcsh
#MODULES := busybox zlib linux dropbear testbed hdparm target_template sudo e2fsprogs openssl wget portmap file
INSTALL_MODULES := $(addsuffix -install,$(MODULES))
EXTRACT_MODULES := $(addsuffix -extract,$(MODULES) toolchain)
......@@ -72,18 +72,6 @@ uclibc-install: $(TARGET_PATH)/lib/libc.so.0
$(FAKEROOT_ENVIRONMENT):
touch $@
devices: $(FAKEROOT_ENVIRONMENT)
rm -rf $(TARGET_PATH)/dev
$(FAKEROOT_BIN) -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/makedevs.sh \
$(SCRIPTS_PATH)/devices $(TARGET_PATH)
permissions: $(FAKEROOT_ENVIRONMENT) devices install
$(FAKEROOT_BIN) -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/fixperms.sh $(TARGET_PATH)
initramfs: install
rm -rf $(INITRAMFS_PATH)
cp -dpR $(TARGET_PATH) $(INITRAMFS_PATH)
......@@ -96,6 +84,9 @@ initramfs: install
$(FAKEROOT_BIN) -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/fixperms.sh $(INITRAMFS_PATH)
$(FAKEROOT_BIN) -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/misc_fixup.sh $(TARGET_PATH)
$(FAKEROOT_BIN) -i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/gen_initramfs.sh $(INITRAMFS_PATH) $(INITRAMFS)
rm -f $(FAKEROOT_ENVIRONMENT)
......
#! /bin/sh
target_dir="$1"
if [ -z "$target_dir" ] || ! [ -d "$target_dir" ]; then
echo "${0##*/}: invalid target directory \"$target_dir\""
exit 1
fi
if ! [ -f "$target_dir/bin/tcsh" ]; then
ln -sf /bin/tcsh.fake "$target_dir/bin/tcsh"
ln -sf /bin/tcsh.fake "$target_dir/bin/csh"
fi
include ../../variables.mk
TCSH_VERSION = 6.14.00
TCSH_PATH = $(TARGET_BUILD_PATH)/tcsh-$(TCSH_VERSION)
.PHONY: extract patch config \
tcsh install clean all
all: tcsh
extract: $(TCSH_PATH)/.extract-stamp
patch: $(TCSH_PATH)/.patch-stamp
config: $(TCSH_PATH)/.config-stamp
tcsh: $(TCSH_PATH)/tcsh
install: $(TARGET_PATH)/bin/tcsh
clean:
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(TCSH_PATH) clean
rm -f $(TCSH_PATH)/.build-stamp $(TCSH_PATH)/.config-stamp
$(TCSH_PATH)/.extract-stamp:
mkdir -p $(TARGET_BUILD_PATH)
cd $(TARGET_BUILD_PATH); tar xzf $(TARBALL_PATH)/tcsh-$(TCSH_VERSION).tar.gz
touch $@
$(TCSH_PATH)/.patch-stamp: $(TCSH_PATH)/.extract-stamp
$(SCRIPTS_PATH)/patch-kernel.sh $(TCSH_PATH) $(SOURCE_PATH)/tcsh '*.patch'
touch $@
$(TCSH_PATH)/.config-stamp: $(TCSH_PATH)/.patch-stamp
rm -f $(TCSH_PATH)/config.cache
(cd $(TCSH_PATH); \
PATH=$(STAGING_DIR)/usr/bin:$(PATH) \
$(HOST_CONFIGURE_OPTS) \
./configure \
--target=$(MFS_ARCH)-linux-uclibc \
--host=$(MFS_ARCH)-linux-uclibc \
--build=$(MFS_ARCH)-linux-gnu \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--libdir=/lib \
--libexecdir=/usr/lib \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var \
--mandir=/usr/man \
--infodir=/usr/info \
)
touch $@
#--enable-elf-shlibs --enable-dynamic-e2fsck --disable-swapfs \
#--enable-elf-shlibs \
$(TCSH_PATH)/tcsh: $(TCSH_PATH)/.config-stamp
PATH=$(STAGING_DIR)/usr/bin:$(PATH) \
CC=$(TARGET_CC) \
$(MAKE) -C $(TCSH_PATH) \
$(TARGET_CONFIGURE_OPTS) LD=$(MFS_ARCH)-linux-uclibc-gcc
touch $@
$(TARGET_PATH)/bin/tcsh: $(TCSH_PATH)/tcsh
install -d -m 755 $(TARGET_PATH)/bin
rm -f $(TARGET_PATH)/bin/tcsh
rm -f $(TARGET_PATH)/bin/csh
install -m 755 $< $@
$(STRIPCMD) --strip-unneeded $@
ln -sf /bin/tcsh $(TARGET_PATH)/bin/csh
touch -c $@
diff -ur tcsh-6.14.00.orig/config.sub tcsh-6.14.00/config.sub
--- tcsh-6.14.00.orig/config.sub 2002-07-12 07:14:20.000000000 -0600
+++ tcsh-6.14.00/config.sub 2010-07-21 12:51:55.000000000 -0600
@@ -1216,6 +1216,9 @@
;;
-none)
;;
+ -uclibc)
+ os=-linux-gnu
+ ;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
diff -ur tcsh-6.14.00.orig/configure tcsh-6.14.00/configure
--- tcsh-6.14.00.orig/configure 2005-03-23 06:20:30.000000000 -0700
+++ tcsh-6.14.00/configure 2010-07-21 13:33:28.000000000 -0600
@@ -7110,72 +7110,75 @@
fi
-echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
-echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6
-if test "${ac_cv_func_setpgrp_void+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
-echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
- { (exit 1); exit 1; }; }
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int
-main ()
-{
-/* If this system has a BSD-style setpgrp which takes arguments,
- setpgrp(1, 1) will fail with ESRCH and return -1, in that case
- exit successfully. */
- exit (setpgrp (1,1) == -1 ? 0 : 1);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_setpgrp_void=no
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+#echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
+#echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6
+#if test "${ac_cv_func_setpgrp_void+set}" = set; then
+# echo $ECHO_N "(cached) $ECHO_C" >&6
+#else
+# if test "$cross_compiling" = yes; then
+# { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
+#echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
+# { (exit 1); exit 1; }; }
+#else
+# cat >conftest.$ac_ext <<_ACEOF
+#/* confdefs.h. */
+#_ACEOF
+#cat confdefs.h >>conftest.$ac_ext
+#cat >>conftest.$ac_ext <<_ACEOF
+#/* end confdefs.h. */
+##if HAVE_UNISTD_H
+## include <unistd.h>
+##endif
+
+#int
+#main ()
+#{
+#/* If this system has a BSD-style setpgrp which takes arguments,
+# setpgrp(1, 1) will fail with ESRCH and return -1, in that case
+# exit successfully. */
+# exit (setpgrp (1,1) == -1 ? 0 : 1);
+# ;
+# return 0;
+#}
+#_ACEOF
+#rm -f conftest$ac_exeext
+#if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+# (eval $ac_link) 2>&5
+# ac_status=$?
+# echo "$as_me:$LINENO: \$? = $ac_status" >&5
+# (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+# { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+# (eval $ac_try) 2>&5
+# ac_status=$?
+# echo "$as_me:$LINENO: \$? = $ac_status" >&5
+# (exit $ac_status); }; }; then
+# ac_cv_func_setpgrp_void=no
+#else
+# echo "$as_me: program exited with status $ac_status" >&5
+#echo "$as_me: failed program was:" >&5
+#sed 's/^/| /' conftest.$ac_ext >&5
+
+#( exit $ac_status )
+#ac_cv_func_setpgrp_void=yes
+#fi
+#rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+#fi
+#fi
+#echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
+#echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6
+#if test $ac_cv_func_setpgrp_void = yes; then
+
+#cat >>confdefs.h <<\_ACEOF
+##define SETPGRP_VOID 1
+#_ACEOF
-( exit $ac_status )
-ac_cv_func_setpgrp_void=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
-echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6
-if test $ac_cv_func_setpgrp_void = yes; then
+#fi
+# XXX hack
cat >>confdefs.h <<\_ACEOF
#define SETPGRP_VOID 1
_ACEOF
-fi
-
-
-
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment