Skip to content

Commit 601b6b8

Browse files
committed
Tweaks for building with static thirdparty libs on Linux
Sneak in a function used by makewheel
1 parent 056ea94 commit 601b6b8

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

makepanda/makepanda.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,10 @@ def parseopts(args):
561561
LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
562562
#LibName(pkg, 'ddraw.lib')
563563
LibName(pkg, 'dxguid.lib')
564+
565+
if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
566+
IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
567+
564568
IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
565569
LibName("WINSOCK", "wsock32.lib")
566570
LibName("WINSOCK2", "wsock32.lib")
@@ -766,9 +770,13 @@ def parseopts(args):
766770
SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
767771
SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
768772

769-
if GetTarget() == "darwin" and not PkgSkip("FFMPEG"):
770-
LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
771-
LibName("FFMPEG", "-framework VideoDecodeAcceleration")
773+
if not PkgSkip("FFMPEG"):
774+
if GetTarget() == "darwin":
775+
LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
776+
LibName("FFMPEG", "-framework VideoDecodeAcceleration")
777+
elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
778+
# Needed when linking ffmpeg statically on Linux.
779+
LibName("FFMPEG", "-Wl,-Bsymbolic")
772780

773781
cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
774782
if cv_lib == "opencv_core":

makepanda/makepandacore.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,11 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
14911491
if os.path.isdir(os.path.join(pkg_dir, "include")):
14921492
IncDirectory(target_pkg, os.path.join(pkg_dir, "include"))
14931493

1494+
# Handle cases like freetype2 where the include dir is a subdir under "include"
1495+
for i in incs:
1496+
if os.path.isdir(os.path.join(pkg_dir, "include", i)):
1497+
IncDirectory(target_pkg, os.path.join(pkg_dir, "include", i))
1498+
14941499
if os.path.isdir(os.path.join(pkg_dir, "lib")):
14951500
LibDirectory(target_pkg, os.path.join(pkg_dir, "lib"))
14961501

@@ -2749,6 +2754,13 @@ def GetOrigExt(x):
27492754
def SetOrigExt(x, v):
27502755
ORIG_EXT[x] = v
27512756

2757+
def GetExtensionSuffix():
2758+
target = GetTarget()
2759+
if target == 'windows':
2760+
return '.pyd'
2761+
else:
2762+
return '.so'
2763+
27522764
def CalcLocation(fn, ipath):
27532765
if (fn.count("/")): return fn
27542766
dllext = ""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy