| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 929849d commit 927bbf1
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,13 @@ UCS ?= $(shell $(PYTHON) -c "import sys; \ | |||
| 16 | 16 | SITEPACKAGES = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; \ | |
| 17 | 17 | print get_python_lib(plat_specific=1, standard_lib=0)") | |
| 18 | 18 | INSTALL=/usr/bin/install -m644 | |
| 19 | + # Contributed by VIKAS DHIMAN - - Thanks, Vikas! | ||
| 20 | + ARCH_FULL = $(shell uname -m) | ||
| 21 | + ifneq (, $(findstring 86, $(ARCH_FULL))) | ||
| 22 | + ARCH = x86 | ||
| 23 | + else | ||
| 24 | + ARCH = x64 | ||
| 25 | + endif | ||
| 19 | 26 | ||
| 20 | 27 | ifeq ($(origin WINDIR), undefined) | |
| 21 | 28 | RUNNER = mono | |
@@ -70,6 +77,15 @@ Python.Runtime.dll: $(RUNTIME_CS) | |||
| 70 | 77 | $(CSC) /unsafe /target:library \ | |
| 71 | 78 | $(RUNTIME_REF) /out:../../Python.Runtime.dll /recurse:*.cs | |
| 72 | 79 | ||
| 80 | + # Contributed by VIKAS DHIMAN - - Thanks, Vikas! | ||
| 81 | + src/runtime/clrmodule.il: src/runtime/clrmodule.pp.il | ||
| 82 | + ifeq ($(origin WINDIR), undefined) | ||
| 83 | + cd "$(BASEDIR)/src/runtime";\ | ||
| 84 | + $(CPP) -C -P -x c++ -I $(ARCH) clrmodule.pp.il -o clrmodule.il | ||
| 85 | + else | ||
| 86 | + cd "$(BASEDIR)/src/runtime";\ | ||
| 87 | + cp oldmodule.il clrmodule.il | ||
| 88 | + endif | ||
| 73 | 89 | ||
| 74 | 90 | clr.pyd: Python.Runtime.dll src/runtime/clrmodule.il | |
| 75 | 91 | $(ILASM) /nologo /dll /quiet /output=clr.pyd \ | |
@@ -106,7 +122,7 @@ realclean: clean | |||
| 106 | 122 | rm -f Python*.il Python*.il2 Python*.res | |
| 107 | 123 | rm -rf build/ | |
| 108 | 124 | cd src/console; rm -rf bin; rm -rf obj; cd ../..; | |
| 109 | - cd src/runtime; rm -rf bin; rm -rf obj; cd ../..; | ||
| 125 | + cd src/runtime; rm -rf bin; rm -rf obj; rm clrmodule.il; cd ../..; | ||
| 110 | 126 | cd src/testing; rm -rf bin; rm -rf obj; cd ../..; | |
| 111 | 127 | cd src/embed_tests; rm -rf bin; rm -rf obj; rm -f TestResult.xml; cd ../..; | |
| 112 | 128 | cd src/monoclr; make clean; cd ../.. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ def pkgconfig(*packages, **kw): | |||
| 24 | 24 | """From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502261 | |
| 25 | 25 | """ | |
| 26 | 26 | flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} | |
| 27 | - cmd = "pkg-config --libs --cflags %s" % ' '.join(packages) | ||
| 27 | + cmd = "export PKG_CONFIG_PATH=/opt/mono-2.8/lib/pkgconfig:/lib/pkgconfig; pkg-config --libs --cflags %s" % ' '.join(packages) | ||
| 28 | 28 | popen = subprocess.Popen(cmd, shell=True, close_fds=True, stdout=subprocess.PIPE) | |
| 29 | 29 | popen.wait() | |
| 30 | 30 | if popen.returncode != 0: | |
@@ -41,11 +41,13 @@ def pkgconfig(*packages, **kw): | |||
| 41 | 41 | kw[k] = list(set(v)) | |
| 42 | 42 | ||
| 43 | 43 | return kw | |
| 44 | + argsDict = pkgconfig('mono-2') | ||
| 45 | + argsDict['include_dirs'] += ['/opt/mono-2.8/include','/include:usr/include','/usr/include/glib-2.0','/usr/lib/glib-2.0/include'] | ||
| 44 | 46 | ||
| 45 | 47 | clr = Extension('clr', | |
| 46 | 48 | ['src/monoclr/clrmod.c', 'src/monoclr/pynetinit.c'], | |
| 47 | 49 | depends=['src/monoclr/pynetclr.h'], | |
| 48 | - **pkgconfig('mono') | ||
| 50 | + **argsDict | ||
| 49 | 51 | ) | |
| 50 | 52 | ||
| 51 | 53 | extensions = [] | |
@@ -55,4 +57,4 @@ def pkgconfig(*packages, **kw): | |||
| 55 | 57 | setup(name="clr", | |
| 56 | 58 | ext_modules = extensions, | |
| 57 | 59 | scripts = ["src/monoclr/clrpython%s" % VERSION], | |
| 58 | - ) | ||
| 60 | + ) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,16 +1,23 @@ | |||
| 1 | 1 | # Author: Christian Heimes | |
| 2 | 2 | ||
| 3 | - PYTHON = python2.5 | ||
| 3 | + PYTHON = python | ||
| 4 | 4 | BASENAME = $(shell $(PYTHON) -c "import sys; print 'python%i.%i' % sys.version_info[:2]") | |
| 5 | 5 | GCC = gcc | |
| 6 | 6 | ||
| 7 | + ifeq ($(origin WINDIR), undefined) | ||
| 8 | + DLL_OR_SO = "-shared" | ||
| 9 | + else | ||
| 10 | + DLL_OR_SO = "-dynamiclib" | ||
| 11 | + endif | ||
| 12 | + | ||
| 13 | + | ||
| 7 | 14 | PY_LIBS = $(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars; \ | |
| 8 | - print get_config_vars('BLDLIBRARY')[0]") -lpython | ||
| 15 | + print get_config_vars('BLDLIBRARY')[0]") #-lpython | ||
| 9 | 16 | PY_CFLAGS = -I$(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars; \ | |
| 10 | 17 | print get_config_vars('CFLAGS')[0] + ' -I' + get_config_vars('CONFINCLUDEPY')[0]") | |
| 11 | 18 | ||
| 12 | - MONO_LIBS = $(shell pkg-config --libs mono) | ||
| 13 | - MONO_CFLAGS = $(shell pkg-config --cflags mono) | ||
| 19 | + MONO_LIBS = $(shell pkg-config --libs mono) # Was --libs mono | ||
| 20 | + MONO_CFLAGS = $(shell pkg-config --cflags mono) # Was --cflags mono | ||
| 14 | 21 | ||
| 15 | 22 | LIBS = $(MONO_LIBS) $(PY_LIBS) | |
| 16 | 23 | CFLAGS = $(MONO_CFLAGS) $(PY_CFLAGS) | |
@@ -30,7 +37,7 @@ $(BASENAME): python.c | |||
| 30 | 37 | $(GCC) $(PY_CFLAGS) $(PY_LIBS) python.c -o $(BASENAME) | |
| 31 | 38 | ||
| 32 | 39 | clr.so: clrmod.o pynetinit.o | |
| 33 | - $(GCC) $(LIBS) -dynamiclib pynetinit.o clrmod.o -o clr.so | ||
| 40 | + $(GCC) $(LIBS) $(DLL_OR_SO) pynetinit.o clrmod.o -o clr.so | ||
| 34 | 41 | ||
| 35 | 42 | clr$(BASENAME): clrpython.o pynetinit.o | |
| 36 | 43 | $(GCC) $(LIBS) clrpython.o pynetinit.o -o clr$(BASENAME) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,12 +12,13 @@ | |||
| 12 | 12 | #ifndef PYNET_CLR_H | |
| 13 | 13 | #define PYNET_CLR_H | |
| 14 | 14 | ||
| 15 | + #include <Python.h> | ||
| 15 | 16 | #include <mono/jit/jit.h> | |
| 16 | 17 | #include <mono/metadata/environment.h> | |
| 17 | 18 | #include <mono/metadata/mono-config.h> | |
| 18 | 19 | #include <mono/metadata/debug-helpers.h> | |
| 19 | 20 | #include <mono/metadata/assembly.h> | |
| 20 | - #include <Python.h> | ||
| 21 | + #include <glib.h> | ||
| 21 | 22 | ||
| 22 | 23 | #define MONO_VERSION "v2.0.50727" | |
| 23 | 24 | #define MONO_DOMAIN "Python.Runtime" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments