File tree 3 files changed +40
-2
lines changed
3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change
1
+ PFOLDER=~ /github/python-cmake-buildsystem/Python-3.9.17
2
+ PINCLUDES=" -I${PFOLDER} /Include -I${PFOLDER} /../.build/bin"
3
+ PLIBS=${PFOLDER} /../.build/lib
4
+ P=${PLIBS} /libpython3.9.a
5
+
6
+ # set -x
7
+ gcc -O2 -static -o python_tinykvm \
8
+ -I. ${PINCLUDES} \
9
+ -L${PLIBS} \
10
+ python.c \
11
+ -lpython3.9 \
12
+ -lcrypto \
13
+ -lm -lpthread -ldl -lutil -lrt
14
+
15
+ export PYTHONPATH=" $PFOLDER /../.build/lib/python3.9"
16
+ export PYTHONHOME=" $PWD "
17
+
18
+ ./python_tinykvm
Original file line number Diff line number Diff line change
1
+ #define PY_SSIZE_T_CLEAN
2
+ #include <Python.h>
3
+ #include "../kvm_api.h"
4
+
5
+ int main (int argc , char * * argv )
6
+ {
7
+ Py_Initialize ();
8
+ PyRun_SimpleString ("print('Hello Python World')" );
9
+
10
+ if (IS_LINUX_MAIN ()) {
11
+ Py_Finalize ();
12
+ return 0 ;
13
+ }
14
+
15
+ while (true) {
16
+ struct backend_request req ;
17
+ wait_for_requests_paused (& req );
18
+
19
+ backend_response_str (200 , "text/plain" , "Hello Python World\n" );
20
+ }
21
+ Py_Finalize ();
22
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments