- Timestamp:
- Nov 8, 2011 9:28:16 PM (13 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/Makefile.am
r2538 r2548 53 53 alloccache.c \ 54 54 kbuild.c \ 55 kbuild-read.c \ 55 56 electric.c \ 56 57 ../lib/md5.c \ -
trunk/src/kmk/Makefile.kmk
r2546 r2548 205 205 main.c \ 206 206 kbuild.c \ 207 kbuild-read.c \ 207 208 read.c \ 208 209 expreval.c \ -
trunk/src/kmk/expand.c
r2119 r2548 1116 1116 #ifdef CONFIG_WITH_VALUE_LENGTH 1117 1117 /* Handle the most common case in allocated_variable_expand_for_file 1118 specially and provide some additional string leng htfeatures. */1118 specially and provide some additional string length features. */ 1119 1119 1120 1120 char * -
trunk/src/kmk/kbuild.h
r2413 r2548 39 39 const char *get_default_kbuild_shell(void); 40 40 41 struct kbuild_eval_data; 42 43 int eval_kbuild_define(struct kbuild_eval_data **kdata, const struct floc *flocp, 44 const char *word, unsigned int wlen, const char *line, const char *eos, int ignoring); 45 int eval_kbuild_endef(struct kbuild_eval_data **kdata, const struct floc *flocp, 46 const char *word, unsigned int wlen, const char *line, const char *eos, int ignoring); 47 41 48 #endif 42 49 -
trunk/src/kmk/make.h
r2161 r2548 502 502 char *next_token (const char *); 503 503 char *end_of_token (const char *); 504 #ifdef KMK 505 char *find_next_token_eos (const char **ptr, const char *eos, unsigned int *lengthptr); 506 #endif 504 507 #ifndef CONFIG_WITH_VALUE_LENGTH 505 508 void collapse_continuations (char *); -
trunk/src/kmk/misc.c
r2101 r2548 727 727 #endif 728 728 } 729 #ifdef KMK 730 731 /* Same as find_next_token with two exception: 732 - The string ends at EOS or '\0'. 733 - We keep track of $() and ${}, allowing functions to be used. */ 734 735 char * 736 find_next_token_eos (const char **ptr, const char *eos, unsigned int *lengthptr) 737 { 738 const char *p = *ptr; 739 const char *e; 740 int level = 0; 741 742 /* skip blanks */ 743 for (; p != eos; p++) 744 { 745 unsigned char ch = *p; 746 if (!MY_IS_BLANK(ch)) 747 { 748 if (!ch) 749 return NULL; 750 break; 751 } 752 } 753 if (p == eos) 754 return NULL; 755 756 /* skip ahead until EOS or blanks. */ 757 for (e = p; e != eos; e++) 758 { 759 unsigned char ch = *e; 760 if (MY_IS_BLANK_OR_EOS(ch)) 761 { 762 if (!ch || level == 0) 763 break; 764 } 765 else if (ch == '$') 766 { 767 if (&e[1] != eos && (e[1] == '(' || e[1] == '{')) 768 { 769 level++; 770 e++; 771 } 772 } 773 else if ((ch == ')' || ch == '}') && level > 0) 774 level--; 775 } 776 777 *ptr = e; 778 if (lengthptr != 0) 779 *lengthptr = e - p; 780 781 return (char *)p; 782 } 783 784 #endif /* KMK */ 729 785 730 786 -
trunk/src/kmk/read.c
r2426 r2548 593 593 unsigned int tmp_len; 594 594 #endif 595 #ifdef KMK 596 struct kbuild_eval_data *kdata = 0; 597 int krc; 598 #endif 595 599 596 600 #define record_waiting_files() \ … … 896 900 continue; 897 901 902 #ifdef KMK 903 /* Check for the kBuild language extensions. */ 904 if ( wlen >= sizeof("kBuild-define") - 1 905 && strneq (p, "kBuild-define", sizeof("kBuild-define") - 1)) 906 krc = eval_kbuild_define (&kdata, fstart, p, wlen, p2, eol, ignoring); 907 else if ( wlen >= sizeof("kBuild-endef") - 1 908 && strneq (p, "kBuild-endef", sizeof("kBuild-endef") - 1)) 909 krc = eval_kbuild_endef (&kdata, fstart, p, wlen, p2, eol, ignoring); 910 else 911 krc = 42; 912 if (krc != 42) 913 { 914 if (krc != 0) 915 error (fstart, _("krc=%d"), krc); 916 continue; 917 } 918 919 #endif /* KMK */ 898 920 if (word1eq ("export")) 899 921 { … … 1646 1668 if (conditionals->if_cmds) 1647 1669 fatal (fstart, _("missing `endif'")); 1670 #ifdef KMK 1671 1672 if (kdata != NULL) 1673 fatal (fstart, _("missing `kBuild-endef-*'")); 1674 #endif 1648 1675 1649 1676 /* At eof, record the last rule. */ -
trunk/src/kmk/variable.c
r2532 r2548 1279 1279 && defined (CONFIG_WITH_TOUPPER_TOLOWER) \ 1280 1280 && defined (CONFIG_WITH_DEFINED) \ 1281 && defined (CONFIG_WITH_VALUE_LENGTH) && defined (CONFIG_WITH_COMPARE) \ 1281 && defined (CONFIG_WITH_VALUE_LENGTH) \ 1282 && defined (CONFIG_WITH_COMPARE) \ 1282 1283 && defined (CONFIG_WITH_STACK) \ 1283 1284 && defined (CONFIG_WITH_MATH) \ … … 1302 1303 (void) define_variable ("KMK_FEATURES", 12, 1303 1304 "append-dash-n abspath includedep-queue install-hard-linking" 1305 " kBuild-define" 1304 1306 " rsort" 1305 1307 " abspathex" … … 1331 1333 # else /* MSC can't deal with strings mixed with #if/#endif, thus the slow way. */ 1332 1334 # error "All features should be enabled by default!" 1333 strcpy (buf, "append-dash-n abspath includedep-queue install-hard-linking"); 1335 strcpy (buf, "append-dash-n abspath includedep-queue install-hard-linking" 1336 " kBuild-define"); 1334 1337 # if defined (CONFIG_WITH_RSORT) 1335 1338 strcat (buf, " rsort");
Note:
See TracChangeset
for help on using the changeset viewer.