소스 검색

package/sqlite: fix build issue since bump to 3.49.0

As of release 3.49.0, the author has replaced the configure script used in
the precompiled amalgamation tarball with Autosetup instead of Autotools.

Buildroot commit [1] bumped sqlite to 3.49.0 without changing the
package infra. This introduced build issues.

The "autotools-package" and "host-autotools-package" lines are no longer
available, so those have to be replaced by the "generic-package" and
"host-generic-package" lines in the .mk file.

The Autosetup configuration script does not support the
"enable-dynamic-extensions" and "disable-static-shell" options,
so the relevant lines in the .mk file are removed.

The Autosetup configuration script can automatically detect whether
threads are supported and set the relevant SQLITE_THREADSAFE flag,
so the relevant lines in the .mk file are removed.

Fixes:
  https://autobuild.buildroot.org/?reason=sqlite-3.49.0

[1] https://gitlab.com/buildroot.org/buildroot/-/commit/db85638cea3414ca0293cbbb2352e5b0b63a2579

Signed-off-by: Scott Fan <fancp2007@gmail.com>
Tested-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
[Julien: add link to commit which introduced the build issue]
Signed-off-by: Julien Olivain <ju.o@free.fr>
Scott Fan 5 달 전
부모
커밋
a93680be30
1개의 변경된 파일54개의 추가작업 그리고 28개의 파일을 삭제
  1. 54 28
      package/sqlite/sqlite.mk

+ 54 - 28
package/sqlite/sqlite.mk

@@ -21,14 +21,6 @@ ifeq ($(BR2_PACKAGE_SQLITE_ENABLE_COLUMN_METADATA),y)
 SQLITE_CFLAGS += -DSQLITE_ENABLE_COLUMN_METADATA
 endif
 
-ifeq ($(BR2_PACKAGE_SQLITE_ENABLE_FTS3),y)
-SQLITE_CFLAGS += -DSQLITE_ENABLE_FTS3
-endif
-
-ifeq ($(BR2_PACKAGE_SQLITE_ENABLE_JSON1),y)
-SQLITE_CFLAGS += -DSQLITE_ENABLE_JSON1
-endif
-
 ifeq ($(BR2_PACKAGE_SQLITE_ENABLE_UNLOCK_NOTIFY),y)
 SQLITE_CFLAGS += -DSQLITE_ENABLE_UNLOCK_NOTIFY
 endif
@@ -50,30 +42,64 @@ else
 SQLITE_CFLAGS += $(subst -Ofast,-O3,$(TARGET_CFLAGS))
 endif
 
-SQLITE_CONF_ENV = CFLAGS="$(SQLITE_CFLAGS)"
-
-ifeq ($(BR2_STATIC_LIBS),y)
-SQLITE_CONF_OPTS += --enable-dynamic-extensions=no
-else
-SQLITE_CONF_OPTS += --disable-static-shell
-endif
-
-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
-SQLITE_CONF_OPTS += --enable-threadsafe
-else
-SQLITE_CONF_OPTS += --disable-threadsafe
-SQLITE_CFLAGS += -DSQLITE_THREADSAFE=0
-endif
-
 ifeq ($(BR2_PACKAGE_NCURSES)$(BR2_PACKAGE_READLINE),yy)
 SQLITE_DEPENDENCIES += ncurses readline
-SQLITE_CONF_OPTS += --disable-editline --enable-readline
 else ifeq ($(BR2_PACKAGE_LIBEDIT),y)
 SQLITE_DEPENDENCIES += libedit
-SQLITE_CONF_OPTS += --enable-editline --disable-readline
+SQLITE_CONF_OPTS += --disable-readline --editline
 else
-SQLITE_CONF_OPTS += --disable-editline --disable-readline
+SQLITE_CONF_OPTS += --disable-readline
 endif
 
-$(eval $(autotools-package))
-$(eval $(host-autotools-package))
+ifeq ($(BR2_PACKAGE_SQLITE_ENABLE_FTS3),y)
+SQLITE_CONF_OPTS += --fts3
+endif
+
+ifeq ($(BR2_PACKAGE_SQLITE_ENABLE_JSON1),)
+SQLITE_CONF_OPTS += --disable-json
+endif
+
+SQLITE_CONF_ENV = CFLAGS="$(SQLITE_CFLAGS)"
+
+define SQLITE_CONFIGURE_CMDS
+	(cd $(@D); $(TARGET_CONFIGURE_OPTS) $(SQLITE_CONF_ENV) ./configure \
+		--prefix=/usr \
+		--host="$(GNU_TARGET_NAME)" \
+		--build="$(GNU_HOST_NAME)" \
+		--sysroot="$(STAGING_DIR)" \
+		$(SQLITE_CONF_OPTS) \
+	)
+endef
+
+define SQLITE_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define SQLITE_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) DESTDIR="$(STAGING_DIR)" -C $(@D) install
+endef
+
+define SQLITE_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install
+endef
+
+define HOST_SQLITE_CONFIGURE_CMDS
+	(cd $(@D); $(HOST_CONFIGURE_OPTS) $(SQLITE_CONF_ENV) ./configure \
+		--prefix=/usr \
+		--host="$(GNU_HOST_NAME)" \
+		--build="$(GNU_HOST_NAME)" \
+		--sysroot="$(HOST_DIR)" \
+		$(SQLITE_CONF_OPTS) \
+	)
+endef
+
+define HOST_SQLITE_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define HOST_SQLITE_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) DESTDIR="$(HOST_DIR)" -C $(@D) install
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))