View Single Post
Old 01-17-2009, 06:39 PM   #20
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
here is the patch to setup.py to use the INCLUDE environment variable if set, and otherwise use your old preset values:

Code:
@@ -412,11 +412,16 @@
                                   )
                  ]
     if iswindows:
+        sEnvInclude = os.environ.get('INCLUDE')
+        if sEnvInclude is None :
+            linclude_dirs=['C:/WinDDK/6001.18001/inc/api/',
+                          'C:/WinDDK/6001.18001/inc/crt/']
+        else:
+            linclude_dirs = sEnvInclude.split(';')
         ext_modules.append(Extension('calibre.plugins.winutil',
                 sources=['src/calibre/utils/windows/winutil.c'],
                 libraries=['shell32', 'setupapi'],
-                include_dirs=['C:/WinDDK/6001.18001/inc/api/',
-                              'C:/WinDDK/6001.18001/inc/crt/'],
+                include_dirs=linclude_dirs,
                 extra_compile_args=['/X']
                 ))
     if isosx:
Please feel free to recode more elegantly (which I am sure is possible).
itimpi is offline   Reply With Quote