Skip to content

Commit

Permalink
fixed libpll travis ci config to work with gcc 4.6, added compiler er…
Browse files Browse the repository at this point in the history
…ror messages when compiling with gcc < 4.7.0
  • Loading branch information
flouris authored and flouris committed May 16, 2017
1 parent eac52cf commit a4f4170
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
26 changes: 13 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-4.6']
env:
- COMPILER=gcc-4.6
- COMPILER=gcc-4.6 CONFPARAMS="--disable-avx2"

- os: linux
compiler: gcc
Expand All @@ -18,7 +18,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-4.7']
env:
- COMPILER=gcc-4.7
- COMPILER=gcc-4.7 CONFPARAMS=""

- os: linux
compiler: gcc
Expand All @@ -27,7 +27,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-4.8']
env:
- COMPILER=gcc-4.8
- COMPILER=gcc-4.8 CONFPARAMS=""

- os: linux
compiler: gcc
Expand All @@ -36,7 +36,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-4.9']
env:
- COMPILER=gcc-4.9
- COMPILER=gcc-4.9 CONFPARAMS=""

- os: linux
compiler: gcc
Expand All @@ -45,7 +45,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-5']
env:
- COMPILER=gcc-5
- COMPILER=gcc-5 CONFPARAMS=""

- os: linux
compiler: gcc
Expand All @@ -54,7 +54,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-6']
env:
- COMPILER=gcc-6
- COMPILER=gcc-6 CONFPARAMS=""

- os: linux
compiler: clang
Expand All @@ -63,7 +63,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5']
packages: ['clang-3.5']
env:
- COMPILER=clang-3.5
- COMPILER=clang-3.5 CONFPARAMS=""

- os: linux
compiler: clang
Expand All @@ -72,7 +72,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
packages: ['clang-3.6']
env:
- COMPILER=clang-3.6
- COMPILER=clang-3.6 CONFPARAMS=""

- os: linux
compiler: clang
Expand All @@ -81,7 +81,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
packages: ['clang-3.7']
env:
- COMPILER=clang-3.7
- COMPILER=clang-3.7 CONFPARAMS=""

- os: linux
compiler: clang
Expand All @@ -90,7 +90,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
packages: ['clang-3.8']
env:
- COMPILER=clang-3.8
- COMPILER=clang-3.8 CONFPARAMS=""

- os: linux
dist: trusty
Expand All @@ -100,7 +100,7 @@ matrix:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.9']
packages: ['clang-3.9']
env:
- COMPILER=clang-3.9
- COMPILER=clang-3.9 CONFPARAMS=""

- os: linux
dist: trusty
Expand All @@ -110,6 +110,6 @@ matrix:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
packages: ['clang-4.0']
env:
- COMPILER=clang-4.0
- COMPILER=clang-4.0 CONFPARAMS=""

script: ./autogen.sh && CC=$COMPILER ./configure && make && make check
script: ./autogen.sh && CC=$COMPILER ./configure $CONFPARAMS && make && make check
2 changes: 1 addition & 1 deletion src/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "pll.h"

#if (defined(__GNUC__) && (__GNUC__ < 4 || \
#if (!defined(__clang__) && defined(__GNUC__) && (__GNUC__ < 4 || \
(__GNUC__ == 4 && __GNUC_MINOR__ < 8))) || \
(defined(__clang__) && (__clang_major__ < 3 || \
(__clang_major__ == 3 && __clang_minor__ < 9)))
Expand Down
13 changes: 13 additions & 0 deletions src/pll.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@
#include "config.h"
#endif

#if (!defined(__clang__) && defined(__GNUC__) && (__GNUC__ < 4 || \
(__GNUC__ == 4 && __GNUC_MINOR__ < 7)))
#if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
#if (defined(HAVE_AVX2))
#error "GCC 4.6.x. Please run ./configure --disable-avx2"
#endif
#else
#if (defined(HAVE_AVX2) || defined(HAVE_AVX))
#error "GCC < 4.6. Please run ./configure --disable-avx --disable-avx2"
#endif
#endif
#endif

#ifdef HAVE_X86INTRIN_H
#include <x86intrin.h>
#endif
Expand Down

0 comments on commit a4f4170

Please sign in to comment.