fix cross compile build issues
This commit is contained in:
parent
065a9221e2
commit
b6b46cbad0
@ -24,6 +24,9 @@ BuildArch: noarch
|
|||||||
# Don't try to link against pthreads even if it is available
|
# Don't try to link against pthreads even if it is available
|
||||||
Patch1001: sqlite-dont-search-for-pthreads-on-non-unix.patch
|
Patch1001: sqlite-dont-search-for-pthreads-on-non-unix.patch
|
||||||
|
|
||||||
|
# Don't force build exe extension same as target exe extension
|
||||||
|
Patch1002: sqlite-mingw-crosscompile.patch
|
||||||
|
|
||||||
BuildRequires: mingw32-filesystem >= 95
|
BuildRequires: mingw32-filesystem >= 95
|
||||||
BuildRequires: mingw32-gcc
|
BuildRequires: mingw32-gcc
|
||||||
BuildRequires: mingw32-binutils
|
BuildRequires: mingw32-binutils
|
||||||
@ -134,7 +137,8 @@ This package contains static cross-compiled library
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name1}-src-%{realver}
|
%setup -q -n %{name1}-src-%{realver}
|
||||||
%patch1001 -p0
|
%patch1001 -p0 -b .pthread
|
||||||
|
%patch1002 -p0 -b .cc
|
||||||
autoreconf -i --force
|
autoreconf -i --force
|
||||||
|
|
||||||
|
|
||||||
@ -151,7 +155,7 @@ export config_TARGET_EXEEXT=.exe
|
|||||||
export MINGW32_CFLAGS="%{mingw32_cflags} -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -fno-strict-aliasing"
|
export MINGW32_CFLAGS="%{mingw32_cflags} -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -fno-strict-aliasing"
|
||||||
export MINGW64_CFLAGS="%{mingw64_cflags} -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -fno-strict-aliasing"
|
export MINGW64_CFLAGS="%{mingw64_cflags} -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -fno-strict-aliasing"
|
||||||
|
|
||||||
%mingw_configure %{!?with_tcl:--disable-tcl} --enable-threadsafe --enable-threads-override-locks --enable-load-extension
|
%mingw_configure %{!?with_tcl:--disable-tcl} --enable-load-extension
|
||||||
|
|
||||||
# -lc hack
|
# -lc hack
|
||||||
for i in build_win32 build_win64 ; do
|
for i in build_win32 build_win64 ; do
|
||||||
@ -182,12 +186,6 @@ mv $RPM_BUILD_ROOT%{_datadir}/tcl%{tclversion}/sqlite3/pkgIndex.tcl $RPM_BUILD_R
|
|||||||
# Drop all .la files
|
# Drop all .la files
|
||||||
find $RPM_BUILD_ROOT -name "*.la" -delete
|
find $RPM_BUILD_ROOT -name "*.la" -delete
|
||||||
|
|
||||||
# For some reason the libraries are installed in /lib
|
|
||||||
# instead of /bin when a modern automake is used
|
|
||||||
mv $RPM_BUILD_ROOT%{mingw32_libdir}/libsqlite3-0.dll $RPM_BUILD_ROOT%{mingw32_bindir}/
|
|
||||||
mv $RPM_BUILD_ROOT%{mingw64_libdir}/libsqlite3-0.dll $RPM_BUILD_ROOT%{mingw64_bindir}/
|
|
||||||
|
|
||||||
|
|
||||||
# Win32
|
# Win32
|
||||||
%files -n mingw32-%{name1}
|
%files -n mingw32-%{name1}
|
||||||
%doc README.md VERSION
|
%doc README.md VERSION
|
||||||
|
@ -1,54 +1,11 @@
|
|||||||
--- configure.ac.orig 2016-01-14 18:40:14.000000000 +0100
|
--- configure.ac.pthread 2016-01-20 22:49:56.000000000 +0100
|
||||||
+++ configure.ac 2016-01-14 13:36:30.906755007 +0100
|
+++ configure.ac 2016-01-21 12:44:53.595296633 +0100
|
||||||
@@ -179,25 +179,6 @@
|
@@ -193,7 +193,7 @@
|
||||||
AC_SUBST(BUILD_CC)
|
fi
|
||||||
|
AC_SUBST(SQLITE_THREADSAFE)
|
||||||
|
|
||||||
##########
|
|
||||||
-# Do we want to support multithreaded use of sqlite
|
|
||||||
-#
|
|
||||||
-AC_ARG_ENABLE(threadsafe,
|
|
||||||
-AC_HELP_STRING([--disable-threadsafe],[Disable mutexing]),,enable_threadsafe=yes)
|
|
||||||
-AC_MSG_CHECKING([whether to support threadsafe operation])
|
|
||||||
-if test "$enable_threadsafe" = "no"; then
|
|
||||||
- SQLITE_THREADSAFE=0
|
|
||||||
- AC_MSG_RESULT([no])
|
|
||||||
-else
|
|
||||||
- SQLITE_THREADSAFE=1
|
|
||||||
- AC_MSG_RESULT([yes])
|
|
||||||
-fi
|
|
||||||
-AC_SUBST(SQLITE_THREADSAFE)
|
|
||||||
-
|
|
||||||
-if test "$SQLITE_THREADSAFE" = "1"; then
|
-if test "$SQLITE_THREADSAFE" = "1"; then
|
||||||
- AC_SEARCH_LIBS(pthread_create, pthread)
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-##########
|
|
||||||
# Do we want to support release
|
|
||||||
#
|
|
||||||
AC_ARG_ENABLE(releasemode,
|
|
||||||
@@ -284,6 +265,25 @@
|
|
||||||
AC_SUBST(TARGET_EXEEXT)
|
|
||||||
|
|
||||||
##########
|
|
||||||
+# Do we want to support multithreaded use of sqlite
|
|
||||||
+#
|
|
||||||
+AC_ARG_ENABLE(threadsafe,
|
|
||||||
+AC_HELP_STRING([--enable-threadsafe],[Support threadsafe operation]),,enable_threadsafe=yes)
|
|
||||||
+AC_MSG_CHECKING([whether to support threadsafe operation])
|
|
||||||
+if test "$enable_threadsafe" = "no"; then
|
|
||||||
+ SQLITE_THREADSAFE=0
|
|
||||||
+ AC_MSG_RESULT([no])
|
|
||||||
+else
|
|
||||||
+ SQLITE_THREADSAFE=1
|
|
||||||
+ AC_MSG_RESULT([yes])
|
|
||||||
+fi
|
|
||||||
+AC_SUBST(SQLITE_THREADSAFE)
|
|
||||||
+
|
|
||||||
+if test "$SQLITE_THREADSAFE" = "1" -a "$SQLITE_OS_UNIX" = "1" ; then
|
+if test "$SQLITE_THREADSAFE" = "1" -a "$SQLITE_OS_UNIX" = "1" ; then
|
||||||
+ AC_SEARCH_LIBS(pthread_create, pthread)
|
AC_SEARCH_LIBS(pthread_create, pthread)
|
||||||
+fi
|
fi
|
||||||
+
|
|
||||||
+##########
|
|
||||||
# Figure out all the parameters needed to compile against Tcl.
|
|
||||||
#
|
|
||||||
# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG
|
|
||||||
|
36
sqlite-mingw-crosscompile.patch
Normal file
36
sqlite-mingw-crosscompile.patch
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
--- configure.ac.cc 2016-01-21 12:46:12.406557715 +0100
|
||||||
|
+++ configure.ac 2016-01-21 12:53:44.120566439 +0100
|
||||||
|
@@ -258,16 +258,7 @@
|
||||||
|
if test "$CYGWIN" != "yes"; then
|
||||||
|
AC_CYGWIN
|
||||||
|
fi
|
||||||
|
-if test "$CYGWIN" = "yes"; then
|
||||||
|
- BUILD_EXEEXT=.exe
|
||||||
|
-else
|
||||||
|
- BUILD_EXEEXT=$EXEEXT
|
||||||
|
-fi
|
||||||
|
-if test x"$cross_compiling" = xno; then
|
||||||
|
- TARGET_EXEEXT=$BUILD_EXEEXT
|
||||||
|
-else
|
||||||
|
- TARGET_EXEEXT=$config_TARGET_EXEEXT
|
||||||
|
-fi
|
||||||
|
+TARGET_EXEEXT=$EXEEXT
|
||||||
|
if test "$TARGET_EXEEXT" = ".exe"; then
|
||||||
|
SQLITE_OS_UNIX=0
|
||||||
|
SQLITE_OS_WIN=1
|
||||||
|
--- Makefile.in.cc 2016-01-21 12:58:26.251338551 +0100
|
||||||
|
+++ Makefile.in 2016-01-21 12:58:46.044901935 +0100
|
||||||
|
@@ -1169,10 +1169,10 @@
|
||||||
|
lib_install: libsqlite3.la
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(libdir)
|
||||||
|
$(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
|
||||||
|
-
|
||||||
|
-install: sqlite3$(BEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
|
||||||
|
+
|
||||||
|
+install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install}
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(bindir)
|
||||||
|
- $(LTINSTALL) sqlite3$(BEXE) $(DESTDIR)$(bindir)
|
||||||
|
+ $(LTINSTALL) sqlite3$(TEXE) $(DESTDIR)$(bindir)
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(includedir)
|
||||||
|
$(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
|
||||||
|
$(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
|
Loading…
Reference in New Issue
Block a user