+#ifdef HAVE_LIMITS_H
+#include <limits.h> // for CHAR_BIT, in C99 standard
+#endif
+
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifdef HAVE_ACCELERATE
+#define HAVE_ATLAS 1
+#include <Accelerate/Accelerate.h>
+#elif defined(HAVE_ATLAS_CBLAS_H)
+#define HAVE_ATLAS 1
+#include <atlas/cblas.h>
+#else
+#undef HAVE_ATLAS
+#endif
+
+#ifdef HAVE_ACCELERATE
+#include <Accelerate/Accelerate.h>
+#ifndef HAVE_AUBIO_DOUBLE
+#define aubio_vDSP_mmov vDSP_mmov
+#define aubio_vDSP_vmul vDSP_vmul
+#define aubio_vDSP_vfill vDSP_vfill
+#define aubio_vDSP_meanv vDSP_meanv
+#define aubio_vDSP_sve vDSP_sve
+#define aubio_vDSP_maxv vDSP_maxv
+#define aubio_vDSP_maxvi vDSP_maxvi
+#define aubio_vDSP_minv vDSP_minv
+#define aubio_vDSP_minvi vDSP_minvi
+#define aubio_vDSP_dotpr vDSP_dotpr
+#else /* HAVE_AUBIO_DOUBLE */
+#define aubio_vDSP_mmov vDSP_mmovD
+#define aubio_vDSP_vmul vDSP_vmulD
+#define aubio_vDSP_vfill vDSP_vfillD
+#define aubio_vDSP_meanv vDSP_meanvD
+#define aubio_vDSP_sve vDSP_sveD
+#define aubio_vDSP_maxv vDSP_maxvD
+#define aubio_vDSP_maxvi vDSP_maxviD
+#define aubio_vDSP_minv vDSP_minvD
+#define aubio_vDSP_minvi vDSP_minviD
+#define aubio_vDSP_dotpr vDSP_dotprD
+#endif /* HAVE_AUBIO_DOUBLE */
+#endif /* HAVE_ACCELERATE */
+
+#ifdef HAVE_ATLAS
+#ifndef HAVE_AUBIO_DOUBLE
+#define aubio_catlas_set catlas_sset
+#define aubio_cblas_copy cblas_scopy
+#define aubio_cblas_swap cblas_sswap
+#define aubio_cblas_dot cblas_sdot
+#else /* HAVE_AUBIO_DOUBLE */
+#define aubio_catlas_set catlas_dset
+#define aubio_cblas_copy cblas_dcopy
+#define aubio_cblas_swap cblas_dswap
+#define aubio_cblas_dot cblas_ddot
+#endif /* HAVE_AUBIO_DOUBLE */
+#endif /* HAVE_ATLAS */
+
+#if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE) && !defined(HAVE_ATLAS)
+#define HAVE_NOOPT 1
+#else
+#undef HAVE_NOOPT
+#endif
+