From: <gof...@us...> - 2008-03-26 21:24:19
|
Revision: 4810 http://octave.svn.sourceforge.net/octave/?rev=4810&view=rev Author: goffioul Date: 2008-03-26 14:24:06 -0700 (Wed, 26 Mar 2008) Log Message: ----------- Enable compilation of fontconfig Modified Paths: -------------- trunk/octave-forge/admin/Windows/msvc/run_compilation.sh Added Paths: ----------- trunk/octave-forge/admin/Windows/msvc/libs/fontconfig-2.5.0.diff Added: trunk/octave-forge/admin/Windows/msvc/libs/fontconfig-2.5.0.diff =================================================================== --- trunk/octave-forge/admin/Windows/msvc/libs/fontconfig-2.5.0.diff (rev 0) +++ trunk/octave-forge/admin/Windows/msvc/libs/fontconfig-2.5.0.diff 2008-03-26 21:24:06 UTC (rev 4810) @@ -0,0 +1,197 @@ +diff -urN fontconfig-2.5.0-orig/fc-cache/Makefile.in fontconfig-2.5.0/fc-cache/Makefile.in +--- fontconfig-2.5.0-orig/fc-cache/Makefile.in Wed Nov 14 02:57:07 2007 ++++ fontconfig-2.5.0/fc-cache/Makefile.in Wed Mar 26 21:08:04 2008 +@@ -73,7 +73,7 @@ + binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) + PROGRAMS = $(bin_PROGRAMS) + fc_cache_SOURCES = fc-cache.c +-fc_cache_OBJECTS = fc-cache.$(OBJEXT) ++fc_cache_OBJECTS = fc-cache.$(OBJEXT) dirent.$(OBJEXT) + am__DEPENDENCIES_1 = + fc_cache_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) ${top_builddir}/src/libfontconfig.la +diff -urN fontconfig-2.5.0-orig/fc-cache/dirent.c fontconfig-2.5.0/fc-cache/dirent.c +--- fontconfig-2.5.0-orig/fc-cache/dirent.c Thu Jan 1 00:00:00 1970 ++++ fontconfig-2.5.0/fc-cache/dirent.c Wed Mar 26 21:13:54 2008 +@@ -0,0 +1,60 @@ ++#include "dirent.h" ++#include <windows.h> ++ ++struct __DIR ++{ ++ HANDLE hnd; ++ WIN32_FIND_DATA fd; ++ int dirty; ++ struct direct d; ++ const char *current; ++}; ++ ++DIR * ++opendir (const char *name) ++{ ++ DIR *d = malloc (sizeof (DIR)); ++ static char buffer[MAX_PATH]; ++ ++ strncpy (buffer, name, MAX_PATH); ++ if (buffer[strnlen(buffer, MAX_PATH)-1] != '\\') ++ strncat (buffer, "\\*", MAX_PATH); ++ else ++ strncat (buffer, "*", MAX_PATH); ++ d->current = buffer; ++ d->hnd = FindFirstFile (buffer, &(d->fd)); ++ if (d->hnd == INVALID_HANDLE_VALUE) ++ return 0; ++ d->dirty = 1; ++ return d; ++} ++ ++void ++rewinddir (DIR *d) ++{ ++ if (d->hnd != INVALID_HANDLE_VALUE) ++ FindClose (d->hnd); ++ d->hnd = FindFirstFile (d->current, &(d->fd)); ++ d->dirty = 1; ++} ++ ++void ++closedir (DIR *d) ++{ ++ if (d->hnd != INVALID_HANDLE_VALUE) ++ FindClose (d->hnd); ++ free (d); ++} ++ ++struct direct * ++readdir (DIR *d) ++{ ++ if (! d->dirty) ++ { ++ if (! FindNextFile(d->hnd, &(d->fd))) ++ return 0; ++ } ++ d->d.d_name = d->fd.cFileName; ++ d->dirty = 0; ++ return &(d->d); ++} +diff -urN fontconfig-2.5.0-orig/src/Makefile.in fontconfig-2.5.0/src/Makefile.in +--- fontconfig-2.5.0-orig/src/Makefile.in Wed Nov 14 02:57:08 2007 ++++ fontconfig-2.5.0/src/Makefile.in Wed Mar 26 21:07:35 2008 +@@ -85,7 +85,7 @@ + fccfg.lo fccharset.lo fcdbg.lo fcdefault.lo fcdir.lo \ + fcfreetype.lo fcfs.lo fcinit.lo fclang.lo fclist.lo fcmatch.lo \ + fcmatrix.lo fcname.lo fcpat.lo fcserialize.lo fcstr.lo \ +- fcxml.lo ftglue.lo ++ fcxml.lo ftglue.lo dirent.lo + libfontconfig_la_OBJECTS = $(am_libfontconfig_la_OBJECTS) + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) + depcomp = $(SHELL) $(top_srcdir)/depcomp +@@ -636,9 +636,9 @@ + @MS_LIB_AVAILABLE_FALSE@install-ms-import-lib: + @MS_LIB_AVAILABLE_FALSE@uninstall-ms-import-lib: + +-install-data-local: install-ms-import-lib install-libtool-import-lib ++install-data-local: + +-uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib ++uninstall-local: + + fcaliastail.h: fcalias.h + +diff -urN fontconfig-2.5.0-orig/src/dirent.c fontconfig-2.5.0/src/dirent.c +--- fontconfig-2.5.0-orig/src/dirent.c Thu Jan 1 00:00:00 1970 ++++ fontconfig-2.5.0/src/dirent.c Wed Mar 26 21:14:02 2008 +@@ -0,0 +1,60 @@ ++#include "dirent.h" ++#include <windows.h> ++ ++struct __DIR ++{ ++ HANDLE hnd; ++ WIN32_FIND_DATA fd; ++ int dirty; ++ struct direct d; ++ const char *current; ++}; ++ ++DIR * ++opendir (const char *name) ++{ ++ DIR *d = malloc (sizeof (DIR)); ++ static char buffer[MAX_PATH]; ++ ++ strncpy (buffer, name, MAX_PATH); ++ if (buffer[strnlen(buffer, MAX_PATH)-1] != '\\') ++ strncat (buffer, "\\*", MAX_PATH); ++ else ++ strncat (buffer, "*", MAX_PATH); ++ d->current = buffer; ++ d->hnd = FindFirstFile (buffer, &(d->fd)); ++ if (d->hnd == INVALID_HANDLE_VALUE) ++ return 0; ++ d->dirty = 1; ++ return d; ++} ++ ++void ++rewinddir (DIR *d) ++{ ++ if (d->hnd != INVALID_HANDLE_VALUE) ++ FindClose (d->hnd); ++ d->hnd = FindFirstFile (d->current, &(d->fd)); ++ d->dirty = 1; ++} ++ ++void ++closedir (DIR *d) ++{ ++ if (d->hnd != INVALID_HANDLE_VALUE) ++ FindClose (d->hnd); ++ free (d); ++} ++ ++struct direct * ++readdir (DIR *d) ++{ ++ if (! d->dirty) ++ { ++ if (! FindNextFile(d->hnd, &(d->fd))) ++ return 0; ++ } ++ d->d.d_name = d->fd.cFileName; ++ d->dirty = 0; ++ return &(d->d); ++} +diff -urN fontconfig-2.5.0-orig/src/dirent.h fontconfig-2.5.0/src/dirent.h +--- fontconfig-2.5.0-orig/src/dirent.h Thu Jan 1 00:00:00 1970 ++++ fontconfig-2.5.0/src/dirent.h Wed Mar 26 21:14:02 2008 +@@ -0,0 +1,16 @@ ++#ifndef DIRENT_H ++#define DIRENT_H ++struct direct ++{ ++ char *d_name; ++}; ++#define dirent direct ++typedef struct __DIR DIR; ++extern DIR* opendir (const char *name); ++extern void rewinddir (DIR *d); ++extern void closedir (DIR *d); ++extern struct direct *readdir (DIR *d); ++#define S_ISDIR(x) (((x)&S_IFDIR)!=0) ++#define F_OK 0 ++#define W_OK 2 ++#endif +diff -urN fontconfig-2.5.0-orig/src/fcint.h fontconfig-2.5.0/src/fcint.h +--- fontconfig-2.5.0-orig/src/fcint.h Tue Nov 13 23:23:39 2007 ++++ fontconfig-2.5.0/src/fcint.h Wed Mar 26 21:01:38 2008 +@@ -35,6 +35,9 @@ + #include <inttypes.h> + #elif defined(HAVE_STDINT_H) + #include <stdint.h> ++#elif defined(_MSC_VER) ++typedef __int32 int32_t; ++typedef __int16 int16_t; + #else + #error missing C99 integer data types + #endif Property changes on: trunk/octave-forge/admin/Windows/msvc/libs/fontconfig-2.5.0.diff ___________________________________________________________________ Name: svn:executable + * Modified: trunk/octave-forge/admin/Windows/msvc/run_compilation.sh =================================================================== --- trunk/octave-forge/admin/Windows/msvc/run_compilation.sh 2008-03-26 16:50:37 UTC (rev 4809) +++ trunk/octave-forge/admin/Windows/msvc/run_compilation.sh 2008-03-26 21:24:06 UTC (rev 4810) @@ -477,7 +477,7 @@ todo_check "$tbindir/libglib-2.0-0.dll" glib todo_check "$tbindir/libpango-1.0-0.dll" pango todo_check "$tlibdir/xml2.lib" libxml2 - #todo_check "$tlibdir/fontconfig.lib" fontconfig + todo_check "$tlibdir/fontconfig.lib" fontconfig todo_check "$tlibdir/freetype.lib" freetype todo_check "$tlibdir/gd.lib" libgd todo_check "$tlibdir/gsl.lib" libgsl @@ -1547,31 +1547,24 @@ # fontconfig # ############## -# TODO -# - src/fcint.h: add #elif defined (_MSC_VER)~typedef __int32 int32_t;~typedef __int16 int16_t; -# - src/fccache.c: fix dirent stuffs -# - src/fccfg.c: comment "#include <dirent.h>" -# - src/fcdir.c: fix dirent + S_ISDIR -# - src/fcxml.c: idem -# - fc-cache/fc-cache.c: idem -# - src/Makefile: install-data-local: => remove dependencies - if check_package fontconfig; then download_file fontconfig-$fontconfigver.tar.gz http://fontconfig.org/release/fontconfig-$fontconfigver.tar.gz echo -n "decompressing fontconfig... " unpack_file fontconfig-$fontconfigver.tar.gz + cp libs/fontconfig-$fontconfigver.diff "$DOWNLOAD_DIR/fontconfig-$fontconfigver" echo "done" echo "compiling fontconfig... " (cd "$DOWNLOAD_DIR/fontconfig-$fontconfigver" && - create_module_rc FontConfig $fontconfigver "libfontconfig-2.dll" "Freedesktop (www.freedesktop.org)" \ - "Font Configuration Library" "`grep -e '^ *Copyright' COPYING | head -n 1 | sed -e 's/^ *//'`" > fontconfig.rc && + patch -p1 < fontconfig-$fontconfigver.diff && + create_module_rc FontConfig $fontconfigver "libfontconfig-1.dll" "Freedesktop (www.freedesktop.org)" \ + "Font Configuration Library" "`grep -e '^ *Copyright' COPYING | head -n 1 | sed -e 's/^ *//'`" > src/fontconfig.rc && CC=cc-msvc CFLAGS="-O2 -MD" CXX=cc-msvc CXXFLAGS="-O2 -EHsc -MD" FC=fc-msvc FCFLAGS="-O2 -MD" \ F77=fc-msvc FFLAGS="-O2 -MD" CPPFLAGS="-DWIN32 -D_WIN32" AR=ar-msvc RANLIB=ranlib-msvc \ ./configure --prefix="$tdir_w32_forward" --enable-shared --disable-static --disable-docs --enable-xlm2 && post_process_libtool && - sed -e "s/^libfontconfig_la_LDFLAGS =/libfontconfig_la_LDFLAGS = -Wl,fontconfig.res/" Makefile > ttt && - mv ttt Makefile && - rc -fo fontconfig.res fontconfig.rc && + sed -e "s/^libfontconfig_la_LDFLAGS =/libfontconfig_la_LDFLAGS = -Wl,fontconfig.res/" src/Makefile > ttt && + mv ttt src/Makefile && + (cd src && rc -fo fontconfig.res fontconfig.rc) && make && make install && rm -f "$tlibdir/libfontconfig.la" && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |