Merge branch 'windows-paths'
This merges a series of commits that solve a few issues with paths for Windows builds. Variables 'PDDIR' and 'PDBINDIR' now have precedence over 'pdbinpath' as they should. Default paths for 32 bit builds on 64 bit Windows are now implemented (thanks to Lucas Cordiviola). Probing of 'pdincludepath' and 'pdbinpath' through 'ls' is removed to avoid confusing error messages.
This commit is contained in:
commit
a1ad2e9c88
1 changed files with 41 additions and 26 deletions
|
|
@ -100,7 +100,6 @@ version = 0.5.0
|
|||
#
|
||||
# Deprecated path variables:
|
||||
#
|
||||
# - PD_PATH
|
||||
# - pdincludepath
|
||||
# - pdbinpath
|
||||
# - objectsdir
|
||||
|
|
@ -213,10 +212,6 @@ version = 0.5.0
|
|||
# INSTALL
|
||||
# Definition of install program.
|
||||
#
|
||||
# PD_PATH:
|
||||
# Equivalent to PDDIR. Supported for compatibility with pd-extended central
|
||||
# makefile, but deprecated otherwise.
|
||||
#
|
||||
# objectsdir:
|
||||
# Root directory for installation of Pd library directories, like PDLIBDIR but
|
||||
# not overridable by environment. Supported for compatibility with pd-extended
|
||||
|
|
@ -242,7 +237,13 @@ version = 0.5.0
|
|||
#
|
||||
# OSX: /Applications/Pd*.app/Contents/Resources/src
|
||||
#
|
||||
# Windows: %PROGRAMFILES%/pd/src
|
||||
# Windows: %PROGRAMFILES%/Pd/src
|
||||
# %PROGRAMFILES(X86)%/Pd/src (32 bit builds on 64 bit Windows)
|
||||
#
|
||||
# Default search path for binary pd.dll (Windows), overridable by PDBINDIR
|
||||
#
|
||||
# %PROGRAMFILES%/Pd/bin
|
||||
# %PROGRAMFILES(X86)%/Pd/bin (32 bit builds on 64 bit Windows)
|
||||
#
|
||||
# Default location to install pd libraries is platform dependent, and
|
||||
# overridable by PDLIBDIR:
|
||||
|
|
@ -321,7 +322,6 @@ version = 0.5.0
|
|||
# - decide whether to use -static-libgcc or shared dll in MinGW
|
||||
# - cygwin support
|
||||
# - android support
|
||||
# - Windows 64 bit support
|
||||
# - figure out how to handle '$' in filenames
|
||||
# - add makefile template targets dpkg-source dist libdir distclean tags?
|
||||
#
|
||||
|
|
@ -587,20 +587,33 @@ endif
|
|||
|
||||
# Standard paths on Windows contain spaces, and GNU make functions treat such
|
||||
# paths as lists, with unintended effects. Therefore we must use shell function
|
||||
# ls instead of make's wildcard, and probe for each standard path individually.
|
||||
# Using double quotes around paths with spaces is obligatory. Since some path
|
||||
# variables are assembled or re-expanded later, great care must be taken to put
|
||||
# quotes at appropriate points throughout the makefile. Thanks, Bill.
|
||||
# ls instead of make's wildcard when probing for a path, and use double quotes
|
||||
# when specifying a path in a command argument.
|
||||
|
||||
# paths for 32-bit executables on 64-bit Windows aren't yet defined here (TODO)
|
||||
# Default paths in Mingw / Mingw-w64 environments. 'PROGRAMFILES' is standard
|
||||
# location for builds with native architecture, 'ProgramFiles(x86)' for i686
|
||||
# builds on x86_64 Windows (detection method by Lucas Cordiviola). Curly braces
|
||||
# required because of parentheses in variable name.
|
||||
ifeq ($(system), Windows)
|
||||
pkglibdir := $(APPDATA)/Pd
|
||||
ifndef pdbinpath
|
||||
pdbinpath := $(shell ls -d "$(PROGRAMFILES)/pd/bin")
|
||||
ifeq ($(MINGW_CHOST), i686-w64-mingw32)
|
||||
programfiles := ${ProgramFiles(x86)}
|
||||
else
|
||||
programfiles := $(PROGRAMFILES)
|
||||
endif
|
||||
ifndef pdincludepath
|
||||
pdincludepath := $(shell ls -d "$(PROGRAMFILES)/pd/src")
|
||||
pdbinpath := $(programfiles)/Pd/bin
|
||||
pdincludepath := $(programfiles)/Pd/src
|
||||
endif
|
||||
|
||||
# Store default path to pd.dll in PDBINDIR if the latter is not user-defined.
|
||||
# For include path this is done in the platform-independent paths section below,
|
||||
# but for PDBINDIR it is done here so ld flags can be evaluated as immediate
|
||||
# variables.
|
||||
ifeq ($(system), Windows)
|
||||
ifdef PDDIR
|
||||
PDBINDIR := $(PDDIR)/bin
|
||||
endif
|
||||
PDBINDIR ?= $(pdbinpath)
|
||||
endif
|
||||
|
||||
# TODO: decide whether -mms-bitfields should be specified.
|
||||
|
|
@ -616,15 +629,15 @@ ifeq ($(system), Windows)
|
|||
endif
|
||||
extension = dll
|
||||
c.flags :=
|
||||
c.ldflags = -static-libgcc -shared \
|
||||
-Wl,--enable-auto-import "$(pdbinpath)/pd.dll"
|
||||
c.ldflags := -static-libgcc -shared \
|
||||
-Wl,--enable-auto-import "$(PDBINDIR)/pd.dll"
|
||||
c.ldlibs :=
|
||||
cxx.flags := -fcheck-new
|
||||
cxx.ldflags = -static-libstdc++ -shared \
|
||||
-Wl,--enable-auto-import "$(pdbinpath)/pd.dll"
|
||||
cxx.ldflags := -static-libstdc++ -shared \
|
||||
-Wl,--enable-auto-import "$(PDBINDIR)/pd.dll"
|
||||
cxx.ldlibs :=
|
||||
shared.extension = dll
|
||||
shared.ldflags = -static-libgcc -shared "$(pdbinpath)/pd.dll"
|
||||
shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd.dll"
|
||||
stripflags = --strip-unneeded -R .note -R .comment
|
||||
endif
|
||||
|
||||
|
|
@ -634,17 +647,14 @@ endif
|
|||
|
||||
# Platform-dependent default paths are specified above, but overridable.
|
||||
# Path variables in upper case can be defined as make command argument or in the
|
||||
# environment. 'PD_PATH' and 'objectsdir' are supported for compatibility with
|
||||
# environment. Variable 'objectsdir' is supported for compatibility with
|
||||
# the build system that pd-l2ork has inherited from pd-extended.
|
||||
|
||||
PDDIR ?= $(PD_PATH)
|
||||
PDINCLUDEDIR ?= $(pdincludepath)
|
||||
PDBINDIR ?= $(pdbinpath)
|
||||
PDLIBDIR ?= $(firstword $(objectsdir) $(pkglibdir))
|
||||
|
||||
ifneq ($(PDDIR),)
|
||||
ifdef PDDIR
|
||||
PDINCLUDEDIR := $(wildcard $(PDDIR)/src)
|
||||
PDBINDIR := $(wildcard $(PDDIR)/bin)
|
||||
endif
|
||||
|
||||
# base path where all components of the lib will be installed by default
|
||||
|
|
@ -736,6 +746,11 @@ ifdef PDINCLUDEDIR
|
|||
mpdh := $(shell ls "$(PDINCLUDEDIR)/m_pd.h")
|
||||
endif
|
||||
|
||||
# store path to pd.dll; if not found, ls will give a useful error
|
||||
ifeq ($(system), Windows)
|
||||
pddll := $(shell ls "$(PDBINDIR)/pd.dll")
|
||||
endif
|
||||
|
||||
# print Makefile.pdlibbuilder version
|
||||
$(info ++++ info: using Makefile.pdlibbuilder version $(version))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue