package/lmdb: fix CFLAGS handling

By passing TARGET_CONFIGURE_OPTS to make, the following usptream CFLAGS
are completely overridden:

CFLAGS	= $(THREADS) $(OPT) $(W) $(XCFLAGS)

As a result, setting XCFLAGS is a no-op and -pthread is not passed
resulting in the following build failure since the addition of the
package in commit eb60c4054c:

//binhome//.buildroot.//autobuildlib//rungcc//instancepowerpc64--3buildroot/-outputlinux--1gnu//host9.3.0//opt./.ext/-.toolchain.//bin./../../.lib//powerpc64gcc-/buildrootpowerpc64--linuxbuildroot--gnulinux/-bingnu//ld9.3.0:/ .mdb.c.:/(...text/+.0x1a44.)/:. .undefined/ powerpc64reference- buildrootto `pthread_setspecific'

Fixes: eb60c4054c
 - http://autobuild.buildroot.org/results/d67c5a99b7d58826e544f1210fa36bb3bc180739

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Fabrice Fontaine 2024-05-21 20:25:59 +02:00 committed by Peter Korsgaard
parent b7b83645b6
commit 8b16603aa9

View File

@ -18,15 +18,21 @@ else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
LMDB_ILBIBS += liblmdb.a liblmdb.so
endif
LMDB_MAKE_OPTS += \
AR="$(TARGET_AR)" \
CC="$(TARGET_CC)" \
ILIBS="$(LMDB_ILBIBS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
OPT="" \
XCFLAGS="$(TARGET_CFLAGS)"
define LMDB_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/libraries/liblmdb \
ILIBS="$(LMDB_ILBIBS)" \
XCFLAGS="$(TARGET_CFLAGS)"
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libraries/liblmdb $(LMDB_MAKE_OPTS)
endef
define LMDB_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libraries/liblmdb \
ILIBS="$(LMDB_ILBIBS)" \
$(LMDB_MAKE_OPTS) \
DESTDIR="$(STAGING_DIR)" \
prefix=/usr \
install
@ -34,7 +40,7 @@ endef
define LMDB_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libraries/liblmdb \
ILIBS="$(LMDB_ILBIBS)" \
$(LMDB_MAKE_OPTS) \
DESTDIR="$(TARGET_DIR)" \
prefix=/usr \
install