Skip to content

Commit

Permalink
Merge branch 'feature/floatsize-build'
Browse files Browse the repository at this point in the history
  • Loading branch information
millerpuckette committed Jun 22, 2023
2 parents 74523d1 + 4036292 commit 77416b9
Show file tree
Hide file tree
Showing 14 changed files with 557 additions and 229 deletions.
6 changes: 6 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ LIBPD_DIST = libpd/Makefile libpd/README.txt libpd/test_libpd/Makefile \
# files that are included but not built
EXTRA_DIST = LICENSE.txt README.txt INSTALL.txt $(LIBPD_DIST)

pkgdata_DATA = \
LICENSE.txt \
README.txt \
$(empty)


# subdirs that are built,
# mac before src due to uninstall target order kludge (see mac/Makefile.am)
SUBDIRS = $(EXTRA_SUBDIRS) linux mac msw src man doc tcl extra font
Expand Down
69 changes: 64 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ wish="wish"
audio_backends=""
midi_backends=""

# deken information
deken_os=""
deken_cpu=""
deken_ext="so"
floatsize=""

# debug/release defaults
DEBUG_CFLAGS="-O0"
RELEASE_CFLAGS="-ffast-math -fno-finite-math-only -funroll-loops -fomit-frame-pointer -O3"
Expand All @@ -53,6 +59,10 @@ PD_CPPFLAGS=""
PD_CFLAGS=""
PD_LDFLAGS=""


pd_transform_name=$(echo ${program_transform_name} | sed -e 's|\$\$|$|')
pd_transformed=$(echo pd | sed -e "${pd_transform_name}")

#########################################
##### OS Detection #####

Expand All @@ -65,6 +75,7 @@ AS_CASE([$host],
AS_IF([test "x${IPHONEOS}" = "xno"],[
MACOSX=yes
platform="Mac OSX"
deken_os=darwin
coreaudio=yes
portaudio=yes
portmidi=yes
Expand Down Expand Up @@ -108,17 +119,20 @@ AS_CASE([$host],
AS_IF([test "x${ANDROID}" = "xno"],[
LINUX=yes
platform=Linux
deken_os=linux
portaudio=yes
watchdog=yes
EXTERNAL_CFLAGS="-fPIC"
EXTERNAL_LDFLAGS="-Wl,--export-dynamic -fPIC"
EXTERNAL_EXTENSION=pd_linux
],[
platform=Android
EXTERNAL_EXTENSION=so
])
],[*-*-gnu*],[
HURD=yes
platform=Hurd
deken_os=linux
watchdog=yes
EXTERNAL_CFLAGS="-fPIC"
EXTERNAL_LDFLAGS="-Wl,--export-dynamic -fPIC"
Expand All @@ -127,6 +141,7 @@ AS_CASE([$host],
WINDOWS=yes
MINGW=yes
platform=MinGW
deken_os=windows
mmio=yes
asio=yes
wasapi=yes
Expand All @@ -138,7 +153,7 @@ AS_CASE([$host],
# externals are dynamically linked to pd.dll in their individual automake files
EXTERNAL_CFLAGS="-mms-bitfields"
EXTERNAL_LDFLAGS="-Wl,--enable-auto-import -no-undefined -lpd"
EXTERNAL_LDFLAGS="-Wl,--enable-auto-import -no-undefined -l${pd_transformed}"
EXTERNAL_EXTENSION=dll
# workaround for rpl_malloc/rpl_realloc bug in autoconf when cross-compiling
Expand All @@ -148,6 +163,7 @@ AS_CASE([$host],
WINDOWS=yes
CYGWIN=yes
platform=Cygwin
deken_os=windows
mmio=yes
asio=yes
wasapi=yes
Expand All @@ -169,6 +185,20 @@ AS_CASE([$host],
EXTERNAL_EXTENSION=so
])

AS_IF([test "x${deken_os}" = "xwindows"],[deken_ext=dll])


AS_CASE([$host_cpu],
[x86_64|amd64],[deken_cpu=amd64],
[i386|i486|i586|i686],[deken_cpu=i386],
[aarch64],[deken_cpu=arm64],
[armv*l],[deken_cpu=${host_cpu%l}],
[armv*b],[deken_cpu=${host_cpu}],
[powerpc64],[deken_cpu=ppc64],
[powerpc],[deken_cpu=ppc],
[])


AM_CONDITIONAL(ANDROID, test x$ANDROID = xyes)
AM_CONDITIONAL(IPHONEOS, test x$IPHONEOS = xyes)
AM_CONDITIONAL(LINUX, test x$LINUX = xyes)
Expand Down Expand Up @@ -356,6 +386,35 @@ AS_IF([test "x$enable_watchdog" != "xyes"],[enable_watchdog=no])
AM_CONDITIONAL(PD_WATCHDOG, test x$enable_watchdog = xyes)


AC_ARG_WITH([floatsize],
[AS_HELP_STRING([--with-floatsize=<SIZE>],
[build binaries for the given floatsize;
SIZE can be 32 (single precision) or 64 (double precision)
]
)],
[floatsize=${withval}]
)
AC_MSG_CHECKING([float size])
AS_CASE([${floatsize}],
[32],[],
[64],[],
[""],[],
[
AC_MSG_WARN([${floatsize}bit floats not supported..fallback to default])
floatsize=""
])
AS_IF([test "x${floatsize}" != "x" ],
[
PD_CPPFLAGS="-DPD_FLOATSIZE=${floatsize} $PD_CPPFLAGS"
AC_MSG_RESULT([${floatsize}])
],[AC_MSG_RESULT([default])
])

AS_IF([test "x${floatsize}" = "x64" && test "x${deken_cpu}" != "x" && test "x${deken_os}" != "x" && test "x${deken_ext}" != "x"],[
EXTERNAL_EXTENSION="${deken_os}-${deken_cpu}-${floatsize}.${deken_ext}"
AC_MSG_NOTICE([default external extension...${EXTERNAL_EXTENSION}])
])

##### libpd #####
AC_ARG_ENABLE([libpd],
[AS_HELP_STRING([--enable-libpd], [additionally build libpd])])
Expand Down Expand Up @@ -552,7 +611,6 @@ AS_IF([test "x${WISH}" = "xyes" -o "x${WISH}" = "xno"],
AC_SUBST([WISH])

##### Deken OS and CPU #####
deken_id=""
AC_ARG_WITH([deken-os],
[AS_HELP_STRING([--with-deken-os=<OS>],
[Operating System string to use for externals (e.g. Linux, Windows, Darwin,...)])],
Expand All @@ -561,7 +619,7 @@ AS_IF([test "x${DEKEN_OS}" = "xyes" -o "x${DEKEN_OS}" = "xno"],
[AC_MSG_NOTICE([--with-deken-os requires an Operating System, ignoring '${DEKEN_OS}'])
DEKEN_OS=""])
AC_SUBST([DEKEN_OS])
AS_IF([test "x${DEKEN_OS}" = "x"], [deken_id="???"], [deken_id="${DEKEN_OS}"])
AS_IF([test "x${DEKEN_OS}" != "x"], [deken_os="${DEKEN_OS}"])

AC_ARG_WITH([deken-cpu],
[AS_HELP_STRING([--with-deken-cpu=<CPU>],
Expand All @@ -571,7 +629,7 @@ AS_IF([test "x${DEKEN_CPU}" = "xyes" -o "x${DEKEN_CPU}" = "xno"],
[AC_MSG_NOTICE([--with-deken-cpu requires a CPU, ignoring '${DEKEN_CPU}'])
DEKEN_CPU=""])
AC_SUBST([DEKEN_CPU])
AS_IF([test "x${DEKEN_CPU}" = "x"], [deken_id="${deken_id}-???"], [deken_id="${deken_id}-${DEKEN_CPU}"])
AS_IF([test "x${DEKEN_CPU}" != "x"], [deken_cpu="${DEKEN_CPU}"])

AC_ARG_WITH([external-extension],
[AS_HELP_STRING([--with-external-extension=<EXT>],
Expand Down Expand Up @@ -725,6 +783,7 @@ AC_MSG_NOTICE([
$PACKAGE $VERSION is now configured
Platform: $platform
Float size: ${floatsize:-default}
Debug build: $debug
Universal build: $universal
Localizations: $locales
Expand All @@ -741,7 +800,7 @@ AC_MSG_NOTICE([
External extension: $EXTERNAL_EXTENSION
External CFLAGS: $EXTERNAL_CFLAGS
External LDFLAGS: $EXTERNAL_LDFLAGS
Deken identifier: ${deken_id}
Deken identifier: ${deken_os:-???}-${deken_cpu:-???}
fftw: $fftw
wish(tcl/tk): $wish
Expand Down
15 changes: 13 additions & 2 deletions font/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
#########################################
##### Files, Binaries, & Libs #####

# files that are included but not built
EXTRA_DIST = \
$(fontdata_DATA) \
$(empty)

fontdatadir = $(pkgdatadir)/font
fontdata_DATA =

# files that are included but not built
fontdata_DATA += \
DejaVuSansMono.ttf \
DejaVuSansMono-Oblique.ttf \
DejaVuSansMono-Bold.ttf \
DejaVuSansMono-BoldOblique.ttf \
$(data)

fontdata_DATA += \
LICENSE \
README.txt
README.txt \
$(data)

0 comments on commit 77416b9

Please sign in to comment.