Changeset 4952
- Timestamp:
- Nov 21, 2009 8:54:02 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
-
Makefile (modified) (1 diff)
-
src/arch/i386/Makefile.inc (modified) (1 diff)
-
util/cbfstool/cbfs-mkpayload.c (modified) (1 diff)
-
util/cbfstool/common.h (modified) (1 diff)
-
util/cbfstool/lzma/C/Common/Alloc.cpp (modified) (1 diff)
-
util/kconfig/Makefile (modified) (4 diffs)
-
util/kconfig/confdata.c (modified) (4 diffs)
-
util/kconfig/regex.c (added)
-
util/kconfig/regex.h (added)
-
util/kconfig/symbol.c (modified) (3 diffs)
-
util/options/build_opt_tbl.c (modified) (3 diffs)
-
util/romcc/romcc.c (modified) (7 diffs)
-
util/xcompile/xcompile (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile
r4939 r4952 312 312 313 313 $(obj)/ldoptions: $(obj)/config.h 314 # cat $(obj)/config.h | grep -v \" |grep -v AUTOCONF_INCLUDED | grep \#define | sed s/\#define\ // | sed s/\ /\ =\ / | sed 's/$$/;/' > $(obj)/ldoptions 315 awk '/^#define ([^"])* ([^"])*$$/ {print $$2 " = " $$3 ";";}' $< > $@ 316 314 awk '/^#define ([^"])* ([^"])*$$/ {gsub("\\r","",$$3); print $$2 " = " $$3 ";";}' $< > $@ 315 316 _OS=$(shell uname -s |cut -c-7) 317 STACK= 318 ifeq ($(_OS),MINGW32) 319 STACK=-Wl,--stack,16384000 320 endif 321 ifeq ($(_OS),CYGWIN_) 322 STACK=-Wl,--stack,16384000 323 endif 317 324 $(obj)/romcc: $(top)/util/romcc/romcc.c 318 325 @printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n" 319 $(HOSTCC) -g -O2 -Wall -o $@ $<326 $(HOSTCC) -g -O2 $(STACK) -Wall -o $@ $< 320 327 321 328 .PHONY: $(PHONY) prepare prepare2 clean distclean doxygen doxy coreboot -
trunk/src/arch/i386/Makefile.inc
r4934 r4952 44 44 $(obj)/ldscript.ld: $(ldscripts) $(obj)/ldoptions 45 45 printf 'INCLUDE "ldoptions"\n' > $@ 46 printf '$(foreach ldscript,$(ldscripts),INCLUDE "$(ldscript )"\n)' >> $@46 printf '$(foreach ldscript,$(ldscripts),INCLUDE "$(ldscript:$(obj)/%=%)"\n)' >> $@ 47 47 48 48 $(obj)/crt0_includes.h: $(crt0s) 49 printf '$(foreach crt0, $(obj)/config.h $(crt0s),#include "$(crt0)"\n)' > $@49 printf '$(foreach crt0,config.h $(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@ 50 50 51 51 $(obj)/mainboard/$(MAINBOARDDIR)/crt0.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s -
trunk/util/cbfstool/cbfs-mkpayload.c
r4678 r4952 28 28 #include <getopt.h> 29 29 #include <sys/stat.h> 30 #include <arpa/inet.h>31 30 32 31 #include "common.h" -
trunk/util/cbfstool/common.h
r4929 r4952 18 18 19 19 #include <stdint.h> 20 #ifndef WIN32 21 #include <arpa/inet.h> 22 #else 23 #define ntohl(x) (((x)>>24) | ((x)<<24) | (((x)>>8)&0xff00) | (((x)<<8)&0xff0000)) 24 #define htonl ntohl 25 #endif 20 26 21 27 extern void *offset; -
trunk/util/cbfstool/lzma/C/Common/Alloc.cpp
r4250 r4952 97 97 { 98 98 void *res = ::VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)), 99 MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);99 MEM_COMMIT, PAGE_READWRITE); 100 100 if (res != 0) 101 101 return res; -
trunk/util/kconfig/Makefile
r4581 r4952 4 4 5 5 PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config 6 7 _OS=$(shell uname -s |cut -c-7) 8 regex-objs= 9 ifeq ($(_OS),MINGW32) 10 regex-objs=regex.o 11 endif 6 12 7 13 Kconfig := src/Kconfig … … 114 120 lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o 115 121 116 conf-objs := conf.o zconf.tab.o 117 mconf-objs := mconf.o zconf.tab.o $(lxdialog) 122 conf-objs := conf.o zconf.tab.o $(regex-objs) 123 mconf-objs := mconf.o zconf.tab.o $(lxdialog) $(regex-objs) 118 124 kxgettext-objs := kxgettext.o zconf.tab.o 119 125 … … 134 140 ifeq ($(qconf-target),1) 135 141 qconf-cxxobjs := qconf.o 136 qconf-objs := kconfig_load.o zconf.tab.o 142 qconf-objs := kconfig_load.o zconf.tab.o $(regex-objs) 137 143 endif 138 144 139 145 ifeq ($(gconf-target),1) 140 gconf-objs := gconf.o kconfig_load.o zconf.tab.o 146 gconf-objs := gconf.o kconfig_load.o zconf.tab.o $(regex-objs) 141 147 endif 142 148 … … 307 313 $(objk)/conf.o: $(srck)/conf.c 308 314 $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $< 315 $(objk)/regex.o: $(srck)/regex.c 316 $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -DHAVE_STRING_H -c -o $@ $< 309 317 310 318 $(objk)/zconf.tab.o: $(objk)/zconf.tab.c $(objk)/lex.zconf.c \ -
trunk/util/kconfig/confdata.c
r4534 r4952 15 15 #define LKC_DIRECT_LINK 16 16 #include "lkc.h" 17 18 #ifdef WIN32 19 #define mkdir(x,y) mkdir(x) 20 #define UNLINK_IF_NECESSARY(x) unlink(x) 21 #else 22 #define UNLINK_IF_NECESSARY(X) 23 #endif 17 24 18 25 static void conf_warning(const char *fmt, ...) … … 540 547 strcat(dirname, basename); 541 548 strcat(dirname, ".old"); 549 UNLINK_IF_NECESSARY(dirname); 542 550 rename(newname, dirname); 543 551 if (rename(tmpname, newname)) … … 776 784 if (!name) 777 785 name = "include/linux/autoconf.h"; 786 UNLINK_IF_NECESSARY(name); 778 787 if (rename(".tmpconfig.h", name)) 779 788 return 1; … … 785 794 * and this marks the successful completion of the previous steps. 786 795 */ 796 UNLINK_IF_NECESSARY(name); 787 797 if (rename(".tmpconfig", name)) 788 798 return 1; -
trunk/util/kconfig/symbol.c
r4534 r4952 8 8 #include <string.h> 9 9 #include <regex.h> 10 #ifndef WIN32 10 11 #include <sys/utsname.h> 12 #endif 11 13 12 14 #define LKC_DIRECT_LINK … … 47 49 { 48 50 struct symbol *sym; 51 #ifndef WIN32 49 52 struct utsname uts; 53 #endif 50 54 static bool inited = false; 51 55 … … 54 58 inited = true; 55 59 60 #ifndef WIN32 56 61 uname(&uts); 62 #endif 57 63 58 64 sym = sym_lookup("UNAME_RELEASE", 0); 59 65 sym->type = S_STRING; 60 66 sym->flags |= SYMBOL_AUTO; 67 #ifndef WIN32 61 68 sym_add_default(sym, uts.release); 69 #else 70 sym_add_default(sym, ""); 71 #endif 62 72 } 63 73 -
trunk/util/options/build_opt_tbl.c
r4684 r4952 22 22 static unsigned char clip[9]={0,1,3,7,0x0f,0x1f,0x3f,0x7f,0xff}; 23 23 24 #ifdef WIN32 25 #include <fcntl.h> 26 char* mkstemp(char* name) { 27 static char val='0'; 28 char *c=name; 29 while (*c!='X') c++; 30 *c=val++; 31 return open(name,O_CREAT | O_RDWR); 32 } 33 #define UNLINK_IF_NECESSARY(x) unlink(x) 34 #else 35 #define UNLINK_IF_NECESSARY(x) 36 #endif 24 37 25 38 /* This routine loops through the entried and tests if any of the fields overlap … … 532 545 533 546 fclose(fp); 547 UNLINK_IF_NECESSARY(option); 534 548 if (rename(tmpfilename, option)) { 535 549 fprintf(stderr, "Error - Could not write %s: ", option); … … 585 599 fclose(fp); 586 600 601 UNLINK_IF_NECESSARY(header); 587 602 if (rename(tmpfilename, header)) { 588 603 fprintf(stderr, "Error - Could not write %s: ", header); -
trunk/util/romcc/romcc.c
r4938 r4952 220 220 { 221 221 char cwd[MAX_CWD_SIZE]; 222 int fd;223 222 char *buf; 224 223 off_t size, progress; 225 224 ssize_t result; 226 struct stat stats;225 FILE* file; 227 226 228 227 if (!filename) { … … 234 233 } 235 234 xchdir(dirname); 236 f d = open(filename, O_RDONLY);235 file = fopen(filename, "rb"); 237 236 xchdir(cwd); 238 if (f d < 0) {237 if (file == NULL) { 239 238 die("Cannot open '%s' : %s\n", 240 239 filename, strerror(errno)); 241 240 } 242 result = fstat(fd, &stats); 243 if (result < 0) { 244 die("Cannot stat: %s: %s\n", 245 filename, strerror(errno)); 246 } 247 size = stats.st_size; 241 fseek(file, 0, SEEK_END); 242 size = ftell(file); 243 fseek(file, 0, SEEK_SET); 248 244 *r_size = size +1; 249 245 buf = xmalloc(size +2, filename); … … 252 248 progress = 0; 253 249 while(progress < size) { 254 result = read(fd, buf + progress, size - progress);250 result = fread(buf + progress, 1, size - progress, file); 255 251 if (result < 0) { 256 252 if ((errno == EINTR) || (errno == EAGAIN)) … … 261 257 progress += result; 262 258 } 263 result = close(fd); 264 if (result < 0) { 265 die("Close of %s failed: %s\n", 266 filename, strerror(errno)); 267 } 259 fclose(file); 268 260 return buf; 269 261 } … … 3864 3856 /* Is this an escaped newline? */ 3865 3857 if (file->join_lines && 3866 (c == '\\') && (pos + size < end) && ( pos[1] == '\n'))3858 (c == '\\') && (pos + size < end) && ((pos[1] == '\n') || ((pos[1] == '\r') && (pos[2] == '\n')))) 3867 3859 { 3860 int cr_offset = ((pos[1] == '\r') && (pos[2] == '\n'))?1:0; 3868 3861 /* At the start of a line just eat it */ 3869 3862 if (pos == file->pos) { 3870 3863 file->line++; 3871 3864 file->report_line++; 3872 file->line_start = pos + size + 1 ;3873 } 3874 pos += size + 1 ;3865 file->line_start = pos + size + 1 + cr_offset; 3866 } 3867 pos += size + 1 + cr_offset; 3875 3868 } 3876 3869 /* Do I need to ga any farther? */ … … 5089 5082 die("cwd buffer to small"); 5090 5083 } 5091 if ( subdir[0] == '/') {5084 if ((subdir[0] == '/') || ((subdir[1] == ':') && ((subdir[2] == '/') || (subdir[2] == '\\')))) { 5092 5085 file->dirname = xmalloc(subdir_len + 1, "dirname"); 5093 5086 memcpy(file->dirname, subdir, subdir_len); … … 15149 15142 } 15150 15143 memset(block, -1, sizeof(*block)); 15144 #ifndef WIN32 15151 15145 xfree(block); 15146 #endif 15152 15147 } 15153 15148 -
trunk/util/xcompile/xcompile
r4902 r4952 8 8 9 9 GCCPREFIX=invalid 10 TMP=`mktemp /tmp/temp.XXXX `10 TMP=`mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz` 11 11 echo "mov %eax, %eax" > ${TMP}.s 12 printf "\x7fELF " > ${TMP}.compare12 printf "\x7fELF\n" > ${TMP}.compare 13 13 for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/i386-elf- i386-elf- ""; do 14 14 if which ${gccprefixes}as 2>/dev/null >/dev/null; then … … 19 19 rm -f ${TMP}.o 20 20 if ${gccprefixes}as --32 -o ${TMP}.o ${TMP}.s; then 21 dd bs=4 count=1 if=${TMP}.o > ${TMP}.test 2>/dev/null21 cut -c-4 ${TMP}.o > ${TMP}.test 2>/dev/null 22 22 if cmp ${TMP}.test ${TMP}.compare; then 23 23 GCCPREFIX=$gccprefixes
Note: See TracChangeset
for help on using the changeset viewer.
