diff options
Diffstat (limited to 'fontconfig/src')
-rw-r--r-- | fontconfig/src/.gitignore | 4 | ||||
-rw-r--r-- | fontconfig/src/cleangperf.py | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | fontconfig/src/fcatomic.c | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | fontconfig/src/fccache.c | 2 | ||||
-rw-r--r-- | fontconfig/src/fcstdint.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | fontconfig/src/fcxml.c | 3 | ||||
-rw-r--r-- | fontconfig/src/makealias.py | 36 | ||||
-rw-r--r-- | fontconfig/src/makefile | 61 |
8 files changed, 115 insertions, 3 deletions
diff --git a/fontconfig/src/.gitignore b/fontconfig/src/.gitignore new file mode 100644 index 000000000..baffcee29 --- /dev/null +++ b/fontconfig/src/.gitignore @@ -0,0 +1,4 @@ +fcalias.h
+fcaliastail.h
+fcftalias.h
+fcftaliastail.h
\ No newline at end of file diff --git a/fontconfig/src/cleangperf.py b/fontconfig/src/cleangperf.py new file mode 100644 index 000000000..a276312c9 --- /dev/null +++ b/fontconfig/src/cleangperf.py @@ -0,0 +1,8 @@ +import sys,re + +inbuffer=sys.stdin.read() +inbuffer=re.sub(r'[ \t\r\n]*\n[ \t]*',r'\n',inbuffer) +inbuffer=re.sub(r'[ \t\r\n]*,[ \t\r\n]',r',',inbuffer) +inbuffer=re.sub(r'\n#[^\n]+','',inbuffer) +sys.stdout.write(inbuffer) + diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c index c1daed938..c35a829fd 100644..100755 --- a/fontconfig/src/fcatomic.c +++ b/fontconfig/src/fcatomic.c @@ -55,7 +55,7 @@ #include <time.h> #ifdef _WIN32 -#include <direct.h> +#undef mkdir #define mkdir(path,mode) _mkdir(path) #endif diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c index ddcf07030..c37cbe148 100644..100755 --- a/fontconfig/src/fccache.c +++ b/fontconfig/src/fccache.c @@ -876,7 +876,7 @@ bail1: #ifdef _WIN32 -#include <direct.h> +#undef mkdir #define mkdir(path,mode) _mkdir(path) #endif diff --git a/fontconfig/src/fcstdint.h b/fontconfig/src/fcstdint.h new file mode 100644 index 000000000..31da039d9 --- /dev/null +++ b/fontconfig/src/fcstdint.h @@ -0,0 +1,2 @@ +#include <stdint.h> + diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index 2a0d088c1..cd6aa3109 100644..100755 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -1925,7 +1925,8 @@ FcParseUnary (FcConfigParse *parse, FcOp op) static void FcParseDir (FcConfigParse *parse) { - const FcChar8 *attr, *data; + const FcChar8 *attr; + FcChar8 *data; FcChar8 *prefix = NULL, *p; #ifdef _WIN32 FcChar8 buffer[1000]; diff --git a/fontconfig/src/makealias.py b/fontconfig/src/makealias.py new file mode 100644 index 000000000..6afca0901 --- /dev/null +++ b/fontconfig/src/makealias.py @@ -0,0 +1,36 @@ +import sys,os,re,glob + +SRCDIR=sys.argv[1] +HEAD=open(sys.argv[2],"w") +TAIL=open(sys.argv[3],"w") + +#rm -f $HEAD $TAIL +TAIL.write("#if HAVE_GNUC_ATTRIBUTE\n") + +InputFiles=sys.argv[4:] +Names=[] +for Input in InputFiles: + buffer=open(Input,"r").read() + Names.extend(re.findall(r'\n(Fc[^ ]*) *\(',buffer)) + +def SearchCFiles(Name): + Files=glob.glob(os.path.join(SRCDIR,"*.c") ) + for File in Files: + buffer=open(File,"r").read() + res = re.findall(r'\n%s[ \(].*'%Name,buffer) + if res: + File=re.sub(r'^.*[\\/]','',File) + return "__"+re.sub(r'\.c','__',File) + +for Name in Names: + if Name=="FcCacheDir" or Name=="FcCacheSubdir": + continue + + alias="IA__"+Name + HEAD.write("extern __typeof (%s) %s;\n"%(Name,alias)) + HEAD.write("#define %s %s\n"%(Name,alias)) + TAIL.write("#ifdef "+SearchCFiles(Name)+"\n") + TAIL.write("#undef %s\n"%Name) + TAIL.write("extern __typeof (%s) %s;\n"%(Name,Name)) + TAIL.write("#endif\n") +TAIL.write("#endif\n") diff --git a/fontconfig/src/makefile b/fontconfig/src/makefile new file mode 100644 index 000000000..024ca979d --- /dev/null +++ b/fontconfig/src/makefile @@ -0,0 +1,61 @@ +$(OBJDIR)\fcobjshash.gperf: fcobjshash.gperf.h fcobjs.h + cp $< $<.c + $(CPP) -EP -I.. $<.c | \ + python cleangperf.py | \ + gawk '/CUT_OUT_BEGIN/ { no_write=1; next; }; /CUT_OUT_END/ { no_write=0; next; }; { if (!no_write) print; next; };' - > $@.tmp + mv -f $@.tmp $@ + rm $<.c + +$(OBJDIR)\fcobjshash.h: $(OBJDIR)\fcobjshash.gperf + gperf -m 100 $< > $@ + + +load_makefile NORELDBG=1 ..\fc-case\makefile +load_makefile NORELDBG=1 ..\fc-glyphname\makefile +load_makefile NORELDBG=1 ..\fc-lang\makefile + +CSRCS = \ + fcatomic.c \ + fcblanks.c \ + fccache.c \ + fccfg.c \ + fccharset.c \ + fcdbg.c \ + fcdefault.c \ + fcdir.c \ + fcformat.c \ + fcfreetype.c \ + fcfs.c \ + fcinit.c \ + fclang.c \ + fclist.c \ + fcmatch.c \ + fcmatrix.c \ + fcname.c \ + fcobjs.c \ + fcpat.c \ + fcserialize.c \ + fcstat.c \ + fcstr.c \ + fcxml.c \ + ftglue.c + +LIBRARY = libfontconfig + +PUBLIC_FILES = \ + ..\fontconfig\fontconfig.h \ + fcdeprecate.h \ + ..\fontconfig\fcprivate.h + +PUBLIC_FT_FILES = \ + ..\fontconfig\fcfreetype.h + +DEFINES += FC_CACHEDIR="""getenv(\"""TEMP\""")""" FC_DEFAULT_FONTS="""WINDOWSFONTDIR""" +INCLUDES := .. $(OBJDIR) $(INCLUDES) $(MHMAKECONF)\freetype\include $(MHMAKECONF)\libxml2\include $(MHMAKECONF)\iconv\include + +fcalias.h fcaliastail.h: makealias.py $(PUBLIC_FILES) + python makealias.py . fcalias.h fcaliastail.h $(PUBLIC_FILES) + +fcftalias.h fcftaliastail.h: makealias.py $(PUBLIC_FT_FILES) + python makealias.py . fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES) + |