Allow compile without sqlite3 and fix a little warning in netcam

This commit is contained in:
AngelCarpintero
2008-10-25 19:18:55 +00:00
parent 435a35d068
commit 7565ffb34f
4 changed files with 65 additions and 35 deletions

View File

@@ -18,9 +18,6 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have SQLITE3 support */
#undef HAVE_SQLITE3
/* Define to 1 if you have MySQL support */
#undef HAVE_MYSQL
@@ -30,6 +27,9 @@
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have SQLITE3 support */
#undef HAVE_SQLITE3
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -93,8 +93,8 @@
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* The size of `short int', as computed by sizeof. */
#undef SIZEOF_SHORT_INT
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P

51
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for motion trunk-r434.
# Generated by GNU Autoconf 2.61 for motion trunk-r435.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -572,8 +572,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='motion'
PACKAGE_TARNAME='motion'
PACKAGE_VERSION='trunk-r434'
PACKAGE_STRING='motion trunk-r434'
PACKAGE_VERSION='trunk-r435'
PACKAGE_STRING='motion trunk-r435'
PACKAGE_BUGREPORT=''
ac_unique_file="motion.c"
@@ -1177,7 +1177,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures motion trunk-r434 to adapt to many kinds of systems.
\`configure' configures motion trunk-r435 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1238,7 +1238,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of motion trunk-r434:";;
short | recursive ) echo "Configuration of motion trunk-r435:";;
esac
cat <<\_ACEOF
@@ -1269,6 +1269,8 @@ Optional Packages:
If this is not specified motion will try to find
the libraries in /usr and /usr/local.
--without-sqlite3 Disable sqlite3 support in motion.
--without-mysql Disable mysql support in motion.
--with-mysql-lib=DIR Normally, configure will scan all possible default
@@ -1374,7 +1376,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
motion configure trunk-r434
motion configure trunk-r435
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1388,7 +1390,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by motion $as_me trunk-r434, which was
It was created by motion $as_me trunk-r435, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -3351,10 +3353,25 @@ fi
#
SQLITE3_SUPPORT="no"
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
{ echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
# Check whether --with-sqlite3 was given.
if test "${with_sqlite3+set}" = set; then
withval=$with_sqlite3; SQLITE3="$withval"
# if not given argument, assume standard
fi
if test "${SQLITE3}" = "no"; then
{ echo "$as_me:$LINENO: checking for sqlite3" >&5
echo $ECHO_N "checking for sqlite3... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: result: skipping" >&5
echo "${ECHO_T}skipping" >&6; }
else
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
{ echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
echo $ECHO_N "checking for sqlite3_open in -lsqlite3... $ECHO_C" >&6; }
if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3417,8 +3434,8 @@ fi
echo "${ECHO_T}$ac_cv_lib_sqlite3_sqlite3_open" >&6; }
if test $ac_cv_lib_sqlite3_sqlite3_open = yes; then
TEMP_LIBS="$TEMP_LIBS -lsqlite3"
SQLITE3_SUPPORT="yes"
TEMP_LIBS="$TEMP_LIBS -lsqlite3"
SQLITE3_SUPPORT="yes"
cat >>confdefs.h <<\_ACEOF
#define HAVE_SQLITE3 1
@@ -3429,8 +3446,9 @@ _ACEOF
fi
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
fi
#
@@ -4782,7 +4800,6 @@ done
SUPPORTED_V4L2=false
SUPPORTED_V4L2_old=false
if test "${V4L}" = "no"; then
{ echo "$as_me:$LINENO: checking for V42L support" >&5
echo $ECHO_N "checking for V42L support... $ECHO_C" >&6; }
@@ -8213,7 +8230,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by motion $as_me trunk-r434, which was
This file was extended by motion $as_me trunk-r435, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8262,7 +8279,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
motion config.status trunk-r434
motion config.status trunk-r435
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@@ -450,19 +450,31 @@ fi
#
SQLITE3_SUPPORT="no"
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
AC_CHECK_LIB(sqlite3, sqlite3_open,
[
TEMP_LIBS="$TEMP_LIBS -lsqlite3"
SQLITE3_SUPPORT="yes"
AC_DEFINE([HAVE_SQLITE3],1,[Define to 1 if you have SQLITE3 support])
]
AC_ARG_WITH(sqlite3,
[ --without-sqlite3 Disable sqlite3 support in motion.
],
SQLITE3="$withval"
# if not given argument, assume standard
)
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
if test "${SQLITE3}" = "no"; then
AC_MSG_CHECKING(for sqlite3)
AC_MSG_RESULT(skipping)
else
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
AC_CHECK_LIB(sqlite3, sqlite3_open,
[
TEMP_LIBS="$TEMP_LIBS -lsqlite3"
SQLITE3_SUPPORT="yes"
AC_DEFINE([HAVE_SQLITE3],1,[Define to 1 if you have SQLITE3 support])
]
)
CFLAGS=$saved_CFLAGS
LIBS=$saved_LIBS
fi
#
@@ -764,7 +776,6 @@ AC_CHECK_FUNCS(get_current_dir_name)
SUPPORTED_V4L2=false
SUPPORTED_V4L2_old=false
if test "${V4L}" = "no"; then
AC_MSG_CHECKING(for V42L support)
AC_MSG_RESULT(skipping)

View File

@@ -280,8 +280,10 @@ int rbuf_peek(netcam_context_ptr netcam, char *store)
res = netcam_recv (netcam, netcam->response->buffer,
sizeof (netcam->response->buffer));
if (res <= 0)
if (res <= 0) {
*store = '\0';
return res;
}
netcam->response->buffer_left = res;
}