From 01bf7d352d87cd0adcf7dd59ccb9bfe875b9856c Mon Sep 17 00:00:00 2001 From: maqiyuan Date: Tue, 22 Jul 2014 15:21:15 +0800 Subject: [PATCH] fixed some typos. --- src/texsourc/Makefile.linux.android.static | 82 ++++++++++++++++++++++++++++++ src/texsourc/Makefile.linux.clang | 2 +- src/texsourc/Makefile.linux.gcc | 2 +- src/texsourc/local.c | 36 ++++++++----- src/texsourc/yandytex.c | 5 +- 5 files changed, 108 insertions(+), 19 deletions(-) create mode 100644 src/texsourc/Makefile.linux.android.static diff --git a/src/texsourc/Makefile.linux.android.static b/src/texsourc/Makefile.linux.android.static new file mode 100644 index 0000000..091224c --- /dev/null +++ b/src/texsourc/Makefile.linux.android.static @@ -0,0 +1,82 @@ +# +# Copyright (c) 2014 Clerk Ma +# +# You may freely use, modify and/or distribute this file. +# +# makefile for linux (tested in ubuntu 14.04: gcc 4.8). +# linked libkpathsea.a and libz.a +# ./configure --prefix=/home/clerk/dev --host=arm-linux-androideabi +# + +CC = arm-linux-androideabi-gcc +CFLAGS = -c -O2 -Wno-unused-result -Ilibmd5 -I/home/clerk/android/include +LDFLAGS = /home/clerk/android/lib/libkpathsea.a -lz + +objects = yandytex.o itex.o openinou.o subroute.o local.o \ + tex0.o tex1.o tex2.o tex3.o tex4.o \ + tex5.o tex6.o tex7.o tex8.o tex9.o \ + pool.o md5.o utils.o + +headers = yandytex.h texd.h coerce.h macros.h memory.h + +yandytex: $(objects) + $(CC) -s -o yandytex $(objects) $(LDFLAGS) + +yandytex.o: yandytex.c $(headers) + $(CC) $(CFLAGS) yandytex.c + +itex.o: itex.c $(headers) + $(CC) $(CFLAGS) itex.c + +openinou.o: openinou.c $(headers) + $(CC) $(CFLAGS) openinou.c + +subroute.o: subroute.c $(headers) + $(CC) $(CFLAGS) subroute.c + +local.o: local.c $(headers) + $(CC) $(CFLAGS) local.c + +tex0.o: tex0.c $(headers) + $(CC) $(CFLAGS) tex0.c + +tex1.o: tex1.c $(headers) + $(CC) $(CFLAGS) tex1.c + +tex2.o: tex2.c $(headers) + $(CC) $(CFLAGS) tex2.c + +tex3.o: tex3.c $(headers) + $(CC) $(CFLAGS) tex3.c + +tex4.o: tex4.c $(headers) + $(CC) $(CFLAGS) tex4.c + +tex5.o: tex5.c $(headers) + $(CC) $(CFLAGS) tex5.c + +tex6.o: tex6.c $(headers) + $(CC) $(CFLAGS) tex6.c + +tex7.o: tex7.c $(headers) + $(CC) $(CFLAGS) tex7.c + +tex8.o: tex8.c $(headers) + $(CC) $(CFLAGS) tex8.c + +tex9.o: tex9.c $(headers) + $(CC) $(CFLAGS) tex9.c + +pool.o: pool.c $(headers) + $(CC) $(CFLAGS) pool.c + +md5.o: libmd5/md5.c $(headers) + $(CC) $(CFLAGS) libmd5/md5.c + +utils.o: utils.c $(headers) + $(CC) $(CFLAGS) utils.c + +.PHONY: clean + +clean: + rm yandytex *.o diff --git a/src/texsourc/Makefile.linux.clang b/src/texsourc/Makefile.linux.clang index 6824f93..597a1ac 100644 --- a/src/texsourc/Makefile.linux.clang +++ b/src/texsourc/Makefile.linux.clang @@ -3,7 +3,7 @@ # # You may freely use, modify and/or distribute this file. # -# makefle for linux (tested in ubuntu 14.04: clang/LLVM 4.3). +# makefile for linux (tested in ubuntu 14.04: clang/LLVM 4.3). # # apt-get install libkpathsea6 libkpathsea-dev # apt-get install zlib1g zlib1g-dev diff --git a/src/texsourc/Makefile.linux.gcc b/src/texsourc/Makefile.linux.gcc index b2968ba..70d86e3 100644 --- a/src/texsourc/Makefile.linux.gcc +++ b/src/texsourc/Makefile.linux.gcc @@ -3,7 +3,7 @@ # # You may freely use, modify and/or distribute this file. # -# makefle for linux (tested in ubuntu 14.04: gcc 4.8). +# makefile for linux (tested in ubuntu 14.04: gcc 4.8). # # apt-get install libkpathsea6 libkpathsea-dev # apt-get install zlib1g zlib1g-dev diff --git a/src/texsourc/local.c b/src/texsourc/local.c index d23494c..4fa5547 100644 --- a/src/texsourc/local.c +++ b/src/texsourc/local.c @@ -29,14 +29,32 @@ #define REALLOC realloc #endif -#if defined(__clang__) +#ifdef __ANDROID__ + #define malloc_usable_size dlmalloc_usable_size +#endif + +#if defined (__clang__) const char * compiler = "Clang/LLVM"; -#elif defined(__GNUC__) || defined(__GNUG__) +#elif defined (__GNUC__) || defined(__GNUG__) const char * compiler = "GCC"; -#elif defined(_MSC_VER) +#elif defined (_MSC_VER) const char * compiler = "MSVC"; #endif +#if defined (_WIN64) +const char * dist = "Win64"; +#elif defined (_WIN32) +const char * dist = "Win32"; +#elif defined (__ANDROID__) +const char * dist = "Android"; +#elif defined (__APPLE__) +const char * dist = "Darwin"; +#elif defined (__gnu_linux__) +const char * dist = "Linux"; +#else +const char * dist = "Unknown"; +#endif + const char * compiletime = __TIME__; const char * compiledate = __DATE__; const char * yandyversion = "2.3.0"; @@ -46,15 +64,7 @@ const char * banner = "This is TeX, Version 3.14159265"; void print_banner (void) { char dist_ver[256]; -#ifdef _WIN32 -#ifdef _WIN64 - sprintf(dist_ver, "%s (%s %s/Win64)", banner, application, yandyversion); -#else - sprintf(dist_ver, "%s (%s %s/Win32)", banner, application, yandyversion); -#endif -#else - sprintf(dist_ver, "%s (%s %s/Linux)", banner, application, yandyversion); -#endif + sprintf(dist_ver, "%s (%s %s/%s)", banner, application, yandyversion, dist); prints(dist_ver); } @@ -98,7 +108,7 @@ unsigned char wintodos[128] = void show_usage (void) { printf("\n" - "Useage: yanytex [OPTION]... [+format_file] [tex_file]\n\n" + "Useage: yandytex [OPTION]... [+format_file] [tex_file]\n\n" "--help -? show this usage summary\n" "--initex -i start up as initex (create format file)\n" "--verbose -v be verbose (show implementation version number)\n" diff --git a/src/texsourc/yandytex.c b/src/texsourc/yandytex.c index e84830a..133b50d 100644 --- a/src/texsourc/yandytex.c +++ b/src/texsourc/yandytex.c @@ -464,12 +464,9 @@ boolean input_line (FILE * f) return input_line_finish(); } -/* This string specifies what the `e' option does in response to an - error message. */ - static char * edit_value = "c:\\yandy\\WinEdt\\WinEdt.exe [Open('%s');SelLine(%d,7)]"; -static int Isspace (char c) +static inline int Isspace (char c) { return (c == ' ' || c == '\t'); } -- 2.11.0