Changeset 629 for trunk/src


Ignore:
Timestamp:
Nov 26, 2006, 12:47:02 PM (19 years ago)
Author:
bird
Message:

porting in progress.

Location:
trunk/src/ash
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ash/Makefile.kmk

    r626 r629  
    22## @file
    33#
    4 # kBuild Makefile for ash.
     4# kBuild Makefile for kmk_ash.
    55#
    6 # Copyright (c) 2005 knut st. osmundsen <bird@anduin.net>
     6# Copyright (c) 2005-2006 knut st. osmundsen <bird-src-spam@anduin.net>
    77#
    88
    9 PROGRAMS = ash
    10 INSTALLS = ash.man
     9DEPTH = ../..
     10include $(PATH_KBUILD)/header.kmk
    1111
    12 ash_TEMPLATE = bin
    13 ash_DEFS = lint SHELL SMALL
    14 ash_DEFS.os2 = EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
    15 ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
    16 ash_SOURCES = \
     12#INSTALLS = ash.man
     13
     14PROGRAMS += kmk_ash
     15kmk_ash_TEMPLATE = BIN
     16kmk_ash_DEFS = lint SHELL SMALL
     17kmk_ash_DEFS.win = PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
     18kmk_ash_DEFS.os2 = EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
     19kmk_ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
     20kmk_ash_SOURCES = \
    1721        alias.c \
    1822        cd.c \
     
    4549        $(PATH_TARGET)/init.c \
    4650        $(PATH_TARGET)/nodes.c
    47 ash_DEPS = \
     51kmk_ash_DEPS = \
    4852        $(PATH_TARGET)/arith.h \
    4953        $(PATH_TARGET)/builtins.h \
    5054        $(PATH_TARGET)/nodes.h \
    5155        $(PATH_TARGET)/token.h
    52 ash_CLEAN = \
    53         $(ash_DEPS)     \
     56kmk_ash_CLEAN = \
     57        $(kmk_ash_DEPS) \
    5458        $(PATH_TARGET)/arith.c \
    5559        $(PATH_TARGET)/arith_lex.c \
     
    5862        $(PATH_TARGET)/nodes.c
    5963
    60 ash.man_TEMPLATE = usr.bin.man
    61 ash.man_SOURCES = \
     64kmk_ash.man_TEMPLATE = usr.bin.man
     65kmk_ash.man_SOURCES = \
    6266        sh.1=>ash.1
    6367#ash.man_SYMLINKS = \
    6468#       ash.1.gz=>sh.1
    6569
    66 DEPTH = ..
    67 include $(PATH_KBUILD)/rules.kmk
     70include $(PATH_KBUILD)/footer.kmk
     71
     72#
     73# ATTENTION! ATTENTION! ATTENTION!
     74#
     75# Older ash versions has trouble with some of these scripts, great.
     76# Kudos to the NetBSD guys for this clever move. ;)
     77#
     78# So, when building for the frist time, setting BOOSTRAP_SHELL=/bin/bash is good idea.
     79#
     80BOOTSTRAP_SHELL ?= $(SHELL)
    6881
    6982$(PATH_TARGET)/arith.h $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET))
     
    7588        flex -8 -o$@ $^                     # 8-bit lex scanner for arithmetic
    7689
    77 $(PATH_TARGET)/builtins.h $(PATH_TARGET)/builtins.c: mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET))
    78         $+ $(dir $@)
     90$(PATH_TARGET)/builtins.h $(PATH_TARGET)/builtins.c: $(PATH_CURRENT)/mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET))
     91        $(BOOTSTRAP_SHELL) $+ $(dir $@)
    7992        [ -f $(PATH_TARGET)/builtins.h ]
    8093
    81 $(PATH_TARGET)/nodes.h $(PATH_TARGET)/nodes.c: mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET))
    82         $+ $(dir $@)
     94$(PATH_TARGET)/nodes.h $(PATH_TARGET)/nodes.c: $(PATH_CURRENT)/mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET))
     95        $(BOOTSTRAP_SHELL) $+ $(dir $@)
    8396        [ -f $(dir $@)/nodes.h ]
    8497
    85 $(PATH_TARGET)/token.h: mktokens | $(call DIRDEP,$(PATH_TARGET))
    86         $+
     98$(PATH_TARGET)/token.h: $(PATH_CURRENT)/mktokens | $(call DIRDEP,$(PATH_TARGET))
     99        $(BOOTSTRAP_SHELL) $+
    87100        $(MV) token.h $@
    88101
    89 $(PATH_TARGET)/init.c: mkinit.sh $(filter-out $(PATH_TARGET)/%,$(ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET))
    90         $+
     102$(PATH_TARGET)/init.c: $(PATH_CURRENT)/mkinit.sh $(filter-out $(PATH_TARGET)/%,$(kmk_ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET))
     103        $(BOOTSTRAP_SHELL) $+
    91104        $(MV) init.c $@
    92105
  • trunk/src/ash/error.h

    r626 r629  
    112112 */
    113113
    114 #if defined(BSD) && !defined(__SVR4)
     114#if defined(BSD) && !defined(__SVR4) && !defined(__GLIBC__) && !defined(__KLIBC__)
    115115#define setjmp(jmploc)  _setjmp(jmploc)
    116116#define longjmp(jmploc, val)    _longjmp(jmploc, val)
  • trunk/src/ash/eval.c

    r626 r629  
    5151#include <sys/types.h>
    5252#include <sys/wait.h>
     53#ifdef HAVE_SYSCTL_H
    5354#include <sys/sysctl.h>
     55#endif
    5456
    5557/*
     
    604606syspath(void)
    605607{
     608#ifdef CTL_USER
    606609        static char *sys_path = NULL;
    607610        static int mib[] = {CTL_USER, USER_CS_PATH};
     611#endif
    608612#ifdef PC_PATH_SEP
    609613        static char def_path[] = "PATH=/usr/bin;/bin;/usr/sbin;/sbin";
     
    611615        static char def_path[] = "PATH=/usr/bin:/bin:/usr/sbin:/sbin";
    612616#endif
     617#ifdef CTL_USER
    613618        size_t len;
    614619
     
    625630        }
    626631        return sys_path;
     632#else
     633    return def_path;
     634#endif
    627635}
    628636
     
    10091017                        optptr = NULL;
    10101018                        /* and getopt */
     1019#if defined(__FreeBSD__) || defined(__EMX__) || defined(__APPLE__)
    10111020                        optreset = 1;
    10121021                        optind = 1;
     1022#else
     1023                        optind = 0; /* init */
     1024#endif
     1025
    10131026                        exitstatus = cmdentry.u.bltin(argc, argv);
    10141027                } else {
  • trunk/src/ash/mkbuiltins

    • Property svn:executable set to *
  • trunk/src/ash/mkinit.sh

    • Property svn:executable set to *
  • trunk/src/ash/mknodes.sh

    • Property svn:executable set to *
  • trunk/src/ash/mktokens

    • Property svn:executable set to *
    r626 r629  
    3838# error messages.
    3939
     40if [ -z "$TMPDIR" ]; then
     41    TMPDIR="/tmp"
     42    export TMPDIR
     43fi
    4044F="$TMPDIR/ka$$"
    4145echo $F
  • trunk/src/ash/nodetypes

    • Property svn:eol-style set to native
Note: See TracChangeset for help on using the changeset viewer.