diff --git a/Makefile.am b/Makefile.am index ac37e92f1ed7b31a53a81edaa80aaf09f81e173c..5bc0092ebe02a540518bcb97f731a62f3546b2a6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,54 @@ -SUBDIRS = src +bin_PROGRAMS=42sh + +42sh_SOURCES= src/ast/ast.h \ + src/ast/ast_and.c \ + src/ast/ast_bang.c \ + src/ast/ast_case.c \ + src/ast/ast_cmd.c \ + src/ast/ast_destruct.c \ + src/ast/ast_for.c \ + src/ast/ast_funcdec.c \ + src/ast/ast_if.c \ + src/ast/ast_or.c \ + src/ast/ast_pipe.c \ + src/ast/ast_print.c \ + src/ast/ast_red.c \ + src/ast/ast_sep.c \ + src/ast/ast_sepand.c \ + src/ast/ast_subshell.c \ + src/ast/ast_while.c \ + src/common/basename.c \ + src/common/common.h \ + src/common/constant.h \ + src/common/isdigitstr.c \ + src/common/macro.h \ + src/common/strmerge.c \ + src/common/strvectoradd.c \ + src/common/strvmerge.c \ + src/common/strndup.c \ + src/exec/exec.h \ + src/exec/exec_node.c \ + src/parser/alias.h \ + src/parser/alias.c \ + src/parser/getline.h \ + src/parser/getline.c \ + src/parser/parser.h \ + src/parser/parser.c \ + src/parser/lexer.c \ + src/shell/getoptions.c \ + src/shell/option.h \ + src/shell/option.c \ + src/shell/shell.h \ + src/shell/shell_entry.c \ + src/shell/shell_init.c \ + src/shell/shell_destroy.c \ + src/shell/prompt.c -noinst_DATA=42sh$(EXEEXT) -DISTCLEANFILES=42sh$(EXEEXT) +CLEANFILES= *~ '\#*' -.PHONY: tar doc re +EXTRA_DIST = AUTHORS README TODO -42sh$(EXEEXT): src/42sh$(EXEEXT) +.PHONY: tar doc re tar: distcheck @@ -13,7 +56,3 @@ re: clean all doc: cd $(srcdir)/doc && $(MAKE) doc - -CLEANFILES= *~ '\#*' - -EXTRA_DIST = AUTHORS README TODO diff --git a/TODO b/TODO index b7a43dadae8df17b1af3fd45cf9b0da995ef5eee..0f2839cc7bd5908071affa0ab01b2a09d5cac0a0 100644 --- a/TODO +++ b/TODO @@ -5,4 +5,7 @@ Maintenant il renvoie EOF a la place du token. - Parser -- aliases --- history \ No newline at end of file +-- history + +- Option +-- voir probleme de non initialisation envoye par valgrind a chaque tour de boucle \ No newline at end of file diff --git a/configure.ac b/configure.ac index 4c56f7364d2b1a2b911a23cdb6baef2d274e6fee..9a42d8803ab49ddc709193c35c8637fd89c73385 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,16 @@ AC_ARG_WITH([noerror], ] ) +AC_ARG_WITH([dynamic], + [AS_HELP_STRING([--with-dynamic], [Compiling with dynamic libraries])], + [dnl action-if-given + dynamic=true + ], + [dnl action-if-not-given + dynamic=false + ] +) + AC_ARG_WITH([debug], [AS_HELP_STRING([--with-debug], [use -g and don't use -DNDEBUG -O3])], [dnl action-if-given @@ -117,7 +127,7 @@ AC_ARG_WITH([efence], CFLAGS="$CFLAGS -include stdlib.h -include efence.h" ], [dnl action-if-not-given - LDFLAGS="$LDFLAGS -static" + test "$dynamic" = "true" || LDFLAGS="$LDFLAGS -static" ] ) @@ -131,7 +141,6 @@ AC_CONFIG_HEADERS([config.h]) # define Autoconf config files AC_CONFIG_FILES([ Makefile - src/Makefile ]) AC_OUTPUT \ No newline at end of file diff --git a/man/42sh.man b/man/42sh.man index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..be34b3df9a22f0cf004688313e4e1d2957592764 100644 --- a/man/42sh.man +++ b/man/42sh.man @@ -0,0 +1,25 @@ +.TH 42sh 1 "2006 jan 21" +.SH NAME +42sh \- The 42 Shell +.SH SYNOPSIS +\fB42sh\fP [options] [file] +.SH DESCRIPTION +42sh is a complete implementation of a standard shell. +.SS Options +option petace +.TP +\fB-c\fP +Cafe chaud +.SH FILES +.TP +\fI~/.42shrc\fP +The personal initialization file +.TP +\fI/etc/42shrc\fP +The systemwide initialization file +.SH AUTHORS +Sebastien LUTTRINGER +.br +seblu@seblu.net +.SH "SEE ALSO" +bash (1) \ No newline at end of file diff --git a/src/Makefile.am b/src/Makefile.am index e756508cd9cedaa3b2fe30584ac6fbe7f08dc30b..5abfe8eff564a08444f29797884fa948aa022757 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,3 @@ -#SUBDIRS= bin_PROGRAMS=42sh #42sh_LDADD = parser/libparse.a ../check/leaktrack/libmem.a evalexpr/libevalexpr.a diff --git a/src/ast/ast_print.c b/src/ast/ast_print.c index 68480e786bdbdba4dbda450319e66f6d42a7713a..179bcd1c0b8e92ca151b83c2f41cfe61b354fd9b 100644 --- a/src/ast/ast_print.c +++ b/src/ast/ast_print.c @@ -5,7 +5,7 @@ ** Login ** ** Started on Sat Mar 25 23:11:01 2006 Seblu -** Last update Thu Oct 12 13:12:31 2006 seblu +** Last update Thu Oct 19 13:02:30 2006 seblu */ #include @@ -49,7 +49,7 @@ static char *newastfilename(void); void ast_print(s_ast_node *ast, const char *filename) { FILE *fs; - unsigned int index; + unsigned int index = 0; if (ast == NULL) return; diff --git a/src/parser/lexer.c b/src/parser/lexer.c index 7c6a365605f6859129e341fe2b05c544ec1a4518..06ea1a582a89728a6234a2638abd94ea270f8456 100644 --- a/src/parser/lexer.c +++ b/src/parser/lexer.c @@ -5,7 +5,7 @@ ** Login ** ** Started on Sun Jul 30 04:36:53 2006 Seblu -** Last update Wed Oct 18 18:27:39 2006 seblu +** Last update Thu Oct 19 13:18:20 2006 seblu */ #include @@ -181,8 +181,10 @@ s_lexer *lexer_init(int fd) new->stream = getline_open(fd); new->buf = NULL; new->buf_size = new->buf_pos = 0; - token_set(&new->previous, TOK_NONE, NULL); - token_set(&new->current, TOK_NONE, NULL); + //dont use token_set, because it make comparaison on uninitialized values + new->previous.id = new->current.id = TOK_NONE; + new->previous.str = new->current.str = NULL; + new->previous.len = new->current.len = 0; new->eof = 0; return new; }