Skip to content

Commit

Permalink
Merge pull request #608 from wilx/automake-1.16j-update
Browse files Browse the repository at this point in the history
  • Loading branch information
wilx committed Feb 2, 2024
2 parents 9bdbe4f + 02e2f99 commit dcae948
Show file tree
Hide file tree
Showing 74 changed files with 3,919 additions and 2,147 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
BUILD_MACHINE_OS_TYPE=$(uname | tr A-Z a-z)
BUILD_MACHINE_OS_ARCH=$(uname -m)
ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME
ANDROID_NDK=$ANDROID_NDK_HOME
ANDROID_NDK_ROOT=$ANDROID_NDK_HOME
ANDROID_NDK_VERS=$(grep "Pkg.Revision" "$ANDROID_NDK_HOME/source.properties" | cut -d " " -f3)
ANDROID_NDK_BASE=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$BUILD_MACHINE_OS_TYPE-$BUILD_MACHINE_OS_ARCH
ANDROID_NDK_BIND=$ANDROID_NDK_BASE/bin
Expand All @@ -53,7 +57,7 @@ jobs:
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DANDROID_TOOLCHAIN=clang \
-DANDROID_ABI=${{ matrix.target-abi }} \
-DANDROID_PLATFORM=31 \
-DANDROID_PLATFORM=latest \
-DANDROID_STL=c++_static \
-DCMAKE_CXX_STANDARD=20 \
-S . \
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,36 @@ jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
config:
- os: 'ubuntu-latest'
cc: 'gcc-13'
cxx: 'g++-13'
prereq: |
sudo apt install libstdc++-13-dev g++-13 gcc-13
# Mac OS X is missing the <format> header or
# some of its funtions.
#- os: 'macos-13'
# cc: 'clang'
# cxx: 'clang++'
# prereq: |
# sudo xcode-select -s '/Applications/Xcode_15.1.app/Contents/Developer'


runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install prerequisites
run: |
${{ matrix.config.prereq }}
- name: configure
run: |
${{ matrix.config.cxx }} --version
./scripts/fix-timestamps.sh
mkdir objdir
cd objdir
../configure --enable-shared --enable-unit-tests --with-working-locale
../configure CC='${{ matrix.config.cc }}' CXX='${{ matrix.config.cxx }}' --enable-shared --enable-unit-tests --with-working-locale
- name: make
run: cd objdir ; make
- name: make check
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ endif ()
# Remove when CMake >= 2.8.4 is required
set (CMAKE_LEGACY_CYGWIN_WIN32 0)

project (log4cplus)
cmake_minimum_required (VERSION 3.12)
project (log4cplus)

# Use "-fPIC" / "-fPIE" for all targets by default, including static libs.
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down
35 changes: 35 additions & 0 deletions ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,41 @@ endif()
check_function_exists(gethostbyname_r LOG4CPLUS_HAVE_GETHOSTBYNAME_R) # TODO more complicated test in AC
check_function_exists(getaddrinfo LOG4CPLUS_HAVE_GETADDRINFO ) # TODO more complicated test in AC

# Check availability of __attribute__ ((init_priority ((prio))))
if(NOT DEFINED LOG4CPLUS_HAVE_VAR_ATTRIBUTE_INIT_PRIORITY)
check_c_source_compiles(
"#if defined (__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 1))
# error Please fail.
#endif
__attribute__ ((__init_priority__ ((200)))) int x = 1;
int main(void) { return x == 1 ? 0 : 1; }"
HAVE_VAR_ATTRIBUTE_INIT_PRIORITY
)
if(HAVE_VAR_ATTRIBUTE_INIT_PRIORITY)
set(LOG4CPLUS_HAVE_VAR_ATTRIBUTE_INIT_PRIORITY "1")
endif()
endif()

# Check availability of __attribute__((constructor(priority))).
if(NOT DEFINED LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY)
check_c_source_compiles(
"#if defined (__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 1))
# error Please fail.
#endif
int x = 0;
__attribute__((__constructor__(200))) int foo();
int foo() { return 1; }
int main(void) { return x == 1 ? 0 : 1; }"
HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY
)
if(HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY)
set(LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY "1")
endif()
endif()

# check for declspec stuff
if(NOT DEFINED LOG4CPLUS_DECLSPEC_EXPORT)
Expand Down

0 comments on commit dcae948

Please sign in to comment.