diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-03-30 12:28:11 -0700 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-03-30 12:28:11 -0700 |
commit | 9a1bc8cafb904c20a869c74ad6d657686a1c4bb1 (patch) | |
tree | 1c6a0b258c047f83a45aa383337f63b4e85b6682 /Xcode | |
parent | 0c6c072733a5a2177ffc24d2614ee1151a39f02f (diff) | |
download | libusb-9a1bc8cafb904c20a869c74ad6d657686a1c4bb1.tar.gz |
build: Require C11 to build and clean up autoconfig/automake files
C11 compiler support has been available for many years now. It is not
unreasonable to require this now, and doing so allows some cleanup to
the configure script. It is no longer necessary to check for compiler
support of the '-fvibility' flag because any compiler that supports C11
will support this flag as well.
Fix up the way that compiler and linker flags are passed down to the
various makefiles. The compiler flags should be shared by all, but the
linker flags and libraries should be separated between the library and
the examples/tests. The visibility flag is only relevant for the
library and the thread flags are only relevant for sources using thread
constructs, so provide them as needed.
Rearrange configure.ac to group similar functionality and consolidate
where possible.
Based on these changes, update the Travis configuration file to include
newer versions of test platforms to ensure proper C11 compiler support.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'Xcode')
-rw-r--r-- | Xcode/common.xcconfig | 6 | ||||
-rw-r--r-- | Xcode/config.h | 13 |
2 files changed, 8 insertions, 11 deletions
diff --git a/Xcode/common.xcconfig b/Xcode/common.xcconfig index 2c7ff3c..0989351 100644 --- a/Xcode/common.xcconfig +++ b/Xcode/common.xcconfig @@ -17,11 +17,11 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// libusb does not follow C99 strict aliasing rules, so disable it. +// libusb does not follow C11 strict aliasing rules, so disable it. GCC_STRICT_ALIASING = NO -// Use C99 dialect. -GCC_C_LANGUAGE_STANDARD = c99 +// Use GNU11 dialect. +GCC_C_LANGUAGE_STANDARD = gnu11 // Don't search user paths with <> style #includes. ALWAYS_SEARCH_USER_PATHS = NO diff --git a/Xcode/config.h b/Xcode/config.h index 3aaeb7b..9761542 100644 --- a/Xcode/config.h +++ b/Xcode/config.h @@ -2,15 +2,12 @@ #include <AvailabilityMacros.h> -/* Default visibility */ +/* Define to the attribute for default visibility. */ #define DEFAULT_VISIBILITY /**/ -/* Message logging */ +/* Define to 1 to enable message logging. */ #define ENABLE_LOGGING 1 -/* Define to 1 if the compiler supports _Thread_local. */ -#define HAVE_CC_THREAD_LOCAL 1 - /* On 10.12 and later, use newly available clock_*() functions */ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 /* Define to 1 if you have the `clock_gettime' function. */ @@ -29,11 +26,11 @@ /* Define to 1 if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 -/* Use POSIX poll() implementation */ +/* Define to 1 if using the POSIX poll() implementation. */ #define POLL_POSIX 1 -/* Use POSIX Threads */ +/* Define to 1 if using POSIX threads. */ #define THREADS_POSIX 1 -/* Use GNU extensions */ +/* Enable GNU extensions. */ #define _GNU_SOURCE 1 |