diff -Nru pd-lib-builder-0.5.1/CHANGELOG.txt pd-lib-builder-0.6.0/CHANGELOG.txt --- pd-lib-builder-0.5.1/CHANGELOG.txt 2018-03-15 21:04:08.000000000 +0000 +++ pd-lib-builder-0.6.0/CHANGELOG.txt 2019-12-22 13:18:40.000000000 +0000 @@ -1,5 +1,12 @@ Changelog for Makefile.pdlibbuilder. +v0.6.0, dated 2019-12-21 +- detect target platform (OS and architecture) rather than build platform (#55) +- introduce optional user variable 'PLATFORM' for cross compilation +- no longer build OSX/MacOS fat binaries by default (#21, #50) +- do build fat binaries when 'extension=d_fat' is specified for OSX/MacOS +- fix bug where minimum OSX/MacOS version wasn't defined, and set it to 10.6 + v0.5.1, dated 2018-03-15 Fixes and improvements for Windows builds: - properly evaluate variables 'PDDIR' and 'PDBINDIR' to find pd.dll @@ -32,7 +39,7 @@ (bugfix, pull request #22, commit 48c4127) v0.4.0, dated 2016-10-14 -Introduced path variables PDDIR, PDINCLUDEDIR, PDBINDIR, PDLIBDIR which can +Introduced path variables PDDIR, PDINCLUDEDIR, PDBINDIR, PDLIBDIR which can also be defined in environment. (feature, issue #27, commit b0dab72) diff -Nru pd-lib-builder-0.5.1/debian/changelog pd-lib-builder-0.6.0/debian/changelog --- pd-lib-builder-0.5.1/debian/changelog 2018-03-20 20:17:26.000000000 +0000 +++ pd-lib-builder-0.6.0/debian/changelog 2020-01-08 13:58:36.000000000 +0000 @@ -1,3 +1,19 @@ +pd-lib-builder (0.6.0-1) unstable; urgency=medium + + [ IOhannes m zmölnig ] + * New upstream version 0.6.0 + * Regenerate d/copyright_hints + * Install tips-and-tricks + * Add patch to fix cross-compilation docs + * Drop obsolete d/source/local-options + * Bump dh-compat to 12 + * Bump standards-version to 4.4.1 + + [ Ondřej Nový ] + * Use debhelper-compat instead of debian/compat + + -- IOhannes m zmölnig (Debian/GNU) Wed, 08 Jan 2020 14:58:36 +0100 + pd-lib-builder (0.5.1-1) unstable; urgency=medium * New upstream version 0.5.1 diff -Nru pd-lib-builder-0.5.1/debian/compat pd-lib-builder-0.6.0/debian/compat --- pd-lib-builder-0.5.1/debian/compat 2018-03-20 20:17:26.000000000 +0000 +++ pd-lib-builder-0.6.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru pd-lib-builder-0.5.1/debian/control pd-lib-builder-0.6.0/debian/control --- pd-lib-builder-0.5.1/debian/control 2018-03-20 20:17:26.000000000 +0000 +++ pd-lib-builder-0.6.0/debian/control 2020-01-08 13:58:36.000000000 +0000 @@ -5,8 +5,8 @@ Uploaders: IOhannes m zmölnig (Debian/GNU) , Build-Depends: - debhelper (>=11~), -Standards-Version: 4.1.3 + debhelper-compat (= 12), +Standards-Version: 4.4.1 Homepage: https://github.com/pure-data/pd-lib-builder Vcs-Git: https://salsa.debian.org/multimedia-team/pd/pd-lib-builder.git Vcs-Browser: https://salsa.debian.org/multimedia-team/pd/pd-lib-builder diff -Nru pd-lib-builder-0.5.1/debian/copyright_hints pd-lib-builder-0.6.0/debian/copyright_hints --- pd-lib-builder-0.5.1/debian/copyright_hints 2018-03-20 20:17:26.000000000 +0000 +++ pd-lib-builder-0.6.0/debian/copyright_hints 2020-01-08 13:58:36.000000000 +0000 @@ -9,9 +9,10 @@ ./README.md ./debian/README.source ./debian/changelog - ./debian/compat ./debian/control ./debian/gbp.conf + ./debian/patches/fix-crosscompilation-docs.patch + ./debian/patches/series ./debian/pd-lib-builder.docs ./debian/pd-lib-builder.install ./debian/rules diff -Nru pd-lib-builder-0.5.1/debian/patches/fix-crosscompilation-docs.patch pd-lib-builder-0.6.0/debian/patches/fix-crosscompilation-docs.patch --- pd-lib-builder-0.5.1/debian/patches/fix-crosscompilation-docs.patch 1970-01-01 00:00:00.000000000 +0000 +++ pd-lib-builder-0.6.0/debian/patches/fix-crosscompilation-docs.patch 2020-01-08 13:58:36.000000000 +0000 @@ -0,0 +1,17 @@ +Description: fixed confusing documentation about cross-compilation +Author: IOhannes m zmölnig +Bug: https://github.com/pure-data/pd-lib-builder/issues/57 +Last-Update: 2020-01-08 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- pd-lib-builder.orig/tips-tricks.md ++++ pd-lib-builder/tips-tricks.md +@@ -3,7 +3,7 @@ + + # Creating special builds + +-## cross-compiling on linux x86_64 for other platforms ++## cross-compiling on linux for other platforms and architectures + + Using pd-lib-builder >=0.6.0 we can define variable `PLATFORM` to specify a + target triplet for cross-compilation. Example to build W32 binaries (assuming diff -Nru pd-lib-builder-0.5.1/debian/patches/series pd-lib-builder-0.6.0/debian/patches/series --- pd-lib-builder-0.5.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ pd-lib-builder-0.6.0/debian/patches/series 2020-01-08 13:58:36.000000000 +0000 @@ -0,0 +1 @@ +fix-crosscompilation-docs.patch diff -Nru pd-lib-builder-0.5.1/debian/pd-lib-builder.docs pd-lib-builder-0.6.0/debian/pd-lib-builder.docs --- pd-lib-builder-0.5.1/debian/pd-lib-builder.docs 2018-03-20 20:17:26.000000000 +0000 +++ pd-lib-builder-0.6.0/debian/pd-lib-builder.docs 2020-01-08 13:58:36.000000000 +0000 @@ -1 +1,2 @@ README.md +tips-tricks.md diff -Nru pd-lib-builder-0.5.1/Makefile.pdlibbuilder pd-lib-builder-0.6.0/Makefile.pdlibbuilder --- pd-lib-builder-0.5.1/Makefile.pdlibbuilder 2018-03-15 21:04:08.000000000 +0000 +++ pd-lib-builder-0.6.0/Makefile.pdlibbuilder 2019-12-22 13:18:40.000000000 +0000 @@ -1,5 +1,5 @@ -# Makefile.pdlibbuilder dated 2018-03-15 -version = 0.5.1 +# Makefile.pdlibbuilder dated 2019-12-21 +version = 0.6.0 # Helper makefile for Pure Data external libraries. # Written by Katja Vetter March-June 2015 for the public domain. No warranties. @@ -99,6 +99,10 @@ # - STRIP # - DESTDIR # +# Optional user variables for make command line or environment: +# +# - PLATFORM +# # Deprecated path variables: # # - pdincludepath @@ -194,6 +198,13 @@ # DESTDIR: # Prepended path component for staged install. # +# PLATFORM: +# Target platform for cross compilation in the form of GNU triplet: +# cpu-vendor-os. Example: x86_64-w64-mingw32. This specifies the tool chain that +# pdlibbuilder will use, if installed and locatable. System and architecture +# will then be autodefined accordingly. In most cases no other variables need to +# be overridden. +# # CPPFLAGS: # Preprocessor flags which are not strictly required for building. # @@ -279,6 +290,7 @@ # vars: print makefile variables # allvars: print all variables # depend: print generated prerequisites +# dumpmachine: print compiler output of option '-dumpmachine' # coffee: dummy target # # Variable $(executables) expands to class executables plus optional shared lib, @@ -430,38 +442,55 @@ ################################################################################ -### platform detection ######################################################### +### target platform detection ################################################## ################################################################################ +#=== target platform =========================================================== + + +# PLATFORM: optional user variable to define target platform for cross +# compilation. Redefine build tools accordingly. PLATFORM should match +# the exact target prefix of tools present in $PATH, like x86_64-w64-mingw32, +# x86_64-apple-darwin12 etc. Tool definitions are exported to ensure submakes +# will get the same. + +ifneq ($(PLATFORM),) + ifneq ($(findstring darwin, $(PLATFORM)),) + export CC = $(PLATFORM)-cc + export CXX = $(PLATFORM)-c++ + export CPP = $(PLATFORM)-cc + else + export CC = $(PLATFORM)-gcc + export CXX = $(PLATFORM)-g++ + export CPP = $(PLATFORM)-cpp + endif + STRIP = $(PLATFORM)-strip +endif + +# Let (native or cross-) compiler report target triplet and isolate individual +# words therein to facilitate later processing. +target.triplet := $(subst -, ,$(shell $(CC) -dumpmachine)) + + #=== operating system ========================================================== # The following systems are defined: Linux, Darwin, Windows. GNU and # GNU/kFreeBSD are treated as Linux to get the same options. -uname := $(shell uname) - -ifeq ($(findstring $(uname), Linux GNU GNU/kFreeBSD), $(uname)) +ifneq ($(filter linux gnu% kfreebsd, $(target.triplet)),) system = Linux endif -ifeq ($(uname), Darwin) +ifneq ($(filter darwin%, $(target.triplet)),) system = Darwin endif -ifeq ($(filter MINGW% MSYS%, $(uname)), $(uname)) +ifneq ($(filter mingw% cygwin%, $(target.triplet)),) system = Windows endif -# Unfortunately not all Mingw versions provide a link cc > gcc, therefore -# gcc is hardcoded here (but not if CC is redefined). -ifeq ($(system), Windows) - ifeq ($(origin CC), default) - CC = gcc - endif -endif - # evaluate possible system-specific multiline defines from library makefile $(eval $(for$(system))) @@ -472,24 +501,13 @@ #=== architecture ============================================================== -# native architecture of the build machine -build.arch := $(shell uname -m) +# The following CPU names can be processed by pdlibbuilder: +# i*86 Intel 32 bit +# x86_64 Intel 64 bit +# arm ARM 32 bit +# aarch64 ARM 64 bit -# Target architecture as reported by compiler. Give precedence to eventual -# user-defined compiler. The first field of -- is extracted. -ifneq ($(origin CXX), default) - dumpmachine.cpu = $(firstword $(subst -, ,$(shell $(CXX) -dumpmachine))) -else - dumpmachine.cpu = $(firstword $(subst -, ,$(shell $(CC) -dumpmachine))) -endif - -# Target architecture as reported by compiler is only used for Windows at the -# moment. For other systems this still has to be tested. -ifeq ($(system), Windows) - target.arch = $(dumpmachine.cpu) -else - target.arch = $(build.arch) -endif +target.arch := $(firstword $(target.triplet)) ################################################################################ @@ -501,24 +519,29 @@ # Set architecture-dependent cflags, mainly for Linux. For Mac and Windows, -# arch.c.flags are overriden below. +# arch.c.flags are overriden below. To see gcc's default architecture flags: +# $ gcc -Q --help=target -# Raspberry Pi 1st generation -ifeq ($(target.arch), armv6l) +# ARMv6: Raspberry Pi 1st gen, not detectable from target.arch +ifeq ($(shell uname), armv6l) arch.c.flags = -march=armv6 -mfpu=vfp -mfloat-abi=hard -# Beagle, Udoo, RPi2 etc. -else ifeq ($(target.arch), armv7l) +# ARMv7: Beagle, Udoo, RPi2 etc. +else ifeq ($(target.arch), arm) arch.c.flags = -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard +# ARMv8 64 bit, not tested yet +else ifeq ($(target.arch), aarch64) + arch.c.flags = -mcpu=cortex-a53 + # Intel 32 bit, build with SSE and SSE2 instructions -else ifeq ($(findstring $(target.arch), i386 i686), $(target.arch)) +else ifneq ($(filter i%86, $(target.arch)),) arch.c.flags = -march=pentium4 -mfpmath=sse -msse -msse2 - + # Intel/AMD 64 bit, build with SSE, SSE2 and SSE3 instructions -else ifeq ($(findstring $(target.arch), x86_64), $(target.arch)) +else ifeq ($(target.arch), x86_64) arch.c.flags = -march=core2 -mfpmath=sse -msse -msse2 -msse3 - + # if none of the above architectures detected else arch.c.flags = @@ -549,11 +572,8 @@ #=== flags and paths for Darwin ================================================ -# On OSX we try to build fat binaries by default. It is assumed that OSX i386 -# can build for ppc and OSX x86_64 can't. TODO: try to refine this condition. -# LLVM-clang doesn't support -fcheck-new, therefore this flag is omitted for -# OSX x86_64. - +# LLVM-clang doesn't support -fcheck-new, therefore this flag is only used when +# compiling with g++. ifeq ($(system), Darwin) pkglibdir = $(HOME)/Library/Pd @@ -570,15 +590,18 @@ shared.ldflags = -dynamiclib -undefined dynamic_lookup \ -install_name @loader_path/$(shared.lib) \ -compatibility_version 1 -current_version 1.0 - version.flag := $(filter $(cflags), -mmacosx-version-min=%) - ifeq ($(target.arch), i386) + ifneq ($(filter %g++, $(CXX)),) cxx.flags := -fcheck-new - arch := ppc i386 x86_64 - version.flag ?= -mmacosx-version-min=10.4 endif - ifeq ($(target.arch), x86_64) + ifeq ($(extension), d_fat) arch := i386 x86_64 - version.flag ?= -mmacosx-version-min=10.5 + else + arch := $(target.arch) + endif + ifneq ($(filter -mmacosx-version-min=%, $(cflags)),) + version.flag := $(filter -mmacosx-version-min=%, $(cflags)) + else + version.flag = -mmacosx-version-min=10.6 endif arch.c.flags := $(addprefix -arch , $(arch)) $(version.flag) arch.ld.flags := $(arch.c.flags) @@ -599,7 +622,7 @@ # required because of parentheses in variable name. ifeq ($(system), Windows) pkglibdir := $(APPDATA)/Pd - ifeq ($(MINGW_CHOST), i686-w64-mingw32) + ifeq ($(target.arch), i686) programfiles := ${ProgramFiles(x86)} else programfiles := $(PROGRAMFILES) @@ -622,9 +645,9 @@ # TODO: decide whether -mms-bitfields should be specified. ifeq ($(system), Windows) cpp.flags := -DMSW -DNT - ifeq ($(filter i%86 mingw32, $(target.arch)), $(target.arch)) + ifeq ($(target.arch), i686) arch.c.flags := -march=pentium4 -msse -msse2 -mfpmath=sse - else ifeq (x86_64, $(target.arch)) + else ifeq ($(target.arch), x86_64) cpp.flags := -DMSW -DNT -DPD_LONGINTTYPE=__int64 arch.c.flags := -march=core2 -msse -msse2 -msse3 -mfpmath=sse else @@ -728,6 +751,18 @@ # At this point most variables are defined. Now do some checks and info's # before rules begin. +# print Makefile.pdlibbuilder version before possible termination +$(info ++++ info: using Makefile.pdlibbuilder version $(version)) + +# Terminate if target triplet remained empty, to avoid all sorts of confusing +# scenarios and spurious bugs. +ifeq ($(target.triplet),) + $(error Command "$(CC) -dumpmachine" did not return a target triplet, \ + needed for a build. \ + Is compiler "$(CC)" installed in your PATH? ($(PATH)). \ + Does compiler "$(CC)" support option "-dumpmachine"?) +endif + # 'forward declaration' of default target, needed to do checks all: @@ -754,9 +789,6 @@ pddll := $(shell ls "$(PDBINDIR)/pd.dll") endif -# print Makefile.pdlibbuilder version -$(info ++++ info: using Makefile.pdlibbuilder version $(version)) - # when making target all, check if m_pd.h is found and print info about it ifeq ($(goals), all) $(if $(mpdh), \ @@ -1277,6 +1309,16 @@ @echo +#=== platform test ============================================================= + + +# This target can be used to test if the compiler for specified PLATFORM is +# correctly defined and available. + +dumpmachine: + @$(CC) -dumpmachine + + #=== dummy target ============================================================== diff -Nru pd-lib-builder-0.5.1/README.md pd-lib-builder-0.6.0/README.md --- pd-lib-builder-0.5.1/README.md 2018-03-15 21:04:08.000000000 +0000 +++ pd-lib-builder-0.6.0/README.md 2019-12-22 13:18:40.000000000 +0000 @@ -2,10 +2,10 @@ ### Makefile.pdlibbuilder ### -Helper makefile for Pure Data external libraries. -Written by Katja Vetter March-June 2015 for the public domain. No warranties. -Inspired by Hans Christoph Steiner's Makefile Template and Stephan Beal's -ShakeNMake. +Helper makefile for Pure Data external libraries. Written by Katja Vetter +March-June 2015 for the public domain and since then developed as a Pd +community project. No warranties. Inspired by Hans Christoph Steiner's Makefile +Template and Stephan Beal's ShakeNMake. GNU make version >= 3.81 required. @@ -13,7 +13,7 @@ ### characteristics ### -* defines build settings based on autodetected OS and architecture +* defines build settings based on autodetected target platform * defines rules to build Pd class- or lib executables from C or C++ sources * defines rules for libdir installation * defines convenience targets for developer and user @@ -52,7 +52,7 @@ override platform-dependent defaults: PDDIR: -Root directory of 'portable' pd package. When defined, PDINCLUDEDIR and +Root directory of 'portable' pd package. When defined, PDINCLUDEDIR and PDBINDIR will be evaluated as $(PDDIR)/src and $(PDDIR)/bin. PDINCLUDEDIR: @@ -74,7 +74,8 @@ This README.md provides only basic information. A large comment section inside Makefile.pdlibbuilder lists and explains the available user variables, default paths, and targets. The internal documentation reflects the exact functionality -of the particular version. A tips&tricks page is in the works. +of the particular version. For suggestions about project maintenance and +advanced compilation see tips-tricks.md. ### versioning ### @@ -82,32 +83,80 @@ The project is versioned in MAJOR.MINOR.BUGFIX format (see http://semver.org), and maintained at https://github.com/pure-data/pd-lib-builder. Pd lib developers -are invited to regulary check for updates, and to contribute and discuss +are invited to regulary check for updates, and to contribute and discuss improvements here. If you really need to distribute a personalized version with your library, rename Makefile.pdlibbuilder to avoid confusion. ### examples ### +The list of projects using pd-lib-builder can be helpful if you are looking for +examples, from the simplest use case to more complex implementations. -Here are a few projects using the Makefile.pdlibbuilder approach: +- helloworld: traditional illustration of simplest use case +- pd-windowing: straightforward real world use case of a small library +- pd-nilwind / pd-cyclone: more elaborate source tree +- zexy: migrated from autotools to pd-lib-builder + + +### projects using pd-lib-builder ### + +non-exhaustive list https://github.com/pure-data/helloworld -https://github.com/electrickery/pd-cyclone (stable) +https://github.com/electrickery/pd-nilwind + +https://github.com/electrickery/pd-maxlib + +https://github.com/electrickery/pd-sigpack + +https://github.com/electrickery/pd-tof + +https://github.com/electrickery/pd-windowing + +https://github.com/electrickery/pd-smlib + +https://github.com/porres/pd-cyclone + +https://github.com/porres/pd-else + +https://github.com/porres/pd-psycho + +https://git.iem.at/pd/comport -https://github.com/porres/pd-cyclone (experimental) +https://git.iem.at/pd/hexloader + +https://git.iem.at/pd/iemgui https://git.iem.at/pd/iemguts +https://git.iem.at/pd/iemlib + https://git.iem.at/pd/iemnet https://git.iem.at/pd/iem_ambi +https://git.iem.at/pd/iem_tab + +https://git.iem.at/pd/iem_adaptfilt + +https://git.iem.at/pd/iem_roomsim + +https://git.iem.at/pd/iem_spec2 + https://git.iem.at/pd/mediasettings +https://git.iem.at/pd/zexy + https://git.iem.at/pd-gui/punish https://github.com/residuum/PuRestJson -More examples will be referenced here when they are available. +https://github.com/libpd/abl_link + +https://github.com/wbrent/timbreID + +https://github.com/MetaluNet/moonlib + + diff -Nru pd-lib-builder-0.5.1/tips-tricks.md pd-lib-builder-0.6.0/tips-tricks.md --- pd-lib-builder-0.5.1/tips-tricks.md 2018-03-15 21:04:08.000000000 +0000 +++ pd-lib-builder-0.6.0/tips-tricks.md 2019-12-22 13:18:40.000000000 +0000 @@ -3,16 +3,35 @@ # Creating special builds -## cross-compiling W32 binaries from linux +## cross-compiling on linux x86_64 for other platforms -I'm using the following to cross-compile W32 binaries on my Debian/64bit system, -using `mingw-w64`. +Using pd-lib-builder >=0.6.0 we can define variable `PLATFORM` to specify a +target triplet for cross-compilation. Example to build W32 binaries (assuming +package `mingw-w64` is installed and a W32 package for Pd is unzipped into a +path `${PDWIN32}`: -Assuming you have unzipped a W32 package for Pd into `${WINPDPATH}`, run: + make PLATFORM=x86_64-w64-mingw32 PDDIR="${PDWIN32}" - make system=Windows pdbinpath="${WINPDPATH}/bin/" pdincludepath="${WINPDPATH}/src/" CC=i686-w64-mingw32-gcc +#### older pd-lib-builder versions -(if the project uses C++, you might also need to set `CXX=i686-w64-mingw32-g++`) +Using pd-lib-builder < 0.6.0, in the absence of variable `PLATFORM`, you would +instead override variables `system`, `target.arch`, `CC` and / or `CXX`, +`STRIP`. Example: + + make system=Windows target.arch=i686 CC=i686-w64-mingw32-gcc STRIP=i686-w64-mingw32-strip PDDIR="${PDWIN32}" + +#### toolchains + +Cross toolchains for relevant platforms in Debian Buster (install g++ +with dependencies for a given platform to get the whole tool chain): + +- `arm-linux-gnueabihf` +- `aarch64-linux-gnu` +- `i686-linux-gnu` +- `i686-w64-mingw32` and `x86_64-w64-mingw32` (install `mingw-w64`) + +OSX/MacOS cross tool chains are not distributed by Debian. Use project +`osxcross` from Thomas Poechtraeger to create the tools. ## building double-precision externals