lib/configure.ad.
Added --with-silc-includes and --with-silc-libs to provide
libs from somewhere else than included.
+Sat Apr 2 18:09:30 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
+
+ * Splitted the SILC libraries configuration into a configure
+ fragment into lib/configure.ad. It is now possible, once
+ this feature is added, to specify whether to compile or not
+ compile included SILC libraries. Affected files are
+ configure.in.pre, lib/silcmath/mpi/configure.ad,
+ lib/configure.ad, Makefile.defines.pre and
+ Makefile.defines_int.pre.
+
+ * Added --with-silc-includes and --with-silc-libs to configure.
+ If specified the included libs are not compiled, but the
+ specified libs are used. Pkg-config is not yet supported.
+ Affected file configure.in.pre.
+
Fri Apr 1 18:52:47 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
* Changed announcing to not announce unregistered clients.
#
INCLUDES = $(ADD_INCLUDES) $(SILC_CFLAGS) -DHAVE_SILCDEFS_H \
-I$(srcdir) -I$(top_srcdir) \
- -I$(silc_top_srcdir) \
- -I$(silc_top_srcdir)/lib/silccore \
- -I$(silc_top_srcdir)/lib/silccrypt \
- -I$(silc_top_srcdir)/lib/silcmath \
- -I$(silc_top_srcdir)/lib/silcmath/mpi \
- -I$(silc_top_srcdir)/lib/silcske \
- -I$(silc_top_srcdir)/lib/silcsim \
- -I$(silc_top_srcdir)/lib/silcutil \
- -I$(silc_top_srcdir)/lib/silcsftp \
- -I$(silc_top_srcdir)/lib/silcclient \
- -I$(silc_top_srcdir)/lib/contrib \
+ -I$(silc_top_srcdir) $(SILC_LIB_INCLUDES) \
-I$(silc_top_srcdir)/includes \
-I$(silc_top_srcdir)/doc
#
SILC_CFLAGS=@CFLAGS@
+#
+# SILC Library includes
+#
+SILC_LIB_INCLUDES=@SILC_LIB_INCLUDES@
+
#
# Installation defines
#
SILC_DIST_SUBDIRS="SILC_DISTRIBUTION_SUBDIRS"
AC_DEFINE(SILC_DIST_DEFINE)
-
-##
-## Library versioning.
-##
-# Do the releases and library versioning according to following rules:
-#
-# - If any code has changed in library, increment [LIB]_REVISION
-# - If functions were added, set [LIB]_REVISION to 0
-# - If functions were added, removed or changed, increment [LIB]_CURRENT
-# - If functions were added, increment [LIB]_AGE
-# - If functions were removed, set [LIB]_AGE to 0
-#
-# where [LIB] is LIBSILC and LIBSILCCLIENT, and where "functions" means
-# functions public interfaces.
-#
-# The LIB_BASE_VERSION defines the SILC software major.minor version and
-# it is increment only when these version numbers actually change.
-#
-
-# Base version for libraries. Do not change this unless SILC version
-# changes too.
-LIB_BASE_VERSION=1.0
-
-# libsilc versions
-LIBSILC_CURRENT=3
-LIBSILC_REVISION=0
-LIBSILC_AGE=2
-
-# libsilcclient versions
-LIBSILCCLIENT_CURRENT=3
-LIBSILCCLIENT_REVISION=0
-LIBSILCCLIENT_AGE=2
-
-# Substitute the version numbers
-AC_SUBST(LIB_BASE_VERSION)
-AC_SUBST(LIBSILC_CURRENT)
-AC_SUBST(LIBSILC_REVISION)
-AC_SUBST(LIBSILC_AGE)
-AC_SUBST(LIBSILCCLIENT_CURRENT)
-AC_SUBST(LIBSILCCLIENT_REVISION)
-AC_SUBST(LIBSILCCLIENT_AGE)
+__SILC_HAVE_PTHREAD=""
+__SILC_HAVE_SIM=""
+__SILC_HAVE_LIBIDN=""
+__SILC_ENABLE_DEBUG=""
#
# Program checking
])
])
-__SILC_HAVE_SIM=""
AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
if test x$sim_support = xtrue; then
AC_MSG_RESULT(Enabled SIM support.)
AC_MSG_RESULT(no)
])
-# Stack trace checking
-#
-AC_MSG_CHECKING(whether to enable stack tracing)
-summary_stacktrace="no"
-AC_ARG_ENABLE(stack-trace,
- [ --enable-stack-trace enable memory stack trace],
- [
- case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(SILC_STACKTRACE)
- summary_stacktrace="yes"
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac
- ],
- AC_MSG_RESULT(no)
- )
-
# Disable all assembler optimizations
#
AC_MSG_CHECKING(whether to enable assembler optimizations)
## With/without checkings
##
+#
+# SILC library checking
+compile_libs=true
+AC_ARG_WITH(silc-includes,
+ [ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
+ [ac_silc_includes="$withval"], [ac_silc_includes="no"])
+AC_ARG_WITH(silc-libs,
+ [ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]],
+ [ac_silc_libs="$withval"], [ac_silc_libs="no"])
+
+#
+# XXX missing checking the __SILC_WITH_XXX defines from the provided libs
+# in order to determine correct libs to link.
+
+#
+# XXX missing pkg-config check.
+
+if test "$ac_silc_includes" != "no"; then
+ compile_libs=false
+ SILC_LIB_INCLUDES="-I$ac_silc_includes"
+fi
+if test "$ac_silc_libs" != "no"; then
+ compile_libs=false
+ LIBS="$LIBS -L$ac_silc_libs"
+fi
+
+
# SOCKS4 support checking
#
SAVE_LIBS="$LIBS"
AC_MSG_RESULT(Using NSS MPI as a MP library.)
fi
+
# GNU Libidn (for stringprep) support
#
check_libidn=true
done
fi
-__SILC_HAVE_LIBIDN=""
if test x$has_libidn = xtrue; then
__SILC_HAVE_LIBIDN="#define __SILC_HAVE_LIBIDN 1"
else
libtoolfix=true
AC_MSG_CHECKING(whether to do libtoolfix)
AC_ARG_WITH(libtoolfix,
- [ --without-libtoolfix Do not fix libtool, for package builders],
+ [ --without-libtoolfix Do not fix libtool, for package builders],
[
AC_MSG_RESULT(no)
libtoolfix=false
fi
SILC_TOP_SRCDIR=`pwd`
+
+# Included configure scripts
+AD_INCLUDE_CONFIGURE
+
+#
+# Substitutions
+#
AC_SUBST(SILC_TOP_SRCDIR)
-#SILC_INSTALL_PREFIX=$ac_default_prefix
-#AC_SUBST(SILC_INSTALL_PREFIX)
AC_SUBST(LIBS)
INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
AC_SUBST(INCLUDE_DEFINES_INT)
AC_SUBST(SILC_DIST_SUBDIRS)
+AC_SUBST(SILC_LIB_INCLUDES)
#
# Fix the libtool to support run-time configuration. This allows us
fi
AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
-# Included configure scripts
-AD_INCLUDE_CONFIGURE
-
AC_SUBST(__SILC_HAVE_PTHREAD)
AC_SUBST(__SILC_HAVE_SIM)
AC_SUBST(__SILC_HAVE_LIBIDN)
Makefile.defines_int
doc/Makefile
includes/Makefile
-lib/Makefile
-lib/contrib/Makefile
-lib/silccore/Makefile
-lib/silccore/tests/Makefile
-lib/silccrypt/Makefile
-lib/silccrypt/tests/Makefile
-lib/silcsim/Makefile
-lib/silcske/Makefile
-lib/silcutil/Makefile
-lib/silcutil/unix/Makefile
-lib/silcutil/win32/Makefile
-lib/silcutil/beos/Makefile
-lib/silcutil/os2/Makefile
-lib/silcutil/epoc/Makefile
-lib/silcutil/tests/Makefile
-lib/silcmath/Makefile
-lib/silcsftp/Makefile
-lib/silcsftp/tests/Makefile
doc/example_silcd.conf
includes/silcincludes.h
)
-if test "x$silc_dist" = "xsilc-client" ||
- test "x$silc_dist" = "xsilc-toolkit"; then
- AC_CONFIG_FILES(lib/silcclient/Makefile)
-fi
-
if test x$without_irssi = xfalse ; then
if test "x$silc_dist" = "xsilc-client" ||
test "x$silc_dist" = "xsilc-toolkit"; then
fi
echo " Multi-threads support .........: $threads"
echo " Debugging enabled .............: $summary_debug"
-echo " Stack-trace enabled ...........: $summary_stacktrace"
echo ""
if test "x$silc_dist" = "xsilc-client"; then
echo "Compile the sources with 'make' or 'gmake' command (GNU make is required)."
--- /dev/null
+#
+# lib/configure.ad
+#
+# Author: Pekka Riikonen <priikone@silcnet.org>
+#
+# Copyright (C) 2005 Pekka Riikonen
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+if test x$compile_libs = xfalse; then
+
+##
+## Not compiling included libs.
+##
+
+# Remove lib subdir from SUBDIRS
+SILC_DIST_SUBDIRS=`echo $SILC_DIST_SUBDIRS | $sedpath -e 's/lib//'`
+
+else # compile_libs = true
+
+##
+## Will compile included libs
+##
+AC_MSG_NOTICE([Configuring SILC libraries])
+
+# SILC Library directories
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccore"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccrypt"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcmath"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcmath/mpi"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsim"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsftp"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcclient"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib"
+
+##
+## Library versioning.
+##
+# Do the releases and library versioning according to following rules:
+#
+# - If any code has changed in library, increment [LIB]_REVISION
+# - If functions were added, set [LIB]_REVISION to 0
+# - If functions were added, removed or changed, increment [LIB]_CURRENT
+# - If functions were added, increment [LIB]_AGE
+# - If functions were removed, set [LIB]_AGE to 0
+#
+# where [LIB] is LIBSILC and LIBSILCCLIENT, and where "functions" means
+# functions public interfaces.
+#
+# The LIB_BASE_VERSION defines the SILC software major.minor version and
+# it is increment only when these version numbers actually change.
+#
+
+# Base version for libraries. Do not change this unless SILC version
+# changes too.
+LIB_BASE_VERSION=1.0
+
+# libsilc versions
+LIBSILC_CURRENT=3
+LIBSILC_REVISION=0
+LIBSILC_AGE=2
+
+# libsilcclient versions
+LIBSILCCLIENT_CURRENT=3
+LIBSILCCLIENT_REVISION=0
+LIBSILCCLIENT_AGE=2
+
+# Substitute the version numbers
+AC_SUBST(LIB_BASE_VERSION)
+AC_SUBST(LIBSILC_CURRENT)
+AC_SUBST(LIBSILC_REVISION)
+AC_SUBST(LIBSILC_AGE)
+AC_SUBST(LIBSILCCLIENT_CURRENT)
+AC_SUBST(LIBSILCCLIENT_REVISION)
+AC_SUBST(LIBSILCCLIENT_AGE)
+
+# Stack trace checking
+#
+AC_MSG_CHECKING(whether to enable stack tracing)
+AC_ARG_ENABLE(stack-trace,
+ [ --enable-stack-trace enable memory stack trace],
+ [
+ case "${enableval}" in
+ yes)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(SILC_STACKTRACE)
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac
+ ],
+ AC_MSG_RESULT(no)
+ )
+
+#
+# Makefile outputs
+#
+AC_CONFIG_FILES(
+lib/Makefile
+lib/contrib/Makefile
+lib/silccore/Makefile
+lib/silccore/tests/Makefile
+lib/silccrypt/Makefile
+lib/silccrypt/tests/Makefile
+lib/silcsim/Makefile
+lib/silcske/Makefile
+lib/silcutil/Makefile
+lib/silcutil/unix/Makefile
+lib/silcutil/win32/Makefile
+lib/silcutil/beos/Makefile
+lib/silcutil/os2/Makefile
+lib/silcutil/epoc/Makefile
+lib/silcutil/tests/Makefile
+lib/silcmath/Makefile
+lib/silcsftp/Makefile
+lib/silcsftp/tests/Makefile
+)
+
+if test "x$silc_dist" = "xsilc-client" ||
+ test "x$silc_dist" = "xsilc-toolkit"; then
+ AC_CONFIG_FILES(lib/silcclient/Makefile)
+fi
+
+fi # compile_libs
+
/*
- silcsftp.h
+ silcsftp.h
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 Pekka Riikonen
+ Copyright (C) 2001 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/****s* silcsftp/SilcSFTPAPI/SilcSFTP
*
* NAME
- *
+ *
* typedef struct SilcSFTPStruct *SilcSFTP;
*
* DESCRIPTION
* This context is the actual SFTP client and SFTP server, and is
* allocated by silc_sftp_client_start or silc_sftp_server_start and
* given as argument usually to all silc_sftp_* functions. It is freed
- * by the silc_sftp_client_shutdown or silc_sftp_server_shutdown
+ * by the silc_sftp_client_shutdown or silc_sftp_server_shutdown
* functions.
*
***/
/****d* silcsftp/SilcSFTPAPI/SilcSFTPVersion
*
* NAME
- *
+ *
* typedef SilcUInt32 SilcSFTPVersion;
*
* DESCRIPTION
/****d* silcsftp/SilcSFTPAPI/SilcSFTPStatus
*
* NAME
- *
+ *
* typedef enum { ... } SilcSFTPStatus
*
* DESCRIPTION
SILC_SFTP_STATUS_NO_CONNECTION = 6, /* No connection to server */
SILC_SFTP_STATUS_CONNECTION_LOST = 7, /* Connection lost to server */
SILC_SFTP_STATUS_OP_UNSUPPORTED = 8, /* Operation unsupported */
+ SILC_SFTP_STATUS_INVALID_HANDLE = 9, /* Invalid file handle */
+ SILC_SFTP_STATUS_NO_SUCH_PATH = 10, /* Path does not exist */
+ SILC_SFTP_STATUS_FILE_ALREADY_EXIST = 11, /* File already exists */
+ SILC_SFTP_STATUS_WRITE_PROTECT = 12, /* Read-only or protected */
+ SILC_SFTP_STATUS_NO_MEDIA = 13, /* No media available */
+ SILC_SFTP_STATUS_NO_SPACE_ON_DEVICE = 14, /* No space on device */
+ SILC_SFTP_STATUS_QUOTA_EXCEEDED = 15, /* Quota limit reached */
+ SILC_SFTP_STATUS_UNKNOWN_PRINCIBLE = 16, /* Unknown princible */
+ SILC_SFTP_STATUS_LOCK_CONFLICT = 17, /* File already locked */
+ SILC_SFTP_STATUS_NOT_EMPTY = 18, /* Directory not empty */
+ SILC_SFTP_STATUS_NOT_A_DIRECTORY = 19, /* Not a directory */
+ SILC_SFTP_STATUS_INVALID_FILENAME = 20, /* Invalid filename */
+ SILC_SFTP_STATUS_LINK_LOOP = 21, /* Too many symlinks */
+ SILC_SFTP_STATUS_CANNOT_DELETE = 22, /* Could not delete file */
+ SILC_SFTP_STATUS_INVALID_PARAMETER = 23, /* Invalid parameter */
+ SILC_SFTP_STATUS_FILE_IS_A_DIRECTORY = 24, /* File is a directory file */
+ SILC_SFTP_STATUS_BR_LOCK_CONFLICT = 25, /* Byte range lock conflict */
+ SILC_SFTP_STATUS_BR_LOCK_REFUSED = 26, /* Byte range lock refused */
+ SILC_SFTP_STATUS_DELETE_PENDING = 27, /* File is being deleted */
+ SILC_SFTP_STATUS_FILE_CORRUPT = 28, /* File is corrupted */
} SilcSFTPStatus;
/***/
/****d* silcsftp/SilcSFTPAPI/SilcSFTPFileOperation
*
* NAME
- *
+ *
* typedef enum { ... } SilcSFTPFileOperation
*
* DESCRIPTION
/****s* silcsftp/SilcSFTPAPI/SilcSFTPAttributes
*
* NAME
- *
+ *
* typedef struct { ... } *SilcSFTPAttributes, SilcSFTPAttributesStruct;
*
* DESCRIPTION
*
* SFTP File attributes structure represents the attributes for a file.
- * This structure can be used by the client to send attributes to the
+ * This structure can be used by the client to send attributes to the
* server, and by server to return file attributes to the client.
*
***/
/****s* silcsftp/SilcSFTPAPI/SilcSFTPName
*
* NAME
- *
+ *
* typedef struct { ... } *SilcSFTPName, SilcSFTPNameStruct
*
* DESCRIPTION
/****s* silcsftp/SilcSFTPAPI/SilcSFTPHandle
*
* NAME
- *
+ *
* typedef struct SilcSFTPHandleStruct *SilcSFTPHandle;
*
* DESCRIPTION
*
* SYNOPSIS
*
- * typedef void (*SilcSFTPSendPacketCallback)(SilcBuffer packet,
+ * typedef void (*SilcSFTPSendPacketCallback)(SilcBuffer packet,
* void *context);
*
* DESCRIPTION
*
* SYNOPSIS
*
- * void silc_sftp_open(SilcSFTP sftp,
+ * void silc_sftp_open(SilcSFTP sftp,
* const char *filename,
* SilcSFTPFileOperation pflags,
* SilcSFTPAttributes attrs,
* `callback' to return the opened file handle.
*
***/
-void silc_sftp_open(SilcSFTP sftp,
+void silc_sftp_open(SilcSFTP sftp,
const char *filename,
SilcSFTPFileOperation pflags,
SilcSFTPAttributes attrs,
*
* void silc_sftp_read(SilcSFTP sftp,
* SilcSFTPHandle handle,
- * SilcUInt64 offset,
+ * SilcUInt64 offset,
* SilcUInt32 len,
* SilcSFTPDataCallback callback,
* void *context);
***/
void silc_sftp_read(SilcSFTP sftp,
SilcSFTPHandle handle,
- SilcUInt64 offset,
+ SilcUInt64 offset,
SilcUInt32 len,
SilcSFTPDataCallback callback,
void *context);
* DESCRIPTION
*
* Writes to a file indicated by the file handle `handle' starting from
- * offset of `offset' at most `data_len' bytes of `data'. The `callback'
+ * offset of `offset' at most `data_len' bytes of `data'. The `callback'
* is called to indicate the status of the writing.
*
***/
*
* DESCRIPTION
*
- * Performs an extended operation indicated by the `request' with
+ * Performs an extended operation indicated by the `request' with
* optional extended operation data indicated by the `data'. The callback
* is called to return any data associated with the extended request.
*
* SYNOPSIS
*
* SilcSFTP silc_sftp_server_start(SilcSFTPSendPacketCallback send_packet,
- * void *send_context,
+ * void *send_context,
* SilcSFTPFilesystem fs);
*
* DESCRIPTION
*
***/
SilcSFTP silc_sftp_server_start(SilcSFTPSendPacketCallback send_packet,
- void *send_context,
+ void *send_context,
SilcSFTPFilesystem fs);
/****f* silcsftp/SilcSFTPAPI/silc_sftp_server_shutdown
/****d* silcsftp/SilcSFTPAPI/SilcSFTPMonitors
*
* NAME
- *
+ *
* typedef enum { ... } SilcSFTPMonitors;
*
* DESCRIPTION
/****s* silcsftp/SilcSFTPAPI/SilcSFTPMonitorData
*
* NAME
- *
+ *
* typedef struct { ... } *SilcSFTPMonitorData, SilcSFTPMonitorDataStruct;
*
* DESCRIPTION
*
* void silc_sftp_server_set_monitor(SilcSFTP sftp,
* SilcSFTPMonitors monitors,
- * SilcSFTPMonitor monitor,
+ * SilcSFTPMonitor monitor,
* void *context);
*
* DESCRIPTION
***/
void silc_sftp_server_set_monitor(SilcSFTP sftp,
SilcSFTPMonitors monitors,
- SilcSFTPMonitor monitor,
+ SilcSFTPMonitor monitor,
void *context);
/* Function that is called to process the incmoing SFTP packet. */