Forum Discussion
Altera_Forum
Honored Contributor
20 years agothe goahead webserver diff:
Index: LINUX/Makefile =================================================================== --- LINUX/Makefile (修订版 1) +++ LINUX/Makefile (修订版 2) @@ -9,6 +9,11 @@ all: compile +CC = nios2-linux-uclibc-gcc +AR = nios2-linux-uclibc-ar +LD = nios2-linux-uclibc-ld +OBJCOPY = nios2-linux-uclibc-objcopy + ARCH = libwebs.a NAME = webs @@ -56,11 +61,11 @@ ../security.o ../sym.o ../uemf.o ../url.o ../value.o ../md5c.o ../um.o ../umui.o ../websda.o ../emfdb.o ../webrom.o ../webs.o ../websuemf.o main.o -CFLAGS = -DWEBS -DUEMF -DOS="LINUX" -DLINUX $(UMSW) $(DASW) $(SSLSW) $(IFMODSW) +CFLAGS = -DWEBS -DUEMF -DOS="LINUX" -DLINUX -Dfork=vfork -D__uClinux__ $(UMSW) $(DASW) $(SSLSW) $(IFMODSW) OTHERS = -DB_STATS -DB_FILL -DDEBUG DEBUG = -g -Wall IFLAGS = -I.. -LDFLAGS = $(SSLLIB) $(IFMODLIB) +LDFLAGS = $(SSLLIB) $(IFMODLIB) -elf2flt="-s 64000" -Wl,-v -Wl,-d compile: $(NAME) @@ -75,7 +80,7 @@ # $(NAME): Makefile $(ARCH) $(CC) -o $(NAME) $(DEBUG) - $(CFLAGS) $(IFLAGS) + $(CFLAGS) main.o $(ARCH) $(LDFLAGS) clean: @@ -152,4 +157,4 @@ # Transition rules (add -o to put object in right directory) # .c.o: - cc -c -o $@ $(DEBUG) $(CFLAGS) $(IFLAGS) $< + $(CC) -c -o $@ $(DEBUG) $(CFLAGS) $(IFLAGS) $< Index: misc.c =================================================================== --- misc.c (修订版 1) +++ misc.c (修订版 2) @@ -58,7 +58,7 @@ static int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg, int msize); -static int strnlen(char_t *s, unsigned int n); +//static int strnlen(char_t *s, unsigned int n); static void put_char(strbuf_t *buf, char_t c); static void put_string(strbuf_t *buf, char_t *s, int len, int width, int prec, enum flag f); @@ -425,13 +425,13 @@ * Return the length of a string limited by a given length */ -static int strnlen(char_t *s, unsigned int n) -{ - unsigned int len; +//static int strnlen(char_t *s, unsigned int n) +//{ +// unsigned int len; - len = gstrlen(s); - return min(len, n); -} +// len = gstrlen(s); +// return min(len, n); +//} /******************************************************************************/ /*