changeset 3124:824f84572d1e

[MSVC] enable pstoedit compilation
author Michael Goffioul <michael.goffioul@gmail.com>
date Sat, 06 Jul 2013 00:06:12 -0400
parents 38ee52ac978e
children 0457ec42059e
files src/msvc-pstoedit-1.patch src/pstoedit.mk
diffstat 2 files changed, 42 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msvc-pstoedit-1.patch	Sat Jul 06 00:06:12 2013 -0400
@@ -0,0 +1,40 @@
+diff -ur pstoedit-3.61-orig/src/dynload.cpp pstoedit-3.61/src/dynload.cpp
+--- pstoedit-3.61-orig/src/dynload.cpp	2012-08-28 09:52:31 -0400
++++ pstoedit-3.61/src/dynload.cpp	2013-07-05 23:48:11 -0400
+@@ -434,7 +434,7 @@
+ //              errstream << "szExePath " << szExePath << endl;
+ 
+ 					if ((STRICMP(fullname, szExePath) != 0)
+-						&& (STRICMP(finddata.cFileName, "pstoedit.dll") != 0)) {
++						&& (strstr(finddata.cFileName, "pstoedit") == NULL)) {
+ 						// avoid loading dll itself again
+ 						//                 errstream << "loading " << fullname << endl;
+ 						loadaPlugin(fullname, errstream, verbose);
+diff -ur pstoedit-3.61-orig/src/miscutil.cpp pstoedit-3.61/src/miscutil.cpp
+--- pstoedit-3.61-orig/src/miscutil.cpp	2012-08-28 09:52:31 -0400
++++ pstoedit-3.61/src/miscutil.cpp	2013-07-05 23:36:21 -0400
+@@ -26,7 +26,7 @@
+ // #ifdef _MSC_VER
+ // for getcwd ( at least for Visual C++)
+ 
+-#if defined(unix) || defined(__unix__) || defined(_unix) || defined(__unix) || defined(__EMX__) || defined (NetBSD) || defined(__APPLE__) || defined(_AIX)
++#if defined(unix) || defined(__unix__) || defined(_unix) || defined(__unix) || defined(__EMX__) || defined (NetBSD) || defined(__APPLE__) || defined(_AIX) || defined(_MSC_VER)
+ #include <unistd.h>
+ 
+ #ifdef __hpux
+diff -ur pstoedit-3.61-orig/src/pstoedit.cpp pstoedit-3.61/src/pstoedit.cpp
+--- pstoedit-3.61-orig/src/pstoedit.cpp	2012-08-28 09:52:31 -0400
++++ pstoedit-3.61/src/pstoedit.cpp	2013-07-05 23:50:53 -0400
+@@ -263,7 +263,12 @@
+ 	if (verbose)  errstream << "pstoedit : path to myself:" << progname << " " << r << " " << szExePath<< endl;
+ 	char *p = 0;
+ 	if (r && (p = strrchr(szExePath, directoryDelimiter)) != 0) {
++		int len;
+ 		*p = '\0';
++                if ((len = strlen (szExePath)) >= 4 && STRICMP (&szExePath[len-4], "\\bin") == 0) {
++                        strcpy (&szExePath[len-3], "lib");
++                        strncat (szExePath, "\\pstoedit", sizeof (szExePath));
++                }
+ 		if (strcmp(szExePath, plugindir.value() ? plugindir.value() : "") != 0) {
+ 			loadPlugInDrivers(szExePath, errstream,verbose);
+ 			pluginsloaded = true;
--- a/src/pstoedit.mk	Sat Jul 06 00:05:27 2013 -0400
+++ b/src/pstoedit.mk	Sat Jul 06 00:06:12 2013 -0400
@@ -20,7 +20,8 @@
     cd '$(1)/.build' && '$(1)/configure' \
         $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
         $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
-        --prefix='$(HOST_PREFIX)'
+        --prefix='$(HOST_PREFIX)' \
+	&& $(CONFIGURE_POST_HOOK)
 
     $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install
 endef