Attached are some patches against sqlite-3.3.6:
[configure.ac]
1. The result of AC_MSG_CHECKING([switches on the target compiler])
should be printed before the call to AC_PROG_RANLIB to avoid:
checking switches on the target compiler... checking for ranlib...
2. Why AC_CHECK_FUNC(fdatasync, ...) if we already
AC_SEARCH_LIBS(fdatasync)? Might as well combine the two.
3. Solaris 2.6 has fdatasync() in -lposix4.
[Makefile.in]
1. Why not add $(TLIBS) to the libraries, not the sqlite binary?
Libraries should have dependent libraries link in, so programs
linking against them don't need to link with $(TLIBS). And,
it's the libraries that use fdatasync() so they need to be
linked against whatever system library provides this function.
2. Missed one use of awk which should be $(NAWK).
--
albert chin ([EMAIL PROTECTED])
Index: configure.ac
===================================================================
--- configure.ac.orig 2006-06-06 05:52:26.000000000 -0500
+++ configure.ac 2006-06-19 16:33:16.035471000 -0500
@@ -244,6 +245,7 @@
else
TARGET_TFLAGS=$BUILD_CFLAGS
fi
+AC_MSG_RESULT($TARGET_TFLAGS)
if test "$config_TARGET_RANLIB" != ""; then
TARGET_RANLIB=$config_TARGET_RANLIB
else
@@ -255,7 +257,6 @@
else
TARGET_AR='ar cr'
fi
-AC_MSG_RESULT($TARGET_TFLAGS)
AC_SUBST(TARGET_CC)
AC_SUBST(TARGET_CFLAGS)
AC_SUBST(TARGET_LINK)
@@ -609,7 +606,8 @@
#
CC=$TARGET_CC
LIBS=$TARGET_LIBS
-AC_SEARCH_LIBS(fdatasync, [rt])
+AC_SEARCH_LIBS(fdatasync, [rt posix4],
+ [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"])
TARGET_LIBS="$LIBS"
##########
@@ -669,12 +667,6 @@
#
AC_CHECK_FUNC(usleep, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_USLEEP=1"])
-#--------------------------------------------------------------------
-# Redefine fdatasync as fsync on systems that lack fdatasync
-#--------------------------------------------------------------------
-
-AC_CHECK_FUNC(fdatasync, [TARGET_CFLAGS="$TARGET_CFLAGS -DHAVE_FDATASYNC=1"])
-
#########
# Put out accumulated miscellaneous LIBRARIES
#
Index: Makefile.in
===================================================================
--- Makefile.in.orig 2006-06-06 05:52:26.000000000 -0500
+++ Makefile.in 2006-06-19 16:42:45.168499000 -0500
@@ -248,19 +248,19 @@
| $(NAWK) '{print $$5,$$6}' >last_change
libsqlite3.la: $(LIBOBJ)
- $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) \
+ $(LTLINK) -o libsqlite3.la $(LIBOBJ) $(LIBPTHREAD) $(TLIBS) \
${ALLOWRELEASE} -rpath $(libdir) -version-info "8:6:8"
libtclsqlite3.la: tclsqlite.lo libsqlite3.la
$(LTLINK) -o libtclsqlite3.la tclsqlite.lo \
- $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(LIBPTHREAD) \
+ $(LIBOBJ) @TCL_STUB_LIB_SPEC@ $(LIBPTHREAD) $(TLIBS) \
-rpath $(libdir)/sqlite \
-version-info "8:6:8"
sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
$(LTLINK) $(READLINE_FLAGS) $(LIBPTHREAD) \
-o $@ $(TOP)/src/shell.c libsqlite3.la \
- $(LIBREADLINE) $(TLIBS)
+ $(LIBREADLINE)
# This target creates a directory named "tsrc" and fills it with
# copies of all of the C source code and header files needed to
@@ -366,7 +366,7 @@
cp $(TOP)/src/parse.y .
./lemon $(OPTS) parse.y
mv parse.h parse.h.temp
- awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
+ $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
pragma.lo: $(TOP)/src/pragma.c $(HDR)
$(LTCOMPILE) -c $(TOP)/src/pragma.c