Skip to content

Commit 244dea1

Browse files
committed
Get things compiling on Linux again under Unreal 4.21
1 parent 28cfe9c commit 244dea1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+17534
-4
lines changed

Source/UnrealEnginePython/UnrealEnginePython.Build.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ public class UnrealEnginePython : ModuleRules
4343
"/usr/local/include/python3.7m",
4444
"/usr/local/include/python3.6",
4545
"/usr/local/include/python3.6m",
46-
"/usr/local/include/python3.5",
46+
// "/usr/local/include/python3.5",
4747
"/usr/local/include/python3.5m",
4848
"/usr/local/include/python2.7",
4949
"/usr/include/python3.7",
5050
"/usr/include/python3.7m",
5151
"/usr/include/python3.6",
5252
"/usr/include/python3.6m",
53-
"/usr/include/python3.5",
53+
// "/usr/include/python3.5",
5454
"/usr/include/python3.5m",
5555
"/usr/include/python2.7",
5656
};
@@ -255,6 +255,8 @@ public UnrealEnginePython(TargetInfo Target)
255255
System.Console.WriteLine("Discovered Python includes in " + includesPath);
256256
System.Console.WriteLine("Discovered Python lib at " + libsPath);
257257
PublicIncludePaths.Add(includesPath);
258+
// PublicIncludePaths.Add("/usr/include");
259+
// PublicIncludePaths.Add("/home/a/src/deepdrive-sim-2.1/Plugins/UnrealEnginePython/linux/include");
258260
PublicAdditionalLibraries.Add(libsPath);
259261

260262
}
@@ -333,7 +335,9 @@ private string DiscoverPythonPath(string[] knownPaths, string binaryPath)
333335
private string DiscoverLinuxPythonIncludesPath()
334336
{
335337
List<string> paths = new List<string>(linuxKnownIncludesPaths);
336-
paths.Insert(0, Path.Combine(ModuleDirectory, "../../linux", "python3.5m", "include"));
338+
string projPy35path = Path.Combine(ModuleDirectory, "../../linux", "python3.5m", "include");
339+
System.Console.WriteLine("Adding project python include path: " + projPy35path);
340+
paths.Insert(0, projPy35path);
337341
paths.Insert(0, Path.Combine(ModuleDirectory, "../../Binaries", "Linux", "include"));
338342
foreach (string path in paths)
339343
{
@@ -350,7 +354,9 @@ private string DiscoverLinuxPythonIncludesPath()
350354
private string DiscoverLinuxPythonLibsPath()
351355
{
352356
List<string> paths = new List<string>(linuxKnownLibsPaths);
353-
paths.Insert(0, Path.Combine(ModuleDirectory, "../../linux", "x86_64-linux-gnu", "libpython3.5m.so"));
357+
string projPy35path = Path.Combine(ModuleDirectory, "../../linux", "x86_64-linux-gnu", "libpython3.5m.so");
358+
System.Console.WriteLine("Adding project python lib path: " + projPy35path);
359+
paths.Insert(0, projPy35path);
354360
paths.Insert(0, Path.Combine(ModuleDirectory, "../../Binaries", "Linux", "lib"));
355361
paths.Insert(0, Path.Combine(ModuleDirectory, "../../Binaries", "Linux", "lib64"));
356362
foreach (string path in paths)

linux/python3.5m/include/ImDib.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* The Python Imaging Library
3+
* $Id$
4+
*
5+
* Windows DIB specifics
6+
*
7+
* Copyright (c) Secret Labs AB 1997-98.
8+
* Copyright (c) Fredrik Lundh 1996.
9+
*
10+
* See the README file for information on usage and redistribution.
11+
*/
12+
13+
#ifdef _WIN32
14+
15+
#include "ImPlatform.h"
16+
17+
#if defined(__cplusplus)
18+
extern "C" {
19+
#endif
20+
21+
struct ImagingDIBInstance {
22+
/* Windows interface */
23+
HDC dc;
24+
HBITMAP bitmap;
25+
HGDIOBJ old_bitmap;
26+
BITMAPINFO *info;
27+
UINT8 *bits;
28+
HPALETTE palette;
29+
/* Used by cut and paste */
30+
char mode[4];
31+
int xsize, ysize;
32+
int pixelsize;
33+
int linesize;
34+
ImagingShuffler pack;
35+
ImagingShuffler unpack;
36+
};
37+
38+
typedef struct ImagingDIBInstance* ImagingDIB;
39+
40+
extern char* ImagingGetModeDIB(int size_out[2]);
41+
42+
extern ImagingDIB ImagingNewDIB(const char *mode, int xsize, int ysize);
43+
44+
extern void ImagingDeleteDIB(ImagingDIB im);
45+
46+
extern void ImagingDrawDIB(ImagingDIB dib, void *dc, int dst[4], int src[4]);
47+
extern void ImagingExposeDIB(ImagingDIB dib, void *dc);
48+
49+
extern int ImagingQueryPaletteDIB(ImagingDIB dib, void *dc);
50+
51+
extern void ImagingPasteDIB(ImagingDIB dib, Imaging im, int xy[4]);
52+
53+
#if defined(__cplusplus)
54+
}
55+
#endif
56+
57+
#endif
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* The Python Imaging Library
3+
* $Id$
4+
*
5+
* platform declarations for the imaging core library
6+
*
7+
* Copyright (c) Fredrik Lundh 1995-2003.
8+
*/
9+
10+
#include "Python.h"
11+
12+
/* Check that we have an ANSI compliant compiler */
13+
#ifndef HAVE_PROTOTYPES
14+
#error Sorry, this library requires support for ANSI prototypes.
15+
#endif
16+
#ifndef STDC_HEADERS
17+
#error Sorry, this library requires ANSI header files.
18+
#endif
19+
20+
#if defined(PIL_NO_INLINE)
21+
#define inline
22+
#else
23+
#if defined(_MSC_VER) && !defined(__GNUC__)
24+
#define inline __inline
25+
#endif
26+
#endif
27+
28+
#ifdef _WIN32
29+
30+
#define WIN32_LEAN_AND_MEAN
31+
#include <Windows.h>
32+
33+
#else
34+
/* For System that are not Windows, we'll need to define these. */
35+
36+
#if SIZEOF_SHORT == 2
37+
#define INT16 short
38+
#elif SIZEOF_INT == 2
39+
#define INT16 int
40+
#else
41+
#define INT16 short /* most things works just fine anyway... */
42+
#endif
43+
44+
#if SIZEOF_SHORT == 4
45+
#define INT32 short
46+
#elif SIZEOF_INT == 4
47+
#define INT32 int
48+
#elif SIZEOF_LONG == 4
49+
#define INT32 long
50+
#else
51+
#error Cannot find required 32-bit integer type
52+
#endif
53+
54+
#if SIZEOF_LONG == 8
55+
#define INT64 long
56+
#elif SIZEOF_LONG_LONG == 8
57+
#define INT64 long
58+
#endif
59+
60+
#define INT8 signed char
61+
#define UINT8 unsigned char
62+
63+
#define UINT16 unsigned INT16
64+
#define UINT32 unsigned INT32
65+
66+
#endif
67+
68+
/* assume IEEE; tweak if necessary (patches are welcome) */
69+
#define FLOAT32 float
70+
#define FLOAT64 double
71+
72+
#ifdef _MSC_VER
73+
typedef signed __int64 int64_t;
74+
#endif
75+
76+
#ifdef __GNUC__
77+
#define GCC_VERSION (__GNUC__ * 10000 \
78+
+ __GNUC_MINOR__ * 100 \
79+
+ __GNUC_PATCHLEVEL__)
80+
#endif

0 commit comments

Comments
 (0)