diff --git a/externals/Makefile b/externals/Makefile index 220ccb28899fc9d47eae5291032cbf2553cec359..68119758fe35085a390d26bea268a15f4452a0c4 100644 --- a/externals/Makefile +++ b/externals/Makefile @@ -374,7 +374,7 @@ boids_clean: #------------------------------------------------------------------------------# # BSAYLOR bsaylor: - make -C $(externals_src)/bsaylor PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)" + make -C $(externals_src)/bsaylor PD_PATH=$(pd_src) CFLAGS="$(CFLAGS) -fno-strict-aliasing" bsaylor_install: make -C $(externals_src)/bsaylor \ @@ -1300,7 +1300,7 @@ moocow_clean: #------------------------------------------------------------------------------# # MOONLIB moonlib: - make -C $(externals_src)/moonlib PD_PATH=$(pd_src) CFLAGS="$(CFLAGS)" + make -C $(externals_src)/moonlib PD_PATH=$(pd_src) CFLAGS="$(CFLAGS) -fno-strict-aliasing" moonlib_install: make -C $(externals_src)/moonlib DESTDIR="$(DESTDIR)" objectsdir="$(objectsdir)" install diff --git a/externals/OSCx/configure.ac b/externals/OSCx/configure.ac index 99807ac1646e4e6641f4bf5dd98d89d53777737a..683c0d42ef44ae3cea025ef4f110643220f51ae7 100644 --- a/externals/OSCx/configure.ac +++ b/externals/OSCx/configure.ac @@ -78,7 +78,7 @@ if test -z "$GCC"; then else case $host in *86*-linux*) - CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O2 -fPIC" + CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O2 -fno-strict-aliasing -fPIC" LDFLAGS="-Wl,--export-dynamic -shared" dnl we could test for bad glibc here, but don't pd_suffix=pd_linux @@ -115,7 +115,7 @@ else LIBS="-L../../../pd/src -L../../../pd/bin -L../../../pd/obj -lpd -lm -lwsock32" ;; *-*-darwin*) - CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " + CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 -fno-strict-aliasing " LDFLAGS=" -bundle -bundle_loader ../../../pd/bin/pd-l2ork -flat_namespace " pd_suffix=pd_darwin LIBS="-lc -lm" diff --git a/externals/bsaylor/Makefile b/externals/bsaylor/Makefile index af62094581f6993acdbc948969acb2fa71dee5c6..bc2d032dc3bbdb4e8c0c4f1f51310376f62233b0 100644 --- a/externals/bsaylor/Makefile +++ b/externals/bsaylor/Makefile @@ -84,7 +84,7 @@ ifeq ($(UNAME),Darwin) CXX=$(IPHONE_BASE)/g++ ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6 - OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer -fno-strict-aliasing CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS) LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT) LIBS += -lc @@ -120,7 +120,7 @@ ifeq ($(UNAME),Linux) EXTENSION = pd_linux OS = linux PD_PATH = /usr - OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing CFLAGS += -fPIC LDFLAGS += -Wl,--export-dynamic -shared -fPIC LIBS += -lc @@ -133,7 +133,7 @@ ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME))) EXTENSION = dll OS = cygwin PD_PATH = $(cygpath $(PROGRAMFILES))/pd - OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing CFLAGS += LDFLAGS += -Wl,--export-dynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" LIBS += -lc -lpd @@ -146,7 +146,7 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME))) EXTENSION = dll OS = windows PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd) - OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing CFLAGS += -mms-bitfields LDFLAGS += -s -shared -Wl,--enable-auto-import LIBS += -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 diff --git a/externals/loaders/hexloader/hexloader.c b/externals/loaders/hexloader/hexloader.c index f11e722486dd1571f00e32933995992802dc790a..063dc2377dec75ecf8738c6d6a7f76d2367258a3 100644 --- a/externals/loaders/hexloader/hexloader.c +++ b/externals/loaders/hexloader/hexloader.c @@ -36,7 +36,7 @@ #ifdef DL_OPEN # include <dlfcn.h> #endif -#ifdef UNISTD +#ifdef HAVE_UNISTD_H # include <stdlib.h> # include <unistd.h> #endif diff --git a/externals/moonlib/Makefile b/externals/moonlib/Makefile index 63623f03df0e4d17f5b31cc5241af2d5a2d79fff..b5ee48d9fc9af54db72d46c256357dc20214623c 100644 --- a/externals/moonlib/Makefile +++ b/externals/moonlib/Makefile @@ -143,7 +143,7 @@ ifeq ($(UNAME),ANDROID) NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]') NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$(NDK_UNAME)-x86 CC := $(NDK_TOOLCHAIN_BASE)/bin/arm-linux-androideabi-gcc --sysroot=$(NDK_SYSROOT) - OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing CFLAGS += LDFLAGS += -rdynamic -shared SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared @@ -159,7 +159,7 @@ ifeq ($(UNAME),Linux) SHARED_EXTENSION = so OS = linux PD_PATH = /usr - OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing ALL_CFLAGS += -fPIC ALL_LDFLAGS += -rdynamic -shared -fPIC SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared @@ -175,7 +175,7 @@ ifeq ($(UNAME),GNU) SHARED_EXTENSION = so OS = linux PD_PATH = /usr - OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing ALL_CFLAGS += -fPIC ALL_LDFLAGS += -rdynamic -shared -fPIC SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB) @@ -191,7 +191,7 @@ ifeq ($(UNAME),GNU/kFreeBSD) SHARED_EXTENSION = so OS = linux PD_PATH = /usr - OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing ALL_CFLAGS += -fPIC ALL_LDFLAGS += -rdynamic -shared -fPIC SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB) @@ -206,7 +206,7 @@ ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME))) SHARED_EXTENSION = dll OS = cygwin PD_PATH = $(shell cygpath $$PROGRAMFILES)/pd - OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing ALL_CFLAGS += ALL_LDFLAGS += -rdynamic -shared -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" SHARED_LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB) @@ -223,7 +223,7 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME))) PD_PATH = $(shell cd "$$PROGRAMFILES/pd" && pwd) # MinGW doesn't seem to include cc so force gcc CC=gcc - OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer + OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing ALL_CFLAGS += -mms-bitfields ALL_LDFLAGS += -s -shared -Wl,--enable-auto-import -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" SHARED_LDFLAGS += -shared diff --git a/pd/src/configure.ac b/pd/src/configure.ac index 77e491283dce6b057c7b0fe707227a28aeef7b90..3f1395ecc2724a59403c47a3a02b095b259f5c42 100644 --- a/pd/src/configure.ac +++ b/pd/src/configure.ac @@ -121,7 +121,7 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate. LDFLAGS="$LDFLAGS -static" fi EXT=pd_linux - CPPFLAGS="-DHAVE_LIBDL -DPA_USE_OSS -DUNIX -DUNISTD -fno-strict-aliasing" + CPPFLAGS="-DHAVE_LIBDL -DPA_USE_OSS -DUNIX -DHAVE_UNISTD_H -fno-strict-aliasing" dnl No OSS on hurd if test `uname -s` = "GNU"; then diff --git a/pd/src/s_main.c b/pd/src/s_main.c index 86cd504f3cb6ecd04c39016d8c765ddc128c8d31..975e42dc97c9d9ae7c9d5284dc1f932e00163ff2 100644 --- a/pd/src/s_main.c +++ b/pd/src/s_main.c @@ -14,7 +14,7 @@ #include <fcntl.h> #include <stdlib.h> -#ifdef UNISTD +#ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef MSW @@ -519,7 +519,7 @@ static char *(usagemessage[]) = { "-send \"msg...\" -- send a message at startup, after patches are loaded\n", "-noprefs -- suppress loading preferences on startup\n", "-console -- open the console along with the pd window\n", -#ifdef UNISTD +#ifdef HAVE_UNISTD_H "-rt or -realtime -- use real-time priority\n", "-nrt -- don't use real-time priority\n", #endif @@ -996,7 +996,7 @@ int sys_argparse(int argc, char **argv) sys_noautopatch = 0; argc--; argv++; } -#ifdef UNISTD +#ifdef HAVE_UNISTD_H else if (!strcmp(*argv, "-rt") || !strcmp(*argv, "-realtime")) { sys_hipriority = 1; diff --git a/pd/src/s_path.c b/pd/src/s_path.c index e7ac2b1ecb8c18937772e7c99b408647333cc252..82df1fcce09135a73fa8a7bdebce750287e9f132 100644 --- a/pd/src/s_path.c +++ b/pd/src/s_path.c @@ -14,7 +14,7 @@ #define DEBUG(x) #include <stdlib.h> -#ifdef UNISTD +#ifdef HAVE_UNISTD_H #include <unistd.h> #include <sys/stat.h> #endif @@ -360,7 +360,7 @@ int sys_trytoopenone(const char *dir, const char *name, const char* ext, if ((fd=open(dirresult,O_RDONLY | MSWOPENFLAG(bin))) >= 0) { /* in unix, further check that it's not a directory */ -#ifdef UNISTD +#ifdef HAVE_UNISTD_H struct stat statbuf; int ok = ((fstat(fd, &statbuf) >= 0) && !S_ISDIR(statbuf.st_mode));