summaryrefslogtreecommitdiffstats
path: root/src/libatomic_ops.mk
blob: 03db7ccf76aaadaa45f194f16ccebf011a10375a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# This file is part of MXE. See LICENSE.md for licensing information.

PKG             := libatomic_ops
$(PKG)_WEBSITE  := https://github.com/ivmai/libatomic_ops
$(PKG)_DESCR    := The atomic_ops project (Atomic memory update operations portable implementation)
$(PKG)_IGNORE   := 7.6%
$(PKG)_VERSION  := 7.4.8
$(PKG)_CHECKSUM := b985816abc69df5781d6d9fcf081e03a3a1e44032030d0a2c28f8de731e7f20f
$(PKG)_GH_CONF  := ivmai/libatomic_ops/tags,v
$(PKG)_DEPS     := cc

define $(PKG)_BUILD
    # build and install the library
    cd '$(SOURCE_DIR)' && autoreconf -fi
    cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
        $(MXE_CONFIGURE_OPTS)
    $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
    $(MAKE) -C '$(BUILD_DIR)' -j 1 install

    # create pkg-config file
    # the *_gpl lib has extra functions needed for test program
    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
    (echo 'Name: atomic_ops_gpl'; \
     echo 'Version: $($(PKG)_VERSION)'; \
     echo 'Description: $($(PKG)_DESCR)'; \
     echo 'Requires: atomic_ops'; \
     echo 'Libs: -latomic_ops_gpl';) \
     > '$(PREFIX)/$(TARGET)/lib/pkgconfig/atomic_ops_gpl.pc'

    # compile test
    '$(TARGET)-gcc' \
        -W -Wall -Werror -pedantic \
        '$(SOURCE_DIR)/tests/test_stack.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
        `'$(TARGET)-pkg-config' atomic_ops_gpl --cflags --libs`
endef