+.gitignore
+autodist.dist
+autodist.log
+makedist.log
Makefile
Makefile.defines
Makefile.defines_int
config.sub
configure
configure.in
+configure.ac
libtool
libtool-shared
ltconfig
ltmain.sh
-stamp-h
-stamp-h.in
+stamp-h*
+stamp-h*.in
*.o
*.lo
*.am
+This file is not updated anymore manually. See git history for same
+information.
+
+-----------------------------------------------------------------------------
+
Thu Jan 17 16:40:49 EET 2008 Pekka Riikonen <priikone@silcnet.org>
* Added SILC Thread Queue API to lib/silcutil/silcthreadqueue.[ch].
-----------------------------------------------------------------------------
-For older changes please see the CHANGES file from the CVS tree.
+For older changes please see the CHANGES file from the GIT tree.
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
SUBDIRS = \
-#ifdef SILC_DIST_LIB
@LIBSUBDIR@ \
-#endif SILC_DIST_LIB
-#ifdef SILC_DIST_APPS
apps \
-#endif SILC_DIST_APPS
-#ifdef SILC_DIST_TOOLKIT
win32 \
-#endif SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_INCLUDES
includes \
-#endif SILC_DIST_INCLUDES
-#ifdef SILC_DIST_DOC
doc
-#endif SILC_DIST_DOC
EXTRA_DIST = \
silcdefs.h.in \
-#ifdef SILC_DIST_TOOLKIT
- silc-toolkit.spec \
symbian \
-#endif SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_CLIENT
- README.PLUGIN \
-#endif SILC_DIST_CLIENT
-#ifdef SILC_DIST_SILC
- libtoolfix \
CHANGES CREDITS
-#endif SILC_DIST_SILC
-#ifdef SILC_DIST_SILC
include $(top_srcdir)/Makefile.defines.in
-#endif SILC_DIST_SILC
# Common libraries that are linked against the created executable
#
SILC_COMMON_LDFLAGS= @LDFLAGS@
-SILC_COMMON_LIBS= -lsilc @LIBS@
+SILC_COMMON_LIBS= @LIBS@
#
# Common compilation flags
#ifdef SILC_DIST_SERVER
silc_logsdir=@LOGSDIR@
logsdir = $(DESTDIR)$(silc_logsdir)
-#endif SILC_DIST_SERVER
\ No newline at end of file
+#endif SILC_DIST_SERVER
-TODO for 1.2 And Beyond
-=======================
+SILC Runtime Toolkit 1.2 and beyond
+===================================
NOTE: Any item that doesn't have (***DONE) in it, isn't done yet. The
(***TESTING NEEDED) means that the item has been done but not yet properly
to include support for OpenPGP, X.509 and SSH2.
-lib/silccore
-============
-
- o SILC_PACKET_FLAG_ACK support. Implement ACK packet and packet payload
- to silcpacket.c.
-
- o All payload encoding routines should take SilcStack as argument.
-
- o Remove SilcCommandCb from silccommand.h.
-
- o All payload test routines into lib/silccore/tests/.
-
-
-lib/silcclient, The Client Library
-==================================
-
- o UDP SILC connection support to SILC server
-
- o Giving WHOIS for nick that doesn't exist should remove any same
- named entries from the client cache.
-
- o peer-to-peer private messages
-
- o Private message key request notification to application. See XXX in
- client_prvmsg.c.
-
- o in JOIN notify handle resolving that timedout. Currently the user is
- never joined the channel if this happens. What to do if message is
- received from user that hasn't been resolved/joined?
-
- o Add the SilcStream (socket stream) from the SilcPacketStream and
- SilcSocket from the socket stream to SilcClientConnection for easier
- access to them for programmers. Currently these have to be digged up
- from the packet stream.
-
- o Connection option that attemps to connect to remot host with various
- different mechanisms: UDP 706, TCP 706, TCP 80, TCP 443, UDP 7706 and
- TCP 7706. This is the so called hole punching mechanism.
-
- o Message ACKing support.
-
- o in /cmode and /cumode with +r, maybe the public key and private key
- could be just some "string", which would then match to "string.pub" and
- "string.prv".
-
- o If the SILC Events (see below) are implemented, perhaps client library
- should provide events so that application developer has a choice of
- developing the SILC app with callbacks or with events.
-
- o Ability to recover from rekey errors, at least try to.
-
-
Runtime library, lib/silcutil/
==============================
+ o Simple SILC Rand API for pseudo-random numbers. use SILC Crypto
+ Toolkit for really good random numbers.
+
+ o file removing, chmod, rmmod, etc. chdir, rmdir etc. to
+ lib/silcutil/silcfileutil.h.
+
o silc_malloc et. al. to respect --with-alignment.
o Fix universal time decoding (doesn't accept all formats) in silctime.c.
like silc_debug etc. They won't work on EPOC. Perhaps logging
and debugging is to be disabled on EPOC. The logging currently works
by it cannot be controlled, same with debugging.
-
-
-SFTP Library, lib/silcsftp/
-===========================
-
- o Read prefetch (read-ahead, reading ahead of time). Maybe if this can
- be done easily.
-
-
-SKR Library, lib/silcskr/
-=========================
-
- o Add fingerprint as search constraint.
-
- o Add OpenPGP support. Adding, removing, fetching PGP keys. (Keyring
- support?)
-
- o Add support for importing public keys from a directory and/or from a
- file. Add support for exporting the repository (different formats for
- different key types?).
-
- o Change the entire silc_skr_find API. Remove SilcSKRFind and just simply
- add the find constraints as variable argument list to silc_skr_find, eg:
-
- silc_skr_find(skr, schedule, callback, context,
- SILC_SKR_FIND_PUBLIC_KEY, public_key,
- SILC_SKR_FIND_COUNTRY, "FI",
- SILC_SKR_FIND_USAGE, SILC_SKR_USAGE_AUTH,
- SILC_SKR_FIND_END);
-
- NULL argument would be ignored and skipped.
-
- o Add OR logical rule in addition of the current default AND, eg:
-
- // Found key(s) MUST have this public key AND this country.
- silc_skr_find(skr, schedule, callback, context,
- SILC_SKR_FIND_RULE_AND,
- SILC_SKR_FIND_PUBLIC_KEY, public_key,
- SILC_SKR_FIND_COUNTRY, "FI",
- SILC_SKR_FIND_END);
-
- // Found key(s) MUST have this public key OR this key context
- silc_skr_find(skr, schedule, callback, context,
- SILC_SKR_FIND_RULE_OR,
- SILC_SKR_FIND_PUBLIC_KEY, public_key,
- SILC_SKR_FIND_CONTEXT, key_context,
- SILC_SKR_FIND_END);
-
- o SilcStack to SKR API.
-
-
-Crypto Library, lib/silccrypt/
-==============================
-
- o Add silc_crypto_init and silc_crypto_uninit. The _init should take
- SilcStack that will act as global memory pool for all of crypto
- library. It should not be necessary anymore to separately register
- default ciphers, HMACs, etc, the _init would do that. However, if
- user after _init calls silc_pkcs_register, for example, it would take
- preference over the default once, ie. user can always dictate the
- order of algorithms. (***DONE)
-
- o Add fingerprint to SilcSILCPublicKey and retrieval to silcpk.h, and
- possibly to silcpkcs.h.
-
- /* Return fingerprint of the `public_key'. Returns also the algorithm
- that has been used to make the fingerprint. */
- const unsigned char *
- silc_pkcs_get_fingerprint(SilcPublicKey public_key,
- const char **hash_algorithm,
- SilcUInt32 *fingerprint_len);
-
- o Change SILC PKCS API to asynchronous, so that accelerators can be used.
- All PKCS routines should now take callbacks as argument and they should
- be delivered to SilcPKCSObject and SilcPKCSAlgorithm too. (***DONE)
-
- o The asynchronous functions to perhaps to _async to preserve backwards
- compatibility with synchronous versions, and make easier to migrate
- from 1.1 to 1.2.
-
- o Change PKCS Algorithm API to take SilcPKCSAlgorithm as argument to
- encrypt, decrypt, sign and verify functions. We may need to for exmaple
- check the alg->hash, supported hash functions. Maybe deliver it also
- to all other functions in SilcPKCSAlgorithm to be consistent. (***DONE)
-
- o Add DSA support to SILC public key.
-
- o Add DSS support. (***DONE)
-
- o Implement the defined SilcDH API. The definition is in
- lib/silccrypt/silcdh.h. Make sure it is asynchronous so that it can
- be accelerated. Also take into account that it could use elliptic
- curves.
-
- o Add ECDSA support.
-
- o Add ECDH support.
-
- o AES CBC is missing proper alignment code (see silc_1_1_branch).
-
- o All cipher, hash, hmac etc. allocation routines should take their name
- in as const char * not const unsigned char *. (***DONE)
-
-
-SILC Accelerator Library
-========================
-
- o SILC Accelerator API. Provides generic way to use different kind of
- accelerators. Basically implements SILC PKCS API so that SilcPublicKey
- and SilcPrivateKey can be used but they call the accelerators.
- (***DONE)
-
- o Implement software accelerator. It is a thread pool system where the
- public key and private key operations are executed in threads.
- (***DONE)
-
- o Add init options to SilcAcceleratorObject as a SilcAcceleratorOption
- structure. Each accelerator defines the options that they support and
- can be retrieved from the SilcAccelerator with silc_acc_get_options.
- The format must also be machine parseable. The structure can be of the
- following format:
-
- typedef struct SilcAcceleratorOptionStruct {
- const char *option; /* Option name */
- const char *display_name; /* Option displayable name */
- SilcParamType type; /* Option data format */
- void *default_value; /* Option's default value */
- SilcUInt32 default_value_len; /* Default value length */
- } *SilcAcceleratorOption;
-
- For software accelerator it could be for example:
-
- { "min_threads", "Minimum threads", SILC_PARAM_UINT32, (void *)2, 4 },
- { "max_threads", "Maximum threads", SILC_PARAM_UINT32, (void *)4, 4 },
-
- o Diffie-Hellman acceleration
-
- (o Symmetric key cryptosystem acceleration? They are always sycnhronouos
- even with hardware acceleration so the crypto API shouldn't require
- changes.) maybe
-
-
-lib/silcmath
-============
-
- o Import TFM. We want TFM's speed but its memory requirements are
- just too much. By default it uses large pre-allocated tables which
- will eat memory when there are thousands of public keys in system.
- We probably want to change TFM's fp_int dynamic so that a specific
- size can be allocated for the int. We could have two new functions:
-
- SilcBool silc_mp_init_size(SilcMPInt *mp, SilcUInt32 bit_size);
- SilcBool silc_mp_sinit_size(SilcStack stack, SilcMPInt *mp,
- SilcUInt32 bit_size);
-
- Which by default allocates `bit_size' bits instead of some default
- value. silc_mp_init would allocate the default FP_SIZE with TFM
- and do normal init with TMA and GMP. _init_size with TMA and GMP
- would be same as _init.
-
- o Add AND, OR and XOR support to TFM or ask Tom to do it.
-
- o The SILC MP API function must start returning indication of success
- and failure of the operation.
-
- o Do SilcStack support for silc_mp_init, silc_mp_init_size and other
- any other MP function (including utility ones) that may allocate
- memory.
-
- o Prime generation progress using callback instead of printing to
- stdout.
-
- o All utility functions should be made non-allocating ones.
-
-
-SILC XML Library, lib/silcxml/
-==============================
-
- o SILC XML API (wrapper to expat). Look at the expat API and simplify
- it. The SILC XML API should have at most 8-10 API functions. It should
- be possible to create full XML parser with only one function. And, it
- should be possible to have a function that is able to parse an entire
- XML document. It should also have a parser function to be able to
- parse a stream of XML data (SilcStream). It MUST NOT have operations
- that require multiple function calls to be able to execute that one
- operation (like creating parser).
-
-
-lib/silcske/silcske.[ch]
-========================
-
- o Ratelimit to UDP/IP transport for incoming packets.
-
-
-lib/silcasn1
-============
-
- o Negative integer encoding is missing, add it.
-
- o SILC_ASN1_CHOICE should perhaps return an index what choice in the
- choice list was found. Currently it is left for caller to figure out
- which choice was found. (***DONE)
-
- o SILC_ASN1_NULL in decoding should return SilcBool whether or not
- the NULL was present. It's important when it's SILC_ASN1_OPTIONAL
- and we need to know whether it was present or not. (***DONE)
-
-
-lib/silcpgp
-===========
-
- o OpenPGP certificate support, allowing the use of PGP public keys.
-
-
-lib/silcssh
-===========
-
- o SSH2 public key/private key support, allowing the use of SSH2 keys.
- RFC 4716. (***DONE)
-
-
-lib/silcpkix
-============
-
- o PKIX implementation
-
-
-apps/silcd
-==========
-
- o Deprecate the old server. Write interface for the new lib/silcserver
- server library. The interface should work on Unix/Linux systems.
-
- o Consider deprecating also the old config file format and use XML
- istead. This should require SILC XML API implementation first.
-
- o The configuration must support dynamic router and server connections.
- The silcd must work without specifying any servers or routers to
- connect to.
-
- o The configuration must support specifying whether the server is
- SILC Server or SILC Router. This should not be deduced from the
- configuration as it was in < 1.2.
-
- o The configuration must support specifying the ciphers and hmacs and
- their order so that user can specify which algorithms take preference.
-
-
-lib/silcserver
-==============
-
- o Rewrite the entire server. Deprecate apps/silcd as the main server
- implementation and create lib/silcserver/. It is a platform
- independent server library. The apps/silcd will merely provide a
- a simple interface for the library.
-
- o Write the SILC Server library extensively using SILC FSM.
-
- o Server library must support multiple networks. This means that one
- server must be able to create multiple connections that each reach
- different SILC network. This means also that all cache's etc. must
- be either connection-specific or network-specific.
-
- o Library must support dynamic router and server connections. This means
- that connections are create only when they are needed, like when someone
- says JOIN foo@foo.bar.com or WHOIS foobar@silcnet.org.
-
- o Library must support server-to-server connections even though protocol
- prohibits that. The responder of the connection should automatically
- act as a router. The two servers create an own, isolated, SILC network.
- To be used specifically with dynamic connections.
-
- o Library must support multiple threads and must be entirely thread safe.
-
- o Library must have support for SERVICE command.
-
- o Both UDP and TCP support for incoming connecetions. Maintaining long
- term UDP sessions.
-
- o The server must be able to run behind NAT device. This means that
- Server ID must be based on public IP instead of private IP (See
- also NAT detection protocol in SILC protocol specification).
-
- o The following data must be in per-connection context: client id cache,
- server id cache, channel id cache, all statistics must be
- per-connection.
-
- o The following data must be in per-thread context: command context
- freelist/pool, pending commands, random number generator.
-
- o Do inccoming packet processing in an own FSM thread in the
- server-threads FSM. Same as in client library.
-
- o Binding to other ports than 706 too. To allow easier traversing
- through NATs and firewalls server should also bind to 80, 443 and 7706
- by default (at least try to bind). Connections must work normally
- even if they were established to some other port other than 706.
-
- Connection option that attemps to connect to remot server with various
- different mechanisms: UDP 706, TCP 706, TCP 80, TCP 443, UDP 7706 and
- TCP 7706. This is the so called hole punching mechanism.
-
- o Ability to recover from rekey errors, at least try to.
-
- o Reference count all Silc*Entry structures.
-
- Some issues that must be kept in mind from 1.0 and 1.1 silcd's:
-
- o The server and router software MUST work out of the box. After
- installation the server must not require any configuration to run the
- most basic working configuration. No defining IP addresses, etc.
- The server must work just by running it.
-
- o The SERVER_SIGNOFF notify handing is not optimal, because it'll
- cause sending of multiple SIGNOFF notify's instead of the one
- SERVER_SIGNOFF notify that the server received. This should be
- optimized so that the only SERVER_SIGNOFF is sent and not
- SIGNOFF of notify at all (using SIGNOFF takes the idea about
- SERVER_SIGNOFF away entirely).
-
- o Another SERVER_SIGNOFF opt/bugfix: Currently the signoff is
- sent to a client if it is on same channel as the client that
- signoffed. However, the entire SERVER_SIGNOFF list is sent to
- the client, ie. it may receive clients that was not on the
- same channel. This is actually against the specs. It must be
- done per channel. It shouldn't receive the whole list just
- because one client happened to be on same channel.
-
- o If client's public key is saved in the server (and doing public key
- authentication) then the hostname and the username information could
- be taken from the public key. Should be a configuration option!
-
- o Add a timeout to handling incoming JOIN commands. It should be
- enforced that JOIN command is executed only once in a second or two
- seconds. Now it is possible to accept n incoming JOIN commands
- and process them without any timeouts. THis must be employed because
- each JOIN command will create and distribute the new channel key
- to everybody on the channel.
-
- o Related to above. If multiple JOINs are received in sequence perhaps
- new key should be created only once, if the JOINs are handeled at the same
- time. Now we create multiple keys and never end up using them because
- many JOINs are processed at the same time in sequence. Only the last
- key ends up being used.
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-SUBDIRS = \
-#ifdef SILC_DIST_AUTODIST
- autodist \
-#endif SILC_DIST_AUTODIST
-#ifdef SILC_DIST_SERVER
- @SILCD_SUBDIR@ \
-#endif SILC_DIST_SERVER
-#ifdef SILC_DIST_CLIENT
- @IRSSI_SUBDIR@ \
-#endif SILC_DIST_CLIENT
-#ifdef SILC_DIST_INPLACE
-# silcstress \
-#endif SILC_DIST_INPLACE
-#ifdef SILC_DIST_ASN1UTILS
- asn1utils \
-#endif SILC_DIST_ASN1UTILS
-
-
+SUBDIRS =
AC_SUBST(LN_S)
AC_PATH_PROG(sedpath, sed)
-#ifdef SILC_DIST_COMPILER
+AC_PROG_CC
+AM_PROG_AS
+AC_C_INLINE
+AC_C_CONST
+
+AC_PROG_RANLIB
+#ifdef SILC_DIST_INPLACE
+AC_DISABLE_SHARED
+#endif SILC_DIST_INPLACE
+AC_PROG_LIBTOOL
+
+SILC_TOP_SRCDIR=`pwd`
+
+##
+## Library versioning.
+##
-# Put here any platform specific stuff
+# Do the releases and library versioning according to following rules:
#
-case "$target" in
- *-*-linux*)
- check_threads=true
- CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
- ;;
- *-*-freebsd*)
- check_threads=true
- ;;
- *-*-netbsd*)
- check_threads=true
- ;;
- *-*-*bsd*)
- check_threads=false
- ;;
- *)
- check_threads=true
- ;;
-esac
+# - If any code has changed in library, increment RUNTIME_REVISION
+# - If API were added, removed or changed, set RUNTIME_REVISION to 0
+# - If API were added, removed or changed, increment RUNTIME_CURRENT
+# - If APi were added, increment RUNTIME_AGE
+# - If API were removed, set RUNTIME_AGE to 0
+#
+
+# Base version for library.
+RUNTIME_BASE_VERSION=1.2
+
+# libsilc versions
+RUNTIME_CURRENT=1 # prev = 0
+RUNTIME_REVISION=0 # prev = 0
+RUNTIME_AGE=0 # prev = 0
+
+# Substitute the version numbers
+AC_SUBST(RUNTIME_BASE_VERSION)
+AC_SUBST(RUNTIME_CURRENT)
+AC_SUBST(RUNTIME_REVISION)
+AC_SUBST(RUNTIME_AGE)
+
+
+##
+## Installation
+##
+
+# Default installation destination
+AC_PREFIX_DEFAULT(/usr/local)
+if test "x$prefix" != xNONE; then
+ silc_prefix="$prefix"
+else
+ silc_prefix="$ac_default_prefix"
+ prefix="$silc_prefix"
+fi
+
+
+##
+## Detect CPU
+##
+
+# Disable all CPU feature optimizations
+AC_MSG_CHECKING(whether to enable CPU feature optimizations)
+AC_ARG_ENABLE(cpu-optimizations,
+ [ --disable-cpu-optimizations do not use any CPU feature optimizations],
+ [
+ AC_MSG_RESULT(no)
+ AC_DEFINE([SILC_NO_CPU_OPTIMIZATIONS], [], [SILC_NO_CPU_OPTIMIZATIONS])
+ want_cpu_optimizations=false
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ want_cpu_optimizations=true
+ ])
+AM_CONDITIONAL(SILC_NO_CPU_OPTIMIZATIONS,
+ test x$want_cpu_optimizations = xfalse)
-# Get CPU
SILC_SYSTEM_IS_SMP(AC_DEFINE([SILC_SMP], [], [SILC_SMP]), [],
AC_DEFINE([SILC_SMP], [], [SILC_SMP]))
cpu_i386=false
fi
# Check for specific CPU features
- SILC_CPU_FLAG(mmx, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
- SILC_CPU_FLAG(sse2, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
- SILC_CPU_FLAG(pni, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
- SILC_CPU_FLAG(ssse3, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
- SILC_CPU_FLAG(sse4, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+ SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
+ SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
+ SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
+ SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
+ SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
;;
# Intel IA-64, 64-bit CPU (not x86_64 compatible)
cpu_ia64=true
# Check for specific CPU features
- SILC_CPU_FLAG(mmx, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
- SILC_CPU_FLAG(sse2, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
- SILC_CPU_FLAG(pni, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
- SILC_CPU_FLAG(ssse3, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
- SILC_CPU_FLAG(sse4, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+ SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
+ SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
+ SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
+ SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
+ SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
;;
# AMD/Intel x86_64, 64-bit CPU
cpu_x86_64=true
# Check for specific CPU features
- SILC_CPU_FLAG(mmx, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
- SILC_CPU_FLAG(sse2, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
- SILC_CPU_FLAG(pni, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
- SILC_CPU_FLAG(ssse3, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
- SILC_CPU_FLAG(sse4, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
+ SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
+ SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
+ SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
+ SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
+ SILC_CPU_FLAG(sse4, true, AC_DEFINE([SILC_CPU_SSE4], [], [SILC_CPU_SSE4]), [])
;;
# PowerPC, 32-bit and 64-bit CPUs
AM_CONDITIONAL(SILC_POWERPC, test x$cpu_ppc = xtrue)
AM_CONDITIONAL(SILC_IA64, test x$cpu_ia64 = xtrue)
-# Control compiler optimizations
-CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'`
-
-AC_PROG_CC
-AC_C_INLINE
-AC_C_CONST
-
-# Set some compiler options based on CPU
-if test "x$CC" = "xicc"; then
- # ICC flags
- if test x$x_have_cpu_sse2 = xtrue; then
- SILC_ADD_CFLAGS(-axW)
- fi
- if test x$x_have_cpu_sse3 = xtrue; then
- SILC_ADD_CFLAGS(-axP)
- fi
- if test x$x_have_cpu_ssse3 = xtrue; then
- SILC_ADD_CFLAGS(-axT)
- fi
- if test x$x_have_cpu_sse4 = xtrue; then
- SILC_ADD_CFLAGS(-axS)
- fi
-else
- # Other compilers
- if test x$x_have_cpu_sse2 = xtrue; then
- SILC_ADD_CFLAGS(-msse2)
- fi
- if test x$x_have_cpu_pni = xtrue; then
- SILC_ADD_CFLAGS(-msse3)
- fi
- if test x$x_have_cpu_ssse3 = xtrue; then
- SILC_ADD_CFLAGS(-mssse3)
- fi
- if test x$x_have_cpu_sse4 = xtrue; then
- SILC_ADD_CFLAGS(-msse3)
+if test x$want_cpu_optimizations = xtrue; then
+ # Set some compiler options based on CPU
+ if test "x$CC" = "xicc"; then
+ # ICC flags
+ if test x$x_have_cpu_sse2 = xtrue; then
+ SILC_ADD_CFLAGS(-axW)
+ fi
+ if test x$x_have_cpu_sse3 = xtrue; then
+ SILC_ADD_CFLAGS(-axP)
+ fi
+ if test x$x_have_cpu_ssse3 = xtrue; then
+ SILC_ADD_CFLAGS(-axT)
+ fi
+ if test x$x_have_cpu_sse4 = xtrue; then
+ SILC_ADD_CFLAGS(-axS)
+ fi
+ else
+ # Other compilers
+ if test x$x_have_cpu_sse2 = xtrue; then
+ SILC_ADD_CFLAGS(-msse2)
+ fi
+ if test x$x_have_cpu_pni = xtrue; then
+ SILC_ADD_CFLAGS(-msse3)
+ fi
+ if test x$x_have_cpu_ssse3 = xtrue; then
+ SILC_ADD_CFLAGS(-mssse3)
+ fi
+ if test x$x_have_cpu_sse4 = xtrue; then
+ SILC_ADD_CFLAGS(-msse4)
+ fi
fi
fi
-__SILC_HAVE_PTHREAD=""
-__SILC_HAVE_SIM=""
-__SILC_ENABLE_DEBUG=""
-#ifdef SILC_DIST_TOOLKIT
-toolkitver=`echo $VERSION | sed 's/\./ /g'`
-maj=0
-min=0
-bld=0
-for v in $toolkitver
-do
- if test $maj -eq 0; then
- maj=$v
- continue
- fi
- if test $min -eq 0; then
- min=$v
- continue
- fi
- if test $bld -eq 0; then
- bld=$v
- continue
- fi
-done
-__SILC_PACKAGE_VERSION="#define __SILC_TOOLKIT_VERSION SILC_VERSION($maj,$min,$bld)"
-#endif SILC_DIST_TOOLKIT
+##
+## Put here any platform specific stuff
+##
-AC_PROG_RANLIB
-#ifndef SILC_DIST_TOOLKIT
-AC_DISABLE_SHARED
-#endif SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_INPLACE
-AC_DISABLE_SHARED
-#endif SILC_DIST_INPLACE
-AC_PROG_LIBTOOL
+case "$target" in
+ *-*-linux*)
+ check_threads=true
+ CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
+ ;;
+ *-*-freebsd*)
+ check_threads=true
+ ;;
+ *-*-netbsd*)
+ check_threads=true
+ ;;
+ *-*-*bsd*)
+ check_threads=false
+ ;;
+ *)
+ check_threads=true
+ ;;
+esac
-# Header checking
-#
+
+##
+## Header checking
+##
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_STAT
AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h dirent.h)
AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
-# Data type checking
-#
+
+##
+## Data type checking
+##
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_TYPE_UID_T
AC_TYPE_PID_T
-
AC_CHECK_SIZEOF(long long, 0)
AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
AC_CHECK_SIZEOF(long, 0)
AC_CHECK_TYPES(long long)
AC_CHECK_TYPES(long double)
-# Function and library checking
-#
-AC_CHECK_FUNC(gethostbyname, [],
+# Check for big-endian machines
+AC_C_BIGENDIAN
+
+
+##
+## Compiler and compiler flag checks
+##
+
+# Disable all compiler optimizations
+AC_MSG_CHECKING(whether to enable compiler optimizations)
+AC_ARG_ENABLE(optimizations,
+ [ --disable-optimizations do not use any compiler optimizations],
[
- AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
- AC_CHECK_FUNC(res_gethostbyname, [],
- AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
- )
- ])
-AC_CHECK_FUNC(socket, [],
- AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
-)
-AC_CHECK_FUNC(clock_gettime, [],
+ AC_MSG_RESULT(no)
+ AC_DEFINE([SILC_NO_CC_OPTIMIZATIONS], [], [SILC_NO_CC_OPTIMIZATIONS])
+ want_cc_optimizations=false
+ ],
[
- AC_CHECK_LIB(rt, clock_gettime,
- [ LIBS="$LIBS -lrt"
- AC_DEFINE([HAVE_CLOCK_GETTIME], [], [HAVE_CLOCK_GETTIME])])
+ AC_MSG_RESULT(yes)
+ want_cc_optimizations=true
])
+AM_CONDITIONAL(SILC_NO_CC_OPTIMIZATIONS, test x$want_cc_optimizations = xfalse)
+
+if test "$GCC"; then
+ # GCC specific options
+ if test "x$summary_debug" = "xyes"; then
+ SILC_ADD_CFLAGS(-g)
+ else
+ SILC_ADD_CFLAGS(-g)
+ fi
+ SILC_ADD_CFLAGS(-Wall -finline-functions)
+ SILC_ADD_CFLAGS(-Wno-pointer-sign)
+else
+ # Other compilers
+ case "$target" in
+ alpha*-dec-osf*)
+ SILC_ADD_CFLAGS(-g3)
+ ;;
+ mips*-sgi-irix*)
+ SILC_ADD_CFLAGS(-g3)
+ ;;
+ *)
+ SILC_ADD_CFLAGS(-g)
+ ;;
+ esac
+
+ # Intel C++ Compiler flags
+ if test "x$CC" = "xicc"; then
+ SILC_ADD_CFLAGS(-restrict)
+ SILC_ADD_CFLAGS(-finline-functions)
+
+ # Don't define __GNUC__ except for system includes
+ SILC_ADD_CFLAGS(-gcc-sys)
+ fi
+fi
+
+if test x$want_cc_optimizations = xtrue; then
+ if test "$GCC"; then
+ # GCC specific options
+ if test "x$summary_debug" = "xyes"; then
+ SILC_ADD_CFLAGS(-O)
+ else
+ SILC_ADD_CFLAGS(-O2)
+ fi
+ else
+ # Other compilers
+ case "$target" in
+ alpha*-dec-osf*)
+ SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
+ ;;
+ mips*-sgi-irix*)
+ SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
+ ;;
+ *)
+ SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
+ ;;
+ esac
+ fi
+fi
+
+
+##
+## Function and libary checking
+##
AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
AC_CHECK_FUNCS(poll select listen bind shutdown close connect setsockopt)
AC_CHECK_FUNCS(setrlimit time ctime utime gettimeofday getrusage)
AC_CHECK_FUNCS(strchr snprintf strstr strcpy strncpy memcpy memset memmove)
AC_CHECK_FUNCS(setenv getenv putenv unsetenv clearenv)
-# lib/contrib conditionals
-#
+# Check getopt_long
AC_CHECK_FUNC(getopt_long,
[
AC_DEFINE([HAVE_GETOPT_LONG], [], [HAVE_GETOPT_LONG])
], have_getopt_long=0
)
-##
-## Enable/disable checking
-##
+# Check gethostbyname
+AC_CHECK_FUNC(gethostbyname, [],
+ [
+ AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
+ AC_CHECK_FUNC(res_gethostbyname, [],
+ AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
+ )
+ ])
-# IPv6 support
-#
-AC_MSG_CHECKING(whether to enable IPv6 support)
-AC_ARG_ENABLE(ipv6,
- [ --enable-ipv6 enable IPv6 support],
+# Check socket
+AC_CHECK_FUNC(socket, [],
+ AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
+)
+
+# Check clock_gettime
+AC_CHECK_FUNC(clock_gettime, [],
[
- case "${enableval}" in
- yes)
- want_ipv6=true
- check_ipv6=false
- summary_ipv6="yes"
- AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
- AC_MSG_RESULT(yes)
- ;;
- *)
- want_ipv6=false
- check_ipv6=false
- summary_ipv6="no"
- AC_MSG_RESULT(no)
- ;;
- esac
- ],
- check_ipv6=true
- )
-
-if test x$check_ipv6 = xtrue; then
- summary_ipv6="no"
- AC_TRY_COMPILE(
- [
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #ifdef HAVE_NETINET_TCP_H
- #include <netinet/tcp.h>
- #endif
- #ifdef HAVE_NETDB_H
- #include <netdb.h>
- #endif
- #include <sys/socket.h>
- #ifdef HAVE_NETINET_IN_H
- #include <netinet/in.h>
- #endif
- ],
- [
- struct sockaddr_in6 sin6;
- int family = AF_INET6;
- ],
- [
- AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
- AC_MSG_RESULT(yes)
- summary_ipv6="yes"
- ],
- AC_MSG_RESULT(no)
- )
-fi
-
-# Debug checking
-#
-AC_MSG_CHECKING(whether to enable debugging)
-summary_debug="no"
-__SILC_ENABLE_DEBUG=""
-AC_ARG_ENABLE(debug,
- [ --enable-debug enable debugging],
- [
- case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE([SILC_DEBUG], [], [enable-debug])
- summary_debug="yes"
- __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac
- ],
- [
- AC_MSG_RESULT(no)
+ AC_CHECK_LIB(rt, clock_gettime,
+ [ LIBS="$LIBS -lrt"
+ AC_DEFINE([HAVE_CLOCK_GETTIME], [], [HAVE_CLOCK_GETTIME])])
])
-# Disable all compiler optimizations
-#
-AC_MSG_CHECKING(whether to enable compiler optimizations)
-want_cc_optimizations=true
-AC_ARG_ENABLE(optimizations,
- [ --disable-optimizations do not use any compiler optimizations],
+# Check for epoll_wait and verify that epoll_create works
+AC_CHECK_FUNC(epoll_wait,
[
- AC_MSG_RESULT(no)
- AC_DEFINE([SILC_NO_CC_OPTIMIZATIONS], [], [SILC_NO_CC_OPTIMIZATIONS])
- want_cc_optimizations=false
- ],
- [
- AC_MSG_RESULT(yes)
- want_cc_optimizations=true
+ AC_RUN_IFELSE(
+ [
+ #include <sys/epoll.h>
+ int main()
+ {
+ int ret = epoll_create(5);
+ if (ret < 0)
+ return 1;
+ close(ret);
+ return 0;
+ }
+ ],
+ [
+ AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT])
+ ],
+ )
])
-AM_CONDITIONAL(SILC_NO_CC_OPTIMIZATIONS, test x$want_cc_optimizations = xfalse)
-# Disable all assembler optimizations
-#
-AC_MSG_CHECKING(whether to enable assembler optimizations)
-want_asm=true
-AC_ARG_ENABLE(asm,
- [ --disable-asm do not use assembler optimizations],
- [
- AC_MSG_RESULT(no)
- AC_DEFINE([SILC_NO_ASM], [], [SILC_NO_ASM])
- want_asm=false
- ],
- [
- AC_MSG_RESULT(yes)
- want_asm=true
- ])
-AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
-
-# Check for assembler
-#
-SILC_ASSEMBLER=""
-have_assembler=false
-if test x$want_asm = xtrue; then
- AC_PATH_PROG([NASM], [nasm], [no])
- if test "x$NASM" != "xno"; then
- if test x$cpu_x86_64 = xtrue; then
- SILC_ASSEMBLER="$NASM -O2 -felf64"
- else
- SILC_ASSEMBLER="$NASM -O2 -felf"
- fi
- have_assembler=true
- fi
-
- AC_PATH_PROG([YASM], [yasm], [no])
- if test "x$YASM" != "xno"; then
- if test x$cpu_x86_64 = xtrue; then
- SILC_ASSEMBLER="$YASM -Xgnu -felf64"
- else
- SILC_ASSEMBLER="$YASM -Xgnu -felf"
- fi
- have_assembler=true
- fi
-fi
-AC_SUBST(SILC_ASSEMBLER)
-
-##
-## va_copy checks
-##
+# Check for va_copy
va_copy=false
AC_MSG_CHECKING(for va_copy)
AC_TRY_COMPILE(
)
fi
-##
-## Compiler and compiler flag checks
-##
+# Check for timezone and tm_gmtoff for timezone information
+AC_MSG_CHECKING(whether system has timezone)
+AC_RUN_IFELSE(
+ [
+ #include <stdio.h>
+ #include <time.h>
+ int main()
+ {
+ timezone = 0;
+ return 0;
+ }
+ ],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_TIMEZONE], [], [HAVE_TIMEZONE]) ],
+ [ AC_MSG_RESULT(no) ],
+ [ AC_MSG_RESULT(no) ]
+)
+AC_MSG_CHECKING(whether system has tm_gmtoff)
+AC_RUN_IFELSE(
+ [
+ #include <stdio.h>
+ #include <time.h>
+ int main()
+ {
+ struct tm tm;
+ tm.tm_gmtoff = 0;
+ return 0;
+ }
+ ],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_TM_GMTOFF], [], [HAVE_TM_GMTOFF]) ],
+ [ AC_MSG_RESULT(no) ],
+ [ AC_MSG_RESULT(no) ]
+)
+AC_MSG_CHECKING(whether system has __tm_gmtoff)
+AC_RUN_IFELSE(
+ [
+ #include <stdio.h>
+ #include <time.h>
+ int main()
+ {
+ struct tm tm;
+ tm.__tm_gmtoff = 0;
+ return 0;
+ }
+ ],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE___TM_GMTOFF], [], [HAVE___TM_GMTOFF]) ],
+ [ AC_MSG_RESULT(no) ],
+ [ AC_MSG_RESULT(no) ]
+)
+AC_MSG_CHECKING(whether system has __tm_gmtoff__)
+AC_RUN_IFELSE(
+ [
+ #include <stdio.h>
+ #include <time.h>
+ int main()
+ {
+ struct tm tm;
+ tm.__tm_gmtoff__ = 0;
+ return 0;
+ }
+ ],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE___TM_GMTOFF__], [], [HAVE___TM_GMTOFF__]) ],
+ [ AC_MSG_RESULT(no) ],
+ [ AC_MSG_RESULT(no) ]
+)
-if test "$GCC"; then
- # GCC specific options
- if test "x$summary_debug" = "xyes"; then
- SILC_ADD_CFLAGS(-g)
- else
- SILC_ADD_CFLAGS(-g)
- fi
- SILC_ADD_CFLAGS(-Wall -finline-functions)
- SILC_ADD_CFLAGS(-Wno-pointer-sign)
-else
- # Other compilers
- case "$target" in
- alpha*-dec-osf*)
- SILC_ADD_CFLAGS(-g3)
- ;;
- mips*-sgi-irix*)
- SILC_ADD_CFLAGS(-g3)
- ;;
- *)
- SILC_ADD_CFLAGS(-g)
- ;;
- esac
+# Check for dlopen() and friends
+AC_CHECK_HEADERS(dlfcn.h,
+ [
+ AC_CHECK_LIB(dl, dlopen,
+ [
+ AC_DEFINE([HAVE_DLOPEN], [], [HAVE_DLOPEN])
+ LIBS="$LIBS -ldl"
+ ],
+ [
+ AC_CHECK_LIB(c, dlopen,
+ [
+ AC_DEFINE([HAVE_DLOPEN], [], [HAVE_DLOPEN])
+ ])
+ ])
+ ])
- # Intel C++ Compiler flags
- if test "x$CC" = "xicc"; then
- SILC_ADD_CFLAGS(-restrict)
- SILC_ADD_CFLAGS(-finline-functions)
+__SILC_ENABLE_DEBUG=""
- # Don't define __GNUC__ except for system includes
- SILC_ADD_CFLAGS(-gcc-sys)
+runtimever=`echo $VERSION | sed 's/\./ /g'`
+maj=0
+min=0
+bld=0
+for v in $runtimever
+do
+ if test $maj -eq 0; then
+ maj=$v
+ continue
fi
-fi
+ if test $min -eq 0; then
+ min=$v
+ continue
+ fi
+ if test $bld -eq 0; then
+ bld=$v
+ continue
+ fi
+done
+__RUNTIME_PACKAGE_VERSION="#define __SILC_RUNTIME_VERSION SILC_VERSION($maj,$min,$bld)"
-if test x$want_cc_optimizations = xtrue; then
- if test "$GCC"; then
- # GCC specific options
- if test "x$summary_debug" = "xyes"; then
- SILC_ADD_CFLAGS(-O)
- else
- SILC_ADD_CFLAGS(-O2)
- fi
- else
- # Other compilers
- case "$target" in
- alpha*-dec-osf*)
- SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
- ;;
- mips*-sgi-irix*)
- SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
+
+##
+## Enable/disable checking
+##
+
+# IPv6 support
+AC_MSG_CHECKING(whether to enable IPv6 support)
+AC_ARG_ENABLE(ipv6,
+ [ --enable-ipv6 enable IPv6 support],
+ [
+ case "${enableval}" in
+ yes)
+ want_ipv6=true
+ check_ipv6=false
+ summary_ipv6="yes"
+ AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
+ AC_MSG_RESULT(yes)
;;
*)
- SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
+ want_ipv6=false
+ check_ipv6=false
+ summary_ipv6="no"
+ AC_MSG_RESULT(no)
;;
esac
- fi
-fi
+ ],
+ check_ipv6=true
+ )
-#
-# Workaround a bug in GCC 2.x which causes memory exhaustion
-# when compiling sha1 with optimizations on UltraSPARC.
-#
-FIX_SHA1='#'
-if test "$GCC" -a "$host_cpu" = "sparc64"; then
- AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
+if test x$check_ipv6 = xtrue; then
+ summary_ipv6="no"
AC_TRY_COMPILE(
[
- #if defined(__sparc64__) && (__GNUC__ == 2)
- #else
- choke me
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #ifdef HAVE_NETINET_TCP_H
+ #include <netinet/tcp.h>
+ #endif
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+ #include <sys/socket.h>
+ #ifdef HAVE_NETINET_IN_H
+ #include <netinet/in.h>
#endif
],
- [],
[
- FIX_SHA1=''
+ struct sockaddr_in6 sin6;
+ int family = AF_INET6;
+ ],
+ [
+ AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
AC_MSG_RESULT(yes)
+ summary_ipv6="yes"
],
AC_MSG_RESULT(no)
)
fi
-AC_SUBST(FIX_SHA1)
-#endif SILC_DIST_COMPILER
-
-##
-## Installation
-##
-
-# Default installation destination
-#
-AC_PREFIX_DEFAULT(/usr/local)
-if test "x$prefix" != xNONE; then
- silc_prefix="$prefix"
-else
- silc_prefix="$ac_default_prefix"
- prefix="$silc_prefix"
-fi
-#ifndef SILC_DIST_AUTODIST
-ETCDIR=`eval echo $sysconfdir`;ETCDIR=`eval echo $ETCDIR`
-AC_SUBST(ETCDIR)
-AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
-
-DOCDIR=`eval echo $docdir`;DOCDIR=`eval echo $DOCDIR`
-AC_SUBST(DOCDIR)
-AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
-#endif SILC_DIST_AUTODIST
-
-#ifdef SILC_DIST_COMPILER
-##
-## With/without checkings
-##
-
-#
-# SILC library checking
-compile_libs=true
-LIBSUBDIR=lib
-
-#ifndef SILC_DIST_TOOLKIT
-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"])
-
-if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
-
- # Manually provided libs
- if test "$ac_silc_includes" != "no"; then
- compile_libs=false
- SILC_LIB_INCLUDES="-I$ac_silc_includes"
- LIBSUBDIR=
- fi
- if test "$ac_silc_libs" != "no"; then
- compile_libs=false
- LIBSUBDIR=
- LDFLAGS="-L$ac_silc_libs $LDFLAGS"
- else
- LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
- fi
-
- # Check libs to link against
- f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silc.h`
- if test -n "$f"; then
- LIBS="$LIBS -lpthread"
- check_threads=false
- has_threads=true
- fi
- f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silc.h`
- if test -n "$f"; then
- LIBS="$LIBS -ldl"
- fi
-
-else
- # pkg-config check
- PKG_CHECK_MODULES(SILC, [silc >= 1.1], compile_libs=false, compile_libs=true)
-#ifdef SILC_DIST_CLIENTLIB
- PKG_CHECK_MODULES(SILCCLIENT, [silcclient >= 1.1.1], compile_libs=false, compile_libs=true)
-#endif SILC_DIST_CLIENTLIB
-#ifdef SILC_DIST_SERVERLIB
- PKG_CHECK_MODULES(SILCSERVER, silcserver, compile_libs=false, compile_libs=true)
-#endif SILC_DIST_SERVERLIB
-
- if test x$compile_libs = xfalse; then
- LIBSUBDIR=
- LIBS="$SILC_LIBS $LIBS"
- CFLAGS="$CFLAGS $SILC_CFLAGS"
-#ifdef SILC_DIST_CLIENTLIB
- LIBS="$SILCCLIENT_LIBS $LIBS"
- CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS"
-#endif SILC_DIST_CLIENTLIB
-#ifdef SILC_DIST_SERVERLIB
- LIBS="$LIBS $SILCSERVER_LIBS"
- CFLAGS="$CFLAGS $SILCSERVER_CFLAGS"
-#endif SILC_DIST_SERVERLIB
- else
- LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
- fi
-fi
-
-#else SILC_DIST_TOOLKIT
-LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
-#endif SILC_DIST_TOOLKIT
-
-#ifdef SILC_DIST_SIM
-# SIM support checking
-# XXX These needs to be changed as more supported platforms appear.
-# XXX This probably needs to be made platform dependant check.
-#
-sim_support=false
-AC_MSG_CHECKING(for SIM support)
-AC_MSG_RESULT()
-AC_CHECK_HEADERS(dlfcn.h,
+# Memory alignment. User can specify what alignment memory allocation and
+# SilcStack allocation use. Default is system default alignemnt.
+AC_ARG_WITH(alignment,
+ [ --with-alignment=NUMBER Memory alignment in bytes],
[
- AC_CHECK_LIB(dl, dlopen,
- [
- AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
- AC_DEFINE([HAVE_DLOPEN], [], [HAVE_DLOPEN])
- sim_support=true
- LIBS="$LIBS -ldl"
- ],
- [
- AC_CHECK_LIB(c, dlopen,
- [
- AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
- AC_DEFINE([HAVE_DLOPEN], [], [HAVE_DLOPEN])
- sim_support=true
- ])
- ])
- ])
+ AC_DEFINE_UNQUOTED([SILC_ALIGNMENT], [$withval], [SILC_ALIGNMENT])
+ AC_MSG_RESULT(Memory allocation alignment is $withval bytes)
+ ],
+ [
+ AC_DEFINE([SILC_ALIGNMENT], SILC_SIZEOF_VOID_P, [SILC_ALIGNMENT])
+ ])
-AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
-if test x$sim_support = xtrue; then
- AC_MSG_RESULT(Enabled SIM support.)
- __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
-else
- AC_MSG_RESULT(No SIM support found.)
-fi
-#endif SILC_DIST_SIM
+# 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], [], [SILC_STACKTRACE])
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac
+ ],
+ AC_MSG_RESULT(no)
+ )
-# SOCKS4 support checking
+#ifdef SILC_DIST_INPLACE
#
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-AC_MSG_CHECKING(whether to support SOCKS4)
-AC_ARG_WITH(socks4,
- [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
+# Profiling options (never delivered to distributions)
+#
+AC_MSG_CHECKING(whether to enable gprof)
+AC_ARG_ENABLE(gprof,
+ [ --enable-gprof enable gprof profiling],
[
- case "$withval" in
- no)
- AC_MSG_RESULT(no)
+ case "${enableval}" in
+ yes)
+ AC_MSG_RESULT(yes)
+ SILC_ADD_CFLAGS(-pg)
+ LIBS="$LIBS -pg"
;;
*)
- AC_MSG_RESULT(yes)
- socks=4
-
- if test -d "$withval/include"; then
- CFLAGS="$CFLAGS -I$withval/include"
- fi
- if test -d "$withval/lib"; then
- LDFLAGS="$LDFLAGS -L$withval/lib"
- fi
+ AC_MSG_RESULT(no)
+ ;;
+ esac
+ ],
+ [
+ AC_MSG_RESULT(no)
+ ])
- LIBS="-lsocks $LIBS"
+AC_MSG_CHECKING(whether to enable gcov)
+AC_ARG_ENABLE(gcov,
+ [ --enable-gcov enable gcov],
+ [
+ case "${enableval}" in
+ yes)
+ AC_MSG_RESULT(yes)
+ SILC_ADD_CFLAGS(-fprofile-arcs)
+ LIBS="$LIBS -lgcov"
+ ;;
+ *)
+ AC_MSG_RESULT(no)
;;
esac
-
- AC_TRY_LINK([],
- [
- Rconnect();
- ], [],
- [
- AC_MSG_ERROR(Could not find SOCKS4 library.)
- LIBS="$SAVE_LIBS"
- CFLAGS="$SAVE_CFLAGS"
- LDFLAGS="$SAVE_LDFLAGS"
- ])
],
+ [
AC_MSG_RESULT(no)
- )
+ ])
+#endif SILC_DIST_INPLACE
-# SOCKS5 support checking
-#
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-AC_MSG_CHECKING(whether to support SOCKS5)
-AC_ARG_WITH(socks5,
- [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
+# Debug checking
+AC_MSG_CHECKING(whether to enable debugging)
+summary_debug="no"
+__SILC_ENABLE_DEBUG=""
+AC_ARG_ENABLE(debug,
+ [ --enable-debug enable debugging],
[
- case "$withval" in
- no)
- AC_MSG_RESULT(no)
+ case "${enableval}" in
+ yes)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([SILC_DEBUG], [], [enable-debug])
+ summary_debug="yes"
+ __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
;;
*)
- AC_MSG_RESULT(yes)
- socks=5
-
- if test -d "$withval/include"; then
- CFLAGS="$CFLAGS -I$withval/include"
- fi
- if test -d "$withval/lib"; then
- LDFLAGS="$LDFLAGS -L$withval/lib"
- fi
-
- LIBS="-lsocks5 $LIBS"
+ AC_MSG_RESULT(no)
;;
esac
-
- AC_TRY_LINK([],
- [
- SOCKSconnect();
- ], [],
- [
- AC_MSG_ERROR(Could not find SOCKS5 library.)
- LIBS="$SAVE_LIBS"
- CFLAGS="$SAVE_CFLAGS"
- LDFLAGS="$SAVE_LDFLAGS"
- ])
],
+ [
AC_MSG_RESULT(no)
- )
+ ])
-if test "x$socks" = "x4"; then
- AC_DEFINE([SOCKS], [], [Socks])
- CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
-fi
+# Disable all assembler optimizations
+AC_MSG_CHECKING(whether to enable assembler optimizations)
+AC_ARG_ENABLE(asm,
+ [ --disable-asm do not use assembler optimizations],
+ [
+ AC_MSG_RESULT(no)
+ AC_DEFINE([SILC_NO_ASM], [], [SILC_NO_ASM])
+ want_asm=false
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ want_asm=true
+ ])
+AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
+
+# Check for assembler
+SILC_ASSEMBLER=""
+have_assembler=false
+if test x$want_asm = xtrue; then
+ AC_PATH_PROG([NASM], [nasm], [no])
+ if test "x$NASM" != "xno"; then
+ if test x$cpu_x86_64 = xtrue; then
+ SILC_ASSEMBLER="$NASM -O2 -felf64"
+ else
+ SILC_ASSEMBLER="$NASM -O2 -felf"
+ fi
+ have_assembler=true
+ fi
-if test "x$socks" = "x5"; then
- AC_DEFINE([SOCKS], [], [Socks])
- AC_DEFINE([SOCKS5], [], [Socks5])
- AC_DEFINE([Rconnect], [SOCKSconnect], [Socks])
- AC_DEFINE([Rgetsockname], [SOCKSgetsockname], [Socks])
- AC_DEFINE([Rgetpeername], [SOCKSgetpeername], [Socks])
- AC_DEFINE([Rbind], [SOCKSbind], [Socks])
- AC_DEFINE([Raccept], [SOCKSaccept], [Socks])
- AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
- AC_DEFINE([Rselect], [SOCKSselect], [Socks])
- AC_DEFINE([Rrecvfrom], [SOCKSrecvfrom], [Socks])
- AC_DEFINE([Rsendto], [SOCKSsendto], [Socks])
- AC_DEFINE([Rrecv], [SOCKSrecv], [Socks])
- AC_DEFINE([Rsend], [SOCKSsend], [Socks])
- AC_DEFINE([Rread], [SOCKSread], [Socks])
- AC_DEFINE([Rwrite], [SOCKSwrite], [Socks])
- AC_DEFINE([Rrresvport], [SOCKSrresvport], [Socks])
- AC_DEFINE([Rshutdown], [SOCKSshutdown], [Socks])
- AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
- AC_DEFINE([Rclose], [SOCKSclose], [Socks])
- AC_DEFINE([Rdup], [SOCKSdup], [Socks])
- AC_DEFINE([Rdup2], [SOCKSdup2], [Socks])
- AC_DEFINE([Rfclose], [SOCKSfclose], [Socks])
- AC_DEFINE([Rgethostbyname], [SOCKSgethostbyname], [Socks])
+ AC_PATH_PROG([YASM], [yasm], [no])
+ if test "x$YASM" != "xno"; then
+ if test x$cpu_x86_64 = xtrue; then
+ SILC_ASSEMBLER="$YASM -Xgnu -felf64"
+ else
+ SILC_ASSEMBLER="$YASM -Xgnu -felf"
+ fi
+ have_assembler=true
+ fi
fi
+AC_SUBST(SILC_ASSEMBLER)
-#ifdef SILC_DIST_MATH
-# MP library checking. First check whether user wants to use GMP and use
-# it if found. If not or not defined then compile the default library in the
-# source tree.
-#
-mp_gmp=false
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-AC_MSG_CHECKING(whether to search for GMP)
-AC_ARG_WITH(gmp,
- [[ --with-gmp[=DIR] use GMP instead of SILC Math [search in DIR/lib and DIR/include]]],
- [
- case "$withval" in
- no)
- AC_MSG_RESULT(no)
- ;;
- *)
- AC_MSG_RESULT(yes)
- if test -d "$withval/include"; then
- CFLAGS="$CFLAGS -I$withval/include"
- fi
- if test -d "$withval/lib"; then
- LDFLAGS="$LDFLAGS -L$withval/lib"
- fi
+##
+## With/without checkings
+##
- LIBS="-lgmp $LIBS"
- ;;
- esac
+LIBSUBDIR=lib
+LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
- AC_CHECK_LIB(gmp, __gmpz_init,
- [
- mp_gmp=true
- AC_DEFINE([SILC_MP_GMP], [], [GMP])
- AC_MSG_RESULT(Using GMP as a MP library.)
- ],
- [
- LIBS="$SAVE_LIBS"
- CFLAGS="$SAVE_CFLAGS"
- LDFLAGS="$SAVE_LDFLAGS"
- ])
- ],
- AC_MSG_RESULT(no)
- )
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib"
+SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
-AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
-AM_CONDITIONAL(SILC_MP_SILCMATH, test x$mp_gmp = xfalse)
-if test x$mp_gmp = xfalse; then
- AC_DEFINE([SILC_MP_SILCMATH], [], [SILCMATH])
- AC_MSG_RESULT(Using SILC Math as a MP library.)
-fi
-#endif SILC_DIST_MATH
-# iconv support
-#
+# Check for iconv support
check_iconv=true
has_iconv=false
SAVE_LIBS="$LIBS"
fi
fi
-# POSIX threads support
-#
+# Check for POSIX threads support
AC_MSG_CHECKING(whether to search for POSIX threads)
AC_ARG_WITH(pthreads,
[[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
__SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"
fi
-#
-# Check for timezone and tm_gmtoff for timezone information
-#
-AC_MSG_CHECKING(whether system has timezone)
-AC_RUN_IFELSE(
- [
- #include <stdio.h>
- #include <time.h>
- int main()
- {
- timezone = 0;
- return 0;
- }
- ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_TIMEZONE], [], [HAVE_TIMEZONE]) ],
- [ AC_MSG_RESULT(no) ],
- [ AC_MSG_RESULT(no) ]
-)
-AC_MSG_CHECKING(whether system has tm_gmtoff)
-AC_RUN_IFELSE(
- [
- #include <stdio.h>
- #include <time.h>
- int main()
- {
- struct tm tm;
- tm.tm_gmtoff = 0;
- return 0;
- }
- ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_TM_GMTOFF], [], [HAVE_TM_GMTOFF]) ],
- [ AC_MSG_RESULT(no) ],
- [ AC_MSG_RESULT(no) ]
-)
-AC_MSG_CHECKING(whether system has __tm_gmtoff)
-AC_RUN_IFELSE(
- [
- #include <stdio.h>
- #include <time.h>
- int main()
- {
- struct tm tm;
- tm.__tm_gmtoff = 0;
- return 0;
- }
- ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE___TM_GMTOFF], [], [HAVE___TM_GMTOFF]) ],
- [ AC_MSG_RESULT(no) ],
- [ AC_MSG_RESULT(no) ]
-)
-AC_MSG_CHECKING(whether system has __tm_gmtoff__)
-AC_RUN_IFELSE(
- [
- #include <stdio.h>
- #include <time.h>
- int main()
- {
- struct tm tm;
- tm.__tm_gmtoff__ = 0;
- return 0;
- }
- ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE___TM_GMTOFF__], [], [HAVE___TM_GMTOFF__]) ],
- [ AC_MSG_RESULT(no) ],
- [ AC_MSG_RESULT(no) ]
-)
-
-# Native WIN32 compilation under cygwin
-#
-AC_MSG_CHECKING(whether to compile native WIN32 code)
-AC_ARG_WITH(win32,
- [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
- [
- AC_MSG_RESULT(yes)
- AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
- win32_support=true
- CFLAGS="-mno-cygwin $CFLAGS"
- LIBS="$LIBS -lwsock32"
- ],
- [
- AC_MSG_RESULT(no)
- ])
-AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
-
-# Native Symbian OS support (disabled by default)
-#
-AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
-
-# Native BeOS support (disabled by default)
-#
-AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
-
-# Native OS2 support (disabled by default)
-#
-AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
-
-#ifdef SILC_DIST_SERVER
-without_silcd=false
-#endif SILC_DIST_SERVER
-#ifdef SILC_DIST_CLIENT
-AM_CONDITIONAL(with_irssi, true)
-#endif SILC_DIST_CLIENT
-#ifdef SILC_DIST_INPLACE
-without_irssi=false
-without_silcd=false
-#endif SILC_DIST_INPLACE
-
-libtoolfix=true
-AC_MSG_CHECKING(whether to do libtoolfix)
-AC_ARG_WITH(libtoolfix,
- [ --without-libtoolfix Do not fix libtool, for package builders],
- [
- AC_MSG_RESULT(no)
- libtoolfix=false
- ],
- [
- AC_MSG_RESULT(yes)
- ])
-
-AC_SUBST(ETCDIR)
-AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
-#endif SILC_DIST_COMPILER
##
-## Misc
+## Outputs and substitutions
##
-# Make enable-shared aware
-AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
-
-SILC_TOP_SRCDIR=`pwd`
-
-# Included configure scripts
-AD_INCLUDE_CONFIGURE
-
-#ifdef SILC_DIST_COMPILER
-#
-# Substitutions
-#
AC_SUBST(LIBSUBDIR)
AC_SUBST(SILC_TOP_SRCDIR)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(SILC_LIB_INCLUDES)
-AC_SUBST(__SILC_HAVE_PTHREAD)
-AC_SUBST(__SILC_HAVE_SIM)
AC_SUBST(__SILC_ENABLE_DEBUG)
-AC_SUBST(__SILC_PACKAGE_VERSION)
+AC_SUBST(__SILC_HAVE_PTHREAD)
+AC_SUBST(__RUNTIME_PACKAGE_VERSION)
-#
-# Fix the libtool to support run-time configuration. This allows us
-# to in run-time specify when to compile shared/static libraries without
-# need to reconfigure the entire libtool.
-#
-if test x$libtoolfix = xtrue; then
- ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
-fi
-AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
+# Native Windows support (disabled by default)
+AM_CONDITIONAL(SILC_WIN32, test xfalse = xtrue)
+
+# Native Symbian OS support (disabled by default)
+AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
+
+# Make enable-shared aware
+AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
+
+ETCDIR=`eval echo $sysconfdir`;ETCDIR=`eval echo $ETCDIR`
+AC_SUBST(ETCDIR)
+AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
+
+DOCDIR=`eval echo $docdir`;DOCDIR=`eval echo $DOCDIR`
+AC_SUBST(DOCDIR)
+AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
AC_SUBST(INCLUDE_DEFINES_INT)
-#endif SILC_DIST_COMPILER
#
# Makefile outputs
#
AC_CONFIG_FILES(
Makefile
-#ifdef SILC_DIST_DOC
doc/Makefile
-#endif SILC_DIST_DOC
-#ifdef SILC_DIST_COMPILER
Makefile.defines
Makefile.defines_int
includes/Makefile
includes/silcversion.h
includes/silc.h
-#endif SILC_DIST_COMPILER
-#ifdef SILC_DIST_APPS
apps/Makefile
-#endif SILC_DIST_APPS
+win32/Makefile
)
-#ifdef SILC_DIST_TOOLKIT
AC_CONFIG_FILES(
-win32/Makefile
-win32/libsilc/Makefile
-win32/libsilcclient/Makefile
-tutorial/Makefile
-tutorial/Makefile.defines
-tutorial/Makefile.defines_int
+lib/Makefile
+lib/contrib/Makefile
+lib/silcutil/silcruntime.h
+lib/silcutil/Makefile
+lib/silcutil/tests/Makefile
+lib/silcutil/unix/Makefile
+lib/silcutil/win32/Makefile
+lib/silcutil/symbian/Makefile
+lib/srt.pc
)
-#endif SILC_DIST_TOOLKIT
AC_OUTPUT
-#ifdef SILC_DIST_COMPILER
+
+##
+## Summary output
+##
+
s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
echo ""
-echo "$PACKAGE Configuration Summary:"
-echo "---------------------------"
+echo "SILC Runtime Toolkit configuration summary:"
+echo "------------------------------------------"
echo " Target host ...................: $target"
echo " Compiler ......................: $CC"
echo " CFLAGS ........................: $CFLAGS"
echo " etc directory .................: $ETCDIR"
echo " man directory .................: $s_mandir"
echo " doc directory .................: $DOCDIR"
-#ifdef SILC_DIST_SIM
-echo " SIM directory .................: $MODULESDIR"
-#endif SILC_DIST_SIM
-#ifdef SILC_DIST_INCLUDES
echo " include directory .............: $s_includedir"
-#endif SILC_DIST_INCLUDES
echo ""
-
-#ifdef SILC_DIST_CLIENT
-if test x$without_irssi = xtrue; then
- irssi="no"
-fi
-echo " Compile SILC Client ...........: $irssi"
-#endif SILC_DIST_CLIENT
-
-#ifdef SILC_DIST_SERVER
-if test x$without_silcd = xtrue; then
- silcd="no"
-fi
-echo " Compile SILC Server ...........: $silcd"
-#endif SILC_DIST_SERVER
-
-#ifdef SILC_DIST_SIM
-if test x$sim_support = xfalse; then
- sim_support="no"
-else
- sim_support="yes"
-fi
-echo " SIM support ...................: $sim_support"
-#endif SILC_DIST_SIM
-
echo " IPv6 support ..................: $summary_ipv6"
if test x$has_iconv = xfalse; then
fi
echo " Assembler optimizations .......: $summary_asm"
-#ifdef SILC_DIST_MATH
-if test x$mp_gmp = xtrue; then
- echo " Arithmetic library ............: GMP"
+if test x$want_cc_optimizations = xfalse; then
+ summary_cc_opt="no"
+else
+ summary_cc_opt="yes"
+fi
+echo " Compiler optimizations ........: $summary_cc_opt"
+
+if test x$want_cpu_optimizations = xfalse; then
+ summary_cpu_opt="no"
+else
+ summary_cpu_opt="yes"
fi
-#endif SILC_DIST_MATH
+echo " CPU feature optimizations .....: $summary_cpu_opt"
threads="no"
if test x$has_threads = xtrue; then
echo " Debugging enabled .............: $summary_debug"
echo ""
echo "Compile the sources with 'make' or 'gmake' command."
-#endif SILC_DIST_COMPILER
--- /dev/null
+# Autodist configuration file
+
+# By default distdef prefix is '_DIST_'. To add your own prefix set the
+# prefix here. NOTE: Remember to change all 'define' directives in
+# distributions to use the new prefix if you change it. Example:
+#
+# DISTPREFIX="SILC"
+#
+# Will set the distdef prefix as 'SILC_DIST_'.
+#
+DISTPREFIX="SILC"
+
+# The distdef header will be created by the Autodist. It need to be included
+# in the source code in order for the preprocessor to respect distdef
+# conditionals in source code. Example:
+#
+# DISTDEFS="include/distdefs.h"
+#
+DISTDEFS="includes/silcdistdefs.h"
+
+# Location of the aclocal tool. If this is omitted the Autodist will not
+# run aclocal. User need to run it manually then.
+#
+ACLOCAL="aclocal -I ."
+
+# Location of the autoheader tool. If this is omitted the Autodist will not
+# run autoheader. User need to run it manually then.
+#
+AUTOHEADER="autoheader"
+
+# Location of the autoconf tool. If this is omitted the Autodist will not
+# run autoconf. User need to run it manually then.
+#
+AUTOCONF="autoconf"
+
+# Location of the automake tool. If this is omitted the Autodist will not
+# run automake. User need to run it manually then.
+#
+AUTOMAKE="automake"
+
+# Location of the libtoolize tool. This option should be omitted if your
+# source tree does not use libtool.
+#
+LIBTOOLIZE="libtoolize --automake --copy"
+
+# Location of the make program. This must be specified in order to be
+# able to create distributions.
+#
+MAKE="gmake"
+++ /dev/null
-name Client
-package silc-client
-bug-report silc-devel@lists.silcnet.org
-prereq 1.3.2
-
-inherit common
-define SILC_DIST_CLIENT
-define SILC_DIST_CLIENTLIB
-
-pre-hook distdir/pre-run
-pre-dist-hook distdir/pre-dist-client
-post-process-dist-hook distdir/post-process-dist
-post-dist-hook distdir/post-dist
option no-dist
# Default distribution for preparing raw CVS sources.
-inherit common
-inherit client
-inherit server
-inherit toolkit
+inherit runtime
define SILC_DIST_INPLACE
-
-# SFTP and VCARD is undefined in server, so force it here
-define SILC_DIST_SFTP
-define SILC_DIST_VCARD
-
-# Apps
-define SILC_DIST_ASN1UTILS
-
-pre-hook distdir/pre-run
distdir=$4
if test -f $distdir.tar.gz; then
- md5sum $distdir.tar.gz > $distdir.tar.gz.md5
+ sha1sum $distdir.tar.gz > $distdir.tar.gz.sha1
fi
if test -f $distdir.tar.bz2; then
- md5sum $distdir.tar.bz2 > $distdir.tar.bz2.md5
+ sha1sum $distdir.tar.bz2 > $distdir.tar.bz2.sha1
fi
-
--- /dev/null
+name Runtime Toolkit
+package srt
+bug-report silc-devel@lists.silcnet.org
+prereq 1.3.2
+
+# License
+license distdir/RUNTIME
+include distdir/GPL GPL
+include distdir/BSD BSD
+license-header distdir/GPL-header distdir/RUNTIME-header
+
+# Distdefs
+define SILC_DIST_RUNTIME
+
+# Includes
+include README.WIN32
+include README.MACOSX
+include README.SYMBIAN
+
+# Noprocess to optimize packaging and avoid re-licensing of certain files
+noprocess COPYING GPL BSD
+noprocess doc/runtime/
+noprocess apps/
+noprocess win32/
+noprocess symbian/
+
+post-process-dist-hook distdir/post-process-dist
+pre-dist-hook distdir/pre-dist-runtime
+post-dist-hook distdir/post-dist
+++ /dev/null
-name Server
-package silc-server
-bug-report silc-devel@lists.silcnet.org
-
-inherit common
-define SILC_DIST_SERVER
-#define SILC_DIST_SERVERLIB
-define SILC_DIST_HTTP
-undef SILC_DIST_SFTP
-undef SILC_DIST_VCARD
-
-post-process-dist-hook distdir/post-process-dist
-post-dist-hook distdir/post-dist
extern "C" {
#endif
-#define SILC_UNIX
-
-#ifdef WIN32
-#ifndef SILC_WIN32
-#define SILC_WIN32
-#undef SILC_UNIX
-#endif
-#endif
-
-#if defined(__EPOC32__) || defined(__SYMBIAN32__)
-#ifndef SILC_SYMBIAN
-#define SILC_SYMBIAN
-#undef SILC_UNIX
-#undef SILC_WIN32
-#endif
-#endif
-
-#if defined(__MACH__) && defined(__APPLE__)
-#ifndef SILC_MACOSX
-#define SILC_MACOSX
-#undef SILC_WIN32
-#undef SILC_SYMBIAN
-#endif
-#endif
-
-/* Types */
-#define SILC_SIZEOF_LONG_LONG @SILC_SIZEOF_LONG_LONG@
-#define SILC_SIZEOF_LONG @SILC_SIZEOF_LONG@
-#define SILC_SIZEOF_INT @SILC_SIZEOF_INT@
-#define SILC_SIZEOF_SHORT @SILC_SIZEOF_SHORT@
-#define SILC_SIZEOF_CHAR @SILC_SIZEOF_CHAR@
-#define SILC_SIZEOF_VOID_P @SILC_SIZEOF_VOID_P@
-
/* Compilation time defines, for third-party software */
-@__SILC_HAVE_PTHREAD@
@__SILC_HAVE_SIM@
@__SILC_ENABLE_DEBUG@
--- /dev/null
+/*
+
+ silccompile.h
+
+ Author: Pekka Riikonen <priikone@silcnet.org>
+
+ Copyright (C) 2008 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.
+
+*/
+
+#ifndef SILCCOMPILE_H
+#define SILCCOMPILE_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <dirent.h>
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+#ifdef HAVE_ASSERT_H
+#include <assert.h>
+#endif
+
+#if !defined(SILC_WIN32)
+
+#include <unistd.h>
+#include <sys/time.h>
+#include <pwd.h>
+#include <sys/times.h>
+
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#ifdef SOCKS5
+#include "socks.h"
+#endif
+
+#include <sys/socket.h>
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_XTI_H
+#include <xti.h>
+#else
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#endif
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifdef SILC_HAVE_PTHREAD
+#include <pthread.h>
+#endif
+
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
+
+#ifdef HAVE_ICONV_H
+#include <iconv.h>
+#endif
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#endif /* !SILC_WIN32 */
+
+#endif /* SILCCOMPILE_H */
Makefile
-Makefile.in
-Makefile.am
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2000 - 2007 Pekka Riikonen
+# Copyright (C) 2000 - 2008 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
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-# SILC Library dirs
-SILCLIB_DIRS = \
- contrib \
- silccore \
- silcutil \
- silcapputil \
-#ifdef SILC_DIST_CRYPTO
- silccrypt \
-#endif SILC_DIST_CRYPTO
-#ifdef SILC_DIST_SKR
- silcskr \
-#endif SILC_DIST_SKR
-#ifdef SILC_DIST_MATH
- silcmath \
-#endif SILC_DIST_MATH
-#ifdef SILC_DIST_SIM
- silcsim \
-#endif SILC_DIST_SIM
-#ifdef SILC_DIST_ASN1
- silcasn1 \
-#endif SILC_DIST_ASN1
- silcske \
-#ifdef SILC_DIST_HTTP
- silchttp \
-#endif SILC_DIST_HTTP
-#ifdef SILC_DIST_SFTP
- silcsftp \
-#endif SILC_DIST_SFTP
-#ifdef SILC_DIST_VCARD
- silcvcard \
-#endif SILC_DIST_VCARD
-#ifdef SILC_DIST_ACC
- silcacc \
-#endif SILC_DIST_ACC
-#ifdef SILC_DIST_SSH
- silcssh \
-#endif SILC_DIST_SSH
+SUBDIRS=
-if SILC_ENABLE_SHARED
-if SILC_WIN32
-LIBTOOL_OPTS= -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir) -export-dynamic -no-undefined
-else
-LIBTOOL_OPTS= -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
-endif
-LIBTOOL_SILC_VERSION = -version-info $(LIBSILC_CURRENT):$(LIBSILC_REVISION):$(LIBSILC_AGE)
-LIBTOOL_SILCCLIENT_VERSION = -version-info $(LIBSILCCLIENT_CURRENT):$(LIBSILCCLIENT_REVISION):$(LIBSILCCLIENT_AGE)
-LIBTOOL_SILCSERVER_VERSION = -version-info $(LIBSILCSERVER_CURRENT):$(LIBSILCSERVER_REVISION):$(LIBSILCSERVER_AGE)
-else
-LIBTOOL_OPTS=
-LIBTOOL_SILC_VERSION =
-LIBTOOL_SILCCLIENT_VERSION =
-LIBTOOL_SILCSERVER_VERSION =
-endif
-
-if SILC_WIN32
-SILC_LINK_LIBS=$(LIBS)
-SILCCLIENT_LINK_LIBS=$(LIBS) -lsilc
-SILCSERVER_LIBS=$(LIBS) -lsilc
-else
-SILC_LINK_LIBS=
-SILCCLIENT_LINK_LIBS=
-SILCSERVER_LIBS=
-endif
-
-SILCLIB = libsilc.a
-
-#ifdef SILC_DIST_CLIENTLIB
-# SILC Client Library dirs
-SILCCLIENTLIB_DIRS = silcclient
-SILCCLIENTLIB = libsilcclient.a
-#endif SILC_DIST_CLIENTLIB
-
-#ifdef SILC_DIST_SERVERLIB
-# SILC Server Library dirs
-SILCSERVERLIB_DIRS = silcserver
-SILCSERVERLIB = libsilcserver.a
-#endif SILC_DIST_SERVERLIB
-
-SUBDIRS = $(SILCLIB_DIRS) $(SILCSERVERLIB_DIRS) $(SILCCLIENTLIB_DIRS)
-
-CLEANFILES = libsilc.a $(SILCCLIENTLIB) $(SILCSERVERLIB)
-DISTCLEANFILES = libsilc.a $(SILCCLIENTLIB) $(SILCSERVERLIB)
-
-remove:
- -rm -f $(CLEANFILES)
-
-all:
- $(MAKE) remove $(SILCLIB) $(SILCSERVERLIB) $(SILCCLIENTLIB)
-
-#ifdef SILC_DIST_TOOLKIT
-install-exec-hook:
- -mkdir -p $(DESTDIR)$(libdir)
- -$(LIBTOOL) $(INSTALL) libsilc.la $(DESTDIR)$(libdir)/
-#ifdef SILC_DIST_CLIENTLIB
- -$(LIBTOOL) $(INSTALL) libsilcclient.la $(DESTDIR)$(libdir)/
-#endif SILC_DIST_CLIENTLIB
-#ifdef SILC_DIST_SERVERLIB
- -$(LIBTOOL) $(INSTALL) libsilcserver.la $(DESTDIR)$(libdir)/
-#endif SILC_DIST_SERVERLIB
-#else !SILC_DIST_TOOLKIT
-
-#ifdef SILC_DIST_SERVERLIB
-install-exec-hook:
-if SILC_ENABLE_SHARED
- -mkdir -p $(libdir)
- -$(LIBTOOL) $(INSTALL) libsilc.la $(DESTDIR)$(libdir)/
- -$(LIBTOOL) $(INSTALL) libsilcserver.la $(DESTDIR)$(libdir)/
- -rm -rf $(DESTDIR)$(libdir)/libsilc.a
- -rm -rf $(DESTDIR)$(libdir)/libsilcserver.a
-endif
-#endif SILC_DIST_SERVERLIB
-
-#ifdef SILC_DIST_CLIENTLIB
-install-exec-hook:
-if SILC_ENABLE_SHARED
- -mkdir -p $(libdir)
- -$(LIBTOOL) $(INSTALL) libsilc.la $(DESTDIR)$(libdir)/
- -$(LIBTOOL) $(INSTALL) libsilcclient.la $(DESTDIR)$(libdir)/
- -rm -rf $(DESTDIR)$(libdir)/libsilc.a
- -rm -rf $(DESTDIR)$(libdir)/libsilcclient.a
-endif
-#endif SILC_DIST_CLIENTLIB
-#endif SILC_DIST_TOOLKIT
-
-LIB_BASE_VERSION=@LIB_BASE_VERSION@
-LIBSILC_CURRENT=@LIBSILC_CURRENT@
-LIBSILC_REVISION=@LIBSILC_REVISION@
-LIBSILC_AGE=@LIBSILC_AGE@
-
-libsilc.a:
- find $(SILCLIB_DIRS) -type f -name *.lo | xargs \
- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(SILC_LINK_LIBS) \
- $(LIBTOOL_SILC_VERSION) \
- $(LIBTOOL_OPTS) -o libsilc.la
-
-#ifdef SILC_DIST_CLIENTLIB
-LIBSILCCLIENT_CURRENT=@LIBSILCCLIENT_CURRENT@
-LIBSILCCLIENT_REVISION=@LIBSILCCLIENT_REVISION@
-LIBSILCCLIENT_AGE=@LIBSILCCLIENT_AGE@
-
-libsilcclient.a:
- find $(SILCCLIENTLIB_DIRS) -type f -name *.lo | xargs \
- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
- $(SILCCLIENT_LINK_LIBS) $(LIBTOOL_SILCCLIENT_VERSION) \
- $(LIBTOOL_OPTS) -o libsilcclient.la
-#endif SILC_DIST_CLIENTLIB
-
-#ifdef SILC_DIST_SERVERLIB
-LIBSILCSERVER_CURRENT=@LIBSILCSERVER_CURRENT@
-LIBSILCSERVER_REVISION=@LIBSILCSERVER_REVISION@
-LIBSILCSERVER_AGE=@LIBSILCSERVER_AGE@
-
-libsilcserver.a:
- find $(SILCSERVERLIB_DIRS) -type f -name *.lo | xargs \
- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(SILCSERVER_LIBS) \
- $(LIBTOOL_SILCSERVER_VERSION) \
- $(LIBTOOL_OPTS) -o libsilcserver.la
-#endif SILC_DIST_SERVERLIB
-
-#ifdef SILC_DIST_TOOLKIT
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = silc.pc \
-#ifdef SILC_DIST_CLIENTLIB
- silcclient.pc \
-#endif SILC_DIST_CLIENTLIB
-#ifdef SILC_DIST_SERVERLIB
- silcserver.pc
-#endif SILC_DIST_SERVERLIB
-
-EXTRA_DIST = silc.pc.in \
-#ifdef SILC_DIST_CLIENTLIB
- silcclient.pc.in \
-#endif SILC_DIST_CLIENTLIB
-#ifdef SILC_DIST_SERVERLIB
- silcserver.pc.in
-#endif SILC_DIST_SERVERLIB
-
-toolkit-install:
- -mkdir -p $(docdir)/toolkit/
- -$(INSTALL_DATA) $(top_srcdir)/doc/toolkit/* $(docdir)/toolkit
- -$(INSTALL_DATA) $(top_srcdir)/lib/doc/*.gif $(docdir)/toolkit
- -cp -R $(top_srcdir)/tutorial $(docdir)
-#endif SILC_DIST_TOOLKIT
-
-install-data-hook: \
-#ifdef SILC_DIST_TOOLKIT
- toolkit-install
-#endif SILC_DIST_TOOLKIT
+include Makefile.runtime
include $(top_srcdir)/Makefile.defines.in
--- /dev/null
+#
+# Makefile.runtime.am
+#
+# Author: Pekka Riikonen <priikone@silcnet.org>
+#
+# Copyright (C) 2008 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.
+#
+
+RUNTIME_BASE_VERSION=@RUNTIME_BASE_VERSION@
+RUNTIME_CURRENT=@RUNTIME_CURRENT@
+RUNTIME_REVISION=@RUNTIME_REVISION@
+RUNTIME_AGE=@RUNTIME_AGE@
+
+# SILC Library dirs
+RUNTIME_DIRS = \
+ contrib \
+ silcutil
+
+if SILC_ENABLE_SHARED
+if SILC_WIN32
+LIBTOOL_OPTS= -release $(RUNTIME_BASE_VERSION) -rpath $(DESTDIR)$(libdir) \
+ -export-dynamic -no-undefined
+else
+LIBTOOL_OPTS= -release $(RUNTIME_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
+endif
+LIBTOOL_RUNTIME_VERSION = \
+ -version-info $(RUNTIME_CURRENT):$(RUNTIME_REVISION):$(RUNTIME_AGE)
+else
+LIBTOOL_OPTS=
+LIBTOOL_RUNTIME_VERSION =
+endif
+if SILC_WIN32
+RUNTIME_LINK_LIBS=$(LIBS)
+else
+RUNTIME_LINK_LIBS=
+endif
+
+RUNTIME_LIB = libsrt.a
+
+SUBDIRS += $(RUNTIME_DIRS)
+
+CLEANFILES = $(RUNTIME_LIB)
+DISTCLEANFILES = $(RUNTIME_LIB)
+
+remove:
+ -rm -f $(CLEANFILES)
+
+all:
+ $(MAKE) remove $(RUNTIME_LIB)
+
+install-exec-hook:
+ -mkdir -p $(DESTDIR)$(libdir)
+ -$(LIBTOOL) $(INSTALL) libsrt.la $(DESTDIR)$(libdir)/
+
+libsrt.a:
+ find $(RUNTIME_DIRS) -type f -name *.lo | xargs \
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
+ $(RUNTIME_LINK_LIBS) \
+ $(LIBTOOL_RUNTIME_VERSION) \
+ $(LIBTOOL_OPTS) -o libsrt.la
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = srt.pc
+
+EXTRA_DIST = srt.pc.in
+
+#srt-install:
+# -mkdir -p $(docdir)/toolkit/
+# -$(INSTALL_DATA) $(top_srcdir)/doc/toolkit/* $(docdir)/toolkit
+# -$(INSTALL_DATA) $(top_srcdir)/lib/doc/*.gif $(docdir)/toolkit
+# -cp -R $(top_srcdir)/tutorial $(docdir)
+
+#install-data-hook: \
+# srt-install
+++ /dev/null
-#ifdef SILC_DIST_LIB
-#
-# lib/configure.ad
-#
-# Author: Pekka Riikonen <priikone@silcnet.org>
-#
-# Copyright (C) 2005, 2007 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 = xtrue; then
-
-AM_PROG_AS
-
-##
-## Will compile included libs
-##
-AC_MSG_NOTICE([Configuring SILC libraries])
-
-# SILC Library directories
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccore"
-#ifdef SILC_DIST_CRYPTO
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccrypt"
-#endif SILC_DIST_CRYPTO
-#ifdef SILC_DIST_MATH
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcmath"
-#endif SILC_DIST_MATH
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcapputil"
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
-#ifdef SILC_DIST_SFTP
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsftp"
-#endif SILC_DIST_SFTP
-#ifdef SILC_DIST_SIM
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsim"
-#endif SILC_DIST_SIM
-#ifdef SILC_DIST_CLIENTLIB
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcclient"
-#endif SILC_DIST_CLIENTLIB
-#ifdef SILC_DIST_ASN1
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcasn1"
-#endif SILC_DIST_ASN1
-#ifdef SILC_DIST_SKR
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcskr"
-#endif SILC_DIST_SKR
-#ifdef SILC_DIST_SERVERLIB
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcserver"
-#endif SILC_DIST_SERVERLIB
-#ifdef SILC_DIST_HTTP
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp"
-#endif SILC_DIST_HTTP
-#ifdef SILC_DIST_VCARD
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard"
-#endif SILC_DIST_VCARD
-#ifdef SILC_DIST_ACC
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcacc"
-#endif SILC_DIST_ACC
-#ifdef SILC_DIST_PGP
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcpgp"
-#endif SILC_DIST_PGP
-#ifdef SILC_DIST_SSH
-SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcssh"
-#endif SILC_DIST_SSH
-
-##
-## 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, removed or changed, 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, LIBSILCCLIENT or LIBSILCSERVER, and where
-# "functions" means functions public interfaces (API).
-#
-# 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.1
-
-# libsilc versions
-LIBSILC_CURRENT=2 # prev = 1
-LIBSILC_REVISION=0 # prev = 0
-LIBSILC_AGE=0 # prev = 0
-
-# libsilcclient versions
-LIBSILCCLIENT_CURRENT=2 # prev = 1
-LIBSILCCLIENT_REVISION=0 # prev = 0
-LIBSILCCLIENT_AGE=0 # prev = 0
-
-# libsilcserver versions
-LIBSILCSERVER_CURRENT=1 # prev = 0
-LIBSILCSERVER_REVISION=0 # prev = 0
-LIBSILCSERVER_AGE=0 # prev = 0
-
-# 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)
-AC_SUBST(LIBSILCSERVER_CURRENT)
-AC_SUBST(LIBSILCSERVER_REVISION)
-AC_SUBST(LIBSILCSERVER_AGE)
-
-# Check for big-endian machines
-AC_C_BIGENDIAN
-
-# Check for epoll_wait and verify that epoll_create works
-AC_CHECK_FUNC(epoll_wait,
- [
- AC_RUN_IFELSE(
- [
- #include <sys/epoll.h>
- int main()
- {
- int ret = epoll_create(5);
- if (ret < 0)
- return 1;
- close(ret);
- return 0;
- }
- ],
- [
- AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT])
- ],
- )
- ])
-
-#
-# Memory alignment. User can specify what alignment memory allocation and
-# SilcStack allocation use. Default is system default alignemnt.
-#
-AC_ARG_WITH(alignment,
- [ --with-alignment=NUMBER Memory alignment in bytes],
- [
- AC_DEFINE_UNQUOTED([SILC_ALIGNMENT], [$withval], [SILC_ALIGNMENT])
- AC_MSG_RESULT(Memory allocation alignment is $withval bytes)
- ],
- [
- AC_DEFINE([SILC_ALIGNMENT], SILC_SIZEOF_VOID_P, [SILC_ALIGNMENT])
- ])
-
-
-MODULESDIR="$silc_prefix/lib/modules"
-#ifdef SILC_DIST_SIM
-# SIM modules directory
-#
-AC_ARG_WITH(simdir,
- [[ --with-simdir=DIR directory for SIM modules [PREFIX/modules]]],
- [
- case "$withval" in
- no|yes)
- ;;
- *)
- MODULESDIR="$withval"
- ;;
- esac
- ])
-AC_DEFINE_UNQUOTED([SILC_MODULESDIR], "$MODULESDIR", [SILC_MODULESDIR])
-#endif SILC_DIST_SIM
-AC_SUBST(MODULESDIR)
-
-#ifdef SILC_DIST_TOOLKIT
-# 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], [], [SILC_STACKTRACE])
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac
- ],
- AC_MSG_RESULT(no)
- )
-#endif SILC_DIST_TOOLKIT
-
-#ifdef SILC_DIST_INPLACE
-#
-# Profiling options (never delivered to distributions)
-#
-AC_MSG_CHECKING(whether to enable gprof)
-AC_ARG_ENABLE(gprof,
- [ --enable-gprof enable gprof profiling],
- [
- case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- SILC_ADD_CFLAGS(-pg)
- LIBS="$LIBS -pg"
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac
- ],
- [
- AC_MSG_RESULT(no)
- ])
-
-AC_MSG_CHECKING(whether to enable gcov)
-AC_ARG_ENABLE(gcov,
- [ --enable-gcov enable gcov],
- [
- case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- SILC_ADD_CFLAGS(-fprofile-arcs)
- LIBS="$LIBS -lgcov"
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac
- ],
- [
- AC_MSG_RESULT(no)
- ])
-#endif SILC_DIST_INPLACE
-
-#
-# Makefile outputs
-#
-AC_CONFIG_FILES(
-lib/Makefile
-lib/contrib/Makefile
-lib/silccore/Makefile
-#ifdef SILC_DIST_SIM
-lib/silcsim/Makefile
-#endif SILC_DIST_SIM
-lib/silcske/Makefile
-lib/silcutil/Makefile
-#ifdef SILC_DIST_TOOLKIT
-lib/silcutil/unix/Makefile
-lib/silcutil/win32/Makefile
-lib/silcutil/symbian/Makefile
-#else !SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_CLIENT
-lib/silcutil/unix/Makefile
-lib/silcutil/win32/Makefile
-#else !SILC_DIST_CLIENT
-#ifdef SILC_DIST_SERVER
-lib/silcutil/unix/Makefile
-#endif SILC_DIST_SERVER
-#endif SILC_DIST_CLIENT
-#endif SILC_DIST_TOOLKIT
-lib/silcapputil/Makefile
-#ifdef SILC_DIST_SFTP
-lib/silcsftp/Makefile
-#endif SILC_DIST_SFTP
-#ifdef SILC_DIST_INPLACE
-lib/silcutil/tests/Makefile
-lib/silccore/tests/Makefile
-lib/silcsftp/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-
-#ifdef SILC_DIST_TOOLKIT
-AC_CONFIG_FILES(
-lib/silc.pc
-lib/silcclient.pc
-lib/silcserver.pc
-)
-#endif SILC_DIST_TOOLKIT
-
-#ifdef SILC_DIST_CLIENTLIB
-AC_CONFIG_FILES(
-lib/silcclient/Makefile
-lib/silcclient/tests/Makefile
-)
-#endif SILC_DIST_CLIENTLIB
-
-#ifdef SILC_DIST_SERVERLIB
-AC_CONFIG_FILES(
-lib/silcserver/Makefile
-lib/silcserver/tests/Makefile
-)
-#endif SILC_DIST_SERVERLIB
-
-#ifdef SILC_DIST_ASN1
-AC_CONFIG_FILES(
-lib/silcasn1/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silcasn1/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_ASN1
-
-#ifdef SILC_DIST_SKR
-AC_CONFIG_FILES(
-lib/silcskr/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silcskr/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_SKR
-
-#ifdef SILC_DIST_HTTP
-AC_CONFIG_FILES(
-lib/silchttp/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silchttp/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_HTTP
-
-#ifdef SILC_DIST_VCARD
-AC_CONFIG_FILES(
-lib/silcvcard/Makefile
-)
-#endif SILC_DIST_VCARD
-
-#ifdef SILC_DIST_ACC
-AC_CONFIG_FILES(
-lib/silcacc/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silcacc/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_ACC
-
-#ifdef SILC_DIST_PGP
-AC_CONFIG_FILES(
-lib/silcpgp/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silcpgp/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_PGP
-
-#ifdef SILC_DIST_SSH
-AC_CONFIG_FILES(
-lib/silcssh/Makefile
-#ifdef SILC_DIST_INPLACE
-lib/silcssh/tests/Makefile
-#endif SILC_DIST_INPLACE
-)
-#endif SILC_DIST_SSH
-
-fi # compile_libs
-
-#endif SILC_DIST_LIB
#include <stddef.h> /* size_t */
#include <stdlib.h>
-#include "silc.h"
+#include "silcruntime.h"
#ifndef uint32_t
#define uint32_t SilcUInt32
Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
<!--
-@LIBRARY=SILC Utility Library
+@LIBRARY=SILC Runtime Toolkit
@FILENAME=silcutillib.html
+@LINK=silcruntime.html:Runtime Toolkit Interface
@LINK=silctypes.html:Basic Types and Definitions
@LINK=silcbuffer.html:Data Buffer Interface
@LINK=silcbuffmt.html:Data Buffer Format Interface
@LINK=silcsocketstream.html:Socket Stream Interface
@LINK=silcfdstream.html:File Descriptor Stream Interface
@LINK=silcfileutil.html:File Utility Functions
+@LINK=silcdir.html:Directory Manipulation Interface
@LINK=silcstrutil.html:String Utility Interface
@LINK=silcsnprintf.html:Snprintf Interface
+@LINK=silcregex.html:Regular Expression Interface
@LINK=silcutf8.html:UTF-8 String Interface
@LINK=silcstringprep.html:Stringprep Interface
@LINK=silcutil.html:Utility Functions
@LINK=silcconfig.html:Config File Interface
-->
-<big><b>SILC Utility Library</b></big>
+<big><b>SILC Runtime Toolkit</b></big>
<br />
<small>Directory: lib/silcutil/</small>
<br />
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2000 - 2007 Pekka Riikonen
+# Copyright (C) 2000 - 2008 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
if SILC_SYMBIAN
SUBDIRS=symbian
else
-SUBDIRS=unix
+SUBDIRS=unix tests
endif
endif
-#ifdef SILC_DIST_TOOLKIT
-DIST_SUBDIRS=win32 symbian unix
-#else !SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_CLIENT
-DIST_SUBDIRS=win32 unix
-#else !SILC_DIST_CLIENT
-#ifdef SILC_DIST_SERVER
-DIST_SUBDIRS=unix
-#endif SILC_DIST_SERVER
-#endif SILC_DIST_CLIENT
-#endif SILC_DIST_TOOLKIT
+DIST_SUBDIRS=win32 symbian unix tests
-#ifdef SILC_DIST_TOOLKIT
SILC_DIST_SOURCE = stacktrace.c
SILC_DIST_HEADER = stacktrace.h
-#endif SILC_DIST_TOOLKIT
noinst_LTLIBRARIES = libsilcutil.la
silcbitops.c \
silcerrno.c \
silcgetopt.c \
- silcregex.c
+ silcregex.c \
+ silcthreadqueue.c
-#ifdef SILC_DIST_TOOLKIT
include_HEADERS = \
$(SILC_DIST_HEADER) \
silcbuffer.h \
silcbitops.h \
silcerrno.h \
silcgetopt.h \
- silcregex.h
+ silcregex.h \
+ silcthreadqueue.h
-SILC_EXTRA_DIST = tests
-#endif SILC_DIST_TOOLKIT
+SILC_EXTRA_DIST =
EXTRA_DIST = *.h $(SILC_EXTRA_DIST)
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005, 2006 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Halts async operation */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
static unsigned char pem_enc[64] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
#define SILC_BIT_POS(bit) (bit / SILC_BIT_SIZE)
#define SILC_BIT_MASK(bit) (1UL << (bit % SILC_BIT_SIZE))
GNU General Public License for more details.
*/
-/* $Id$ */
+/* $Id: silcbuffer.h,v 1.43 2008/01/15 06:36:54 priikone Exp $ */
/****h* silcutil/SILC Buffer Interface
*
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
case SILC_PARAM_REGEX:
{
const char *regex = va_arg(ap, char *);
- SilcBufferRegexFlags rflags = va_arg(ap, SilcUInt32);
+ SilcBufferRegexFlags rflags = va_arg(ap, SilcBufferRegexFlags);
SilcBufferStruct match;
SilcBool match_all = (rflags & SILC_STR_REGEX_ALL) != 0;
SilcBool match_nl = (rflags & SILC_STR_REGEX_NL) != 0;
if (x && tmp_len) {
FORMAT_HAS_SPACE(stack, dst, tmp_len);
- silc_buffer_put(dst, x, tmp_len);
+ silc_buffer_put(dst, (unsigned char *)x, tmp_len);
silc_buffer_pull(dst, tmp_len);
}
break;
case SILC_PARAM_REGEX:
{
const char *regex = va_arg(ap, char *);
- SilcBufferRegexFlags rflags = va_arg(ap, SilcUInt32);
+ SilcBufferRegexFlags rflags = va_arg(ap, SilcBufferRegexFlags);
SilcBufferStruct match;
SilcBool match_all = (rflags & SILC_STR_REGEX_ALL) != 0;
SilcBool match_nl = (rflags & SILC_STR_REGEX_NL) != 0;
Author: Giovanni Giacobbi <giovanni@giacobbi.net>
- Copyright (C) 2002 - 2007 Giovanni Giacobbi
+ Copyright (C) 2002 - 2008 Giovanni Giacobbi
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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/* limit debug logging verbosity */
#if 0
*
* Now you can use the newly created Entity to register a group of expected
* known options and sub-blocks, and then you can call the main parsing loop
- * with the silc_config_main() function. When silc_config_main() will
- * return, if some error encoured the object file will point to the file
- * that caused this error (this can be different from the originally
- * opened file if it contained `Include' directives). If no errors
+ * with the silc_config_main() function. When silc_config_main() will
+ * return, if some error encoured the object file will point to the file
+ * that caused this error (this can be different from the originally
+ * opened file if it contained `Include' directives). If no errors
* encoured then the File objects will still point to the original file.
*
* While silc_config_main() will take care of destroying Entities before
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Load shared object */
void silc_dll_close(SilcDll dll)
{
#ifdef SILC_UNIX
+#if defined(HAVE_DLOPEN)
dlclose(dll);
+#endif /* HAVE_DLOPEN */
#elif SILC_WIN32
FreeLibrary(dll);
#else
void *silc_dll_getsym(SilcDll dll, const char *symbol)
{
#ifdef SILC_UNIX
+#if defined(HAVE_DLOPEN)
return (void *)dlsym(dll, symbol);
+#endif /* HAVE_DLOPEN */
#elif SILC_WIN32
return (void *)GetProcAddress(dll, symbol);
#else
const char *silc_dll_error(SilcDll dll)
{
#ifdef SILC_UNIX
+#if defined(HAVE_DLOPEN)
return dlerror();
+#endif /* HAVE_DLOPEN */
#elif SILC_WIN32
return NULL;
#else
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Set environment variable with value */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
***/
SilcBool silc_clearenv(void);
-
#endif /* SILCENV_H */
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Get last error */
return;
}
- SILC_LOG_DEBUG(("Error: %s (%d)", silc_errno_string(error), error));
-
tls->error_reason[0] = '\0';
tls->error = error;
}
if (!tls)
return;
- SILC_LOG_DEBUG(("Error: %s (%d)", silc_errno_string(error), error));
-
tls->error_reason[0] = '\0';
tls->error = error;
}
silc_vsnprintf(tls->error_reason, sizeof(tls->error_reason), format, va);
va_end(va);
- SILC_LOG_DEBUG(("Error: %s (%d): %s", silc_errno_string(error), error,
- tls->error_reason));
-
tls->error = error;
}
silc_vsnprintf(tls->error_reason, sizeof(tls->error_reason), format, va);
va_end(va);
- SILC_LOG_DEBUG(("Error: %s (%d): %s", silc_errno_string(error), error,
- tls->error_reason));
-
tls->error = error;
}
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/* Opens a file indicated by the filename `filename' with flags indicated
by the `flags'. */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 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
*
* DESCRIPTION
*
- * The SILC File Util Interface is a small set of functions that provides a
- * portable access method to the filesystem.
+ * The SILC File Util Interface is a small set of functions that provides a
+ * portable access method to the filesystem.
*
***/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
SILC_TASK_CALLBACK(silc_fsm_run);
SILC_TASK_CALLBACK(silc_fsm_finish_fsm);
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Getopt, like getopt(3). */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2007 Pekka Riikonen
+ Copyright (C) 2001 - 2008 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
However, this is reliable and no data is lost at any point. If you know
that you never have duplicate keys then this is as fast as any simple
hash table. */
-/* $Id$ */
-#include "silc.h"
-#include "silchashtable.h"
+#include "silcruntime.h"
/* Define to 1 if you want hash table debug enabled */
#define SILC_HASH_TABLE_DEBUG 0
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/* SilcLogSettings context */
typedef struct {
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
#ifndef SILC_STACKTRACE
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
*
* DESCRIPTION
*
- * Simple implementation of MIME. Supports creation and parsing of simple
+ * Simple MIME Interface. This API supports creation and parsing of simple
* MIME messages, multipart MIME messages, including nested multiparts, and
* MIME fragmentation and defragmentation.
*
- * SILC Mime API is not thread-safe. If the same MIME context must be
+ * SILC Mime API is not thread-safe. If the same SilcMime context must be
* used in multithreaded environment concurrency control must be employed.
*
***/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/* Returns bound port from listener */
int silc_net_get_socket_opt(int sock, int level, int option,
void *optval, int *opt_len)
{
- int ret = getsockopt(sock, level, option, optval, opt_len);
+ int ret = getsockopt(sock, level, option, optval, (unsigned int *)opt_len);
if (ret < 0)
silc_set_errno_posix(errno);
return ret;
char **ip)
{
char host[1024];
- int rval, len;
+ int rval;
+ unsigned int len;
#ifdef HAVE_IPV6
struct sockaddr_storage remote;
char **ip)
{
char host[1024];
- int rval, len;
+ int rval;
+ unsigned int len;
#ifdef HAVE_IPV6
struct sockaddr_storage local;
{
#ifdef HAVE_IPV6
struct sockaddr_storage remote;
- int len;
+ unsigned int len;
char s[NI_MAXSERV];
memset(&remote, 0, sizeof(remote));
return atoi(s);
#else
struct sockaddr_in remote;
- int len;
+ unsigned int len;
memset(&remote, 0, sizeof(remote));
len = sizeof(remote);
{
#ifdef HAVE_IPV6
struct sockaddr_storage local;
- int len;
+ unsigned int len;
char s[NI_MAXSERV];
memset(&local, 0, sizeof(local));
return atoi(s);
#else
struct sockaddr_in local;
- int len;
+ unsigned int len;
memset(&local, 0, sizeof(local));
len = sizeof(local);
- SilcStack support compile/match without real memory allocations
*/
-#include "silc.h"
+#include "silcruntime.h"
#define RE_NREGS 128 /* number of registers available */
regexp->rstack = silc_stack_alloc(512, regexp->rstack);
/* Compile */
- ret = silc_re_compile_pattern((char *)regex, strlen(regex), regexp);
+ ret = silc_re_compile_pattern((unsigned char *)regex, strlen(regex), regexp);
if (ret != SILC_OK)
silc_set_errno(ret);
f |= RE_NOTEOL;
/* Search */
- ret = silc_re_search(regexp, (char *)string, string_len, 0, string_len,
- num_match ? ®s : NULL, f);
+ ret = silc_re_search(regexp, (unsigned char *)string, string_len, 0,
+ string_len, num_match ? ®s : NULL, f);
if (ret < 0) {
if (ret == -1)
silc_set_errno(SILC_ERR_NOT_FOUND);
* using the SILC_STR_REGEX in SILC Buffer Format API directly. This
* function only provides basic matching and substitution.
*
+ * EXAMPLE
+ *
+ * // Replace all foos with bar on all lines in the buffer
+ * silc_subst(buffer, "s/foo/bar/g");
+ *
***/
SilcBool silc_subst(SilcBuffer buffer, const char *subst);
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1998 - 2007 Pekka Riikonen
+ Copyright (C) 1998 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
/* Delete even tasks */
parent = silc_schedule_get_parent(schedule);
- silc_hash_table_list(parent->events, &htl);
- while (silc_hash_table_get(&htl, NULL, (void *)&etask)) {
- silc_hash_table_del_by_context(parent->events, etask->event, etask);
- silc_free(etask->event);
- silc_free(etask);
+ if (parent->events) {
+ silc_hash_table_list(parent->events, &htl);
+ while (silc_hash_table_get(&htl, NULL, (void *)&etask)) {
+ silc_hash_table_del_by_context(parent->events, etask->event, etask);
+ silc_free(etask->event);
+ silc_free(etask);
+ }
+ silc_hash_table_list_reset(&htl);
}
- silc_hash_table_list_reset(&htl);
return;
}
/* Delete even tasks */
parent = silc_schedule_get_parent(schedule);
- silc_hash_table_list(parent->events, &htl);
- while (silc_hash_table_get(&htl, NULL, (void *)&task))
- task->valid = FALSE;
- silc_hash_table_list_reset(&htl);
+ if (parent->events) {
+ silc_hash_table_list(parent->events, &htl);
+ while (silc_hash_table_get(&htl, NULL, (void *)&task))
+ task->valid = FALSE;
+ silc_hash_table_list_reset(&htl);
+ }
SILC_SCHEDULE_UNLOCK(schedule);
return TRUE;
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1998 - 2007 Pekka Riikonen
+ Copyright (C) 1998 - 2008 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 SILC Scheduler is designed to be the sole main loop of the application
* so that the application does not need any other main loop. However,
- * SILC Scheduler does support running the scheduler only once, so that the
- * scheduler does not block, and thus providing a possiblity that some
+ * SILC Scheduler does support running the scheduler only one iteration, so
+ * that the scheduler does not block, and thus providing a possiblity that some
* external main loop is run over the SILC Scheduler.
*
- * Typical application first initializes the scheduler and then registers
+ * Typical application first initializes the scheduler and then register
* the very first tasks to the scheduler and then run the scheduler. After
* the scheduler's run function returns the application is considered to be
* ended.
*
- * On WIN32 systems the SILC Scheduler is too designed to work as the main
+ * On Windows systems the SILC Scheduler is too designed to work as the main
* loop of the GUI application. It can handle all Windows messages and
* it dispatches them from the scheduler, and thus makes it possible to
* create GUI applications. The scheduler can also handle all kinds of
* which makes it possible to allocate several schedulers for one application.
* Since the scheduler must be run in single-thread, a multi-threaded
* application could be created by allocating own scheduler for each of the
- * worker threads.
+ * worker threads. Each scheduler in worker thread should be a child
+ * scheduler created from the main thread's parent schedule.
*
***/
*
**************************************************************/
-#include "silc.h"
+#include "silcruntime.h"
#ifdef HAVE_LONG_DOUBLE
#define LDOUBLE long double
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
* more than `read_limit_bytes' of data. The `limit_sec' and `limit_usec'
* specifies the time limit that is applied if `read_rate' and/or
* `read_limit_bytes' is reached. If all arguments except `stream'
- * are zero this resets the QoS from the socket stream, all QoS for
+ * are zero this resets the QoS from the socket stream, all QoS data for
* this socket stream that may be pending will be cancelled.
*
***/
*/
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
*
* DESCRIPTION
*
- * Implementation of data stack which can be used to do fast allocations from
+ * Data stack interface which can be used to do fast allocations from
* the stack. Basically SilcStack is a pre-allocated memory pool system
* which allows fast memory allocation for routines and applications that
* frequently allocate small amounts of memory. Other advantage of this
*
* DESCRIPTION
*
- * Push the top of the stack down which becomes the new top of the stack.
+ * Push the top of the stack and add new stack frame on top of the stack.
* For every silc_stack_push call there must be silc_stack_pop call. All
* allocations between these two calls will be done from the top of the
* stack and all allocated memory is freed after the next silc_stack_pop
*
* DESCRIPTION
*
- * Pop the top of the stack which removes the previous stack frame and
- * becomes the top of the stack. After popping, memory allocated in
+ * Pop the top of the stack to remove the previous stack frame and use
+ * previous frame as top of the stack. After popping, memory allocated in
* the old frame is freed. For each silc_stack_push call there must be
* silc_stack_pop call to free all memory (in reality any memory is not
* freed but within the stack it is). This returns the stack pointer of
* NOTES
*
* This function should be used only if low level memory allocation with
- * SilcStack is needed. Instead, silc_srealloc could be used.
+ * SilcStack is needed. Instead, silc_srealloc could be used which can
+ * handle failed reallocation by allocating new block.
*
***/
void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2006 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
typedef struct {
SilcStreamOps *ops;
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 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
* other stream API derived from this API can use this same interface for
* reading and writing.
*
+ * The SilcStream is an abstraction. It can represent any stream, socket
+ * stream, file descriptor stream, packet stream, etc.
+ *
* Note that stream implementations usually are not thread-safe. Always
* verify whether a stream implementation is thread-safe by checking their
* corresponding documentation.
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2004 - 2005 Pekka Riikonen
+ Copyright (C) 2004 - 2008 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
*/
-#include "silc.h"
-#include "silcstringprep.h"
+#include "silcruntime.h"
#include "stringprep.h"
/* We use GNU Libidn which has stringprep to do the magic. Only bad thing
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2002 - 2007 Pekka Riikonen
+ Copyright (C) 2002 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
-#include "silcstrutil.h"
+#include "silcruntime.h"
/* Concatenates the `src' into `dest'. If `src_len' is more than the
size of the `dest' (minus NULL at the end) the `src' will be
*
* DESCRIPTION
*
- * String manipulation utility routines. These routines provides
- * various helper functions for encoding, decoding and otherwise
- * managing strings.
+ * Various string utility routines.
*
***/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/***************************** Thread Pool API *****************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2003 - 2007 Pekka Riikonen
+ Copyright (C) 2003 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Fills the SilcTime structure with correct values */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Start timer */
* Platform specific socket. On POSIX compliant systems this is simply
* an integer, representing the socket. On other systems it is platform
* specific socket context. Access it only through routines that can
- * handle SilcSocket types, unless you know what you are doing.
+ * handle SilcSocket types.
*
* SOURCE
*/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2004 - 2007 Pekka Riikonen
+ Copyright (C) 2004 - 2008 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
*/
-#include "silc.h"
-#include "silcutf8.h"
+#include "silcruntime.h"
/* Encodes the string `bin' of which encoding is `bin_encoding' to the
UTF-8 encoding into the buffer `utf8' which is of size of `utf8_size'.
if (enclen + 3 > bin_size)
goto overflow;
bin[enclen] = '\\';
- silc_snprintf(bin + enclen + 1, 3, "%02X", cv);
+ silc_snprintf((char *)bin + enclen + 1, 3, "%02X", cv);
}
enclen += 3;
continue;
* These are general utility functions that doesn't belong to any specific
* group of routines.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/* Gets line from a buffer. Stops reading when a newline or EOF occurs.
This doesn't remove the newline sign from the destination buffer. The
return NULL;
for (i = 0; i < data_len; i++) {
- silc_snprintf(cp, len, "%02X", data[i]);
+ silc_snprintf((char *)cp, len, "%02X", data[i]);
cp += 2;
len -= 2;
if ((i + 1) % 2 == 0)
- silc_snprintf(cp++, len--, " ");
+ silc_snprintf((char *)cp++, len--, " ");
if ((i + 1) % 10 == 0)
- silc_snprintf(cp++, len--, " ");
+ silc_snprintf((char *)cp++, len--, " ");
}
i--;
if ((i + 1) % 10 == 0)
if ((i + 1) % 2 == 0)
*(--cp) = '\0';
- return fingerprint;
+ return (char *)fingerprint;
}
/* Return TRUE if the `data' is ASCII string. */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2002, 2007 Pekka Riikonen
+ Copyright (C) 2002 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
#ifdef SILC_STACKTRACE
Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2004 - 2007 Pekka Riikonen
+# Copyright (C) 2004 - 2008 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
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-bin_PROGRAMS = test_silcstrutil test_silcstringprep test_silchashtable \
+check_PROGRAMS = \
+ test_silcstrutil test_silcstringprep test_silchashtable \
test_silclist test_silcfsm test_silcasync test_silcschedule \
test_silcnet test_silcstack test_silcmime test_silcfdstream \
test_silcatomic test_silcmutex test_silctime test_silcthread \
test_silcdll test_silcenv test_silctimer test_silcbitops \
- test_silcregex test_silcbuffmt test_silcdir
+ test_silcregex test_silcbuffmt test_silcdir test_silcthreadqueue
-test_silcstrutil_SOURCES = test_silcstrutil.c
-test_silcstringprep_SOURCES = test_silcstringprep.c
-test_silchashtable_SOURCES = test_silchashtable.c
-test_silclist_SOURCES = test_silclist.c
-test_silcmime_SOURCES = test_silcmime.c
-test_silcfsm_SOURCES = test_silcfsm.c
-test_silcasync_SOURCES = test_silcasync.c
-test_silcschedule_SOURCES = test_silcschedule.c
-test_silcnet_SOURCES = test_silcnet.c
-test_silcstack_SOURCES = test_silcstack.c
-test_silcfdstream_SOURCES = test_silcfdstream.c
-test_silcatomic_SOURCES = test_silcatomic.c
-test_silcmutex_SOURCES = test_silcmutex.c
-test_silctime_SOURCES = test_silctime.c
-test_silcthread_SOURCES = test_silcthread.c
-test_silcdll_SOURCES = test_silcdll.c
-test_silcenv_SOURCES = test_silcenv.c
-test_silctimer_SOURCES = test_silctimer.c
-test_silcbitops_SOURCES = test_silcbitops.c
-test_silcregex_SOURCES = test_silcregex.c
-test_silcbuffmt_SOURCES = test_silcbuffmt.c
-test_silcdir_SOURCES = test_silcdir.c
+TESTS = test_silcstrutil test_silcstringprep test_silchashtable \
+ test_silclist test_silcfsm test_silcasync test_silcschedule \
+ test_silcnet test_silcstack test_silcmime test_silcfdstream \
+ test_silcatomic test_silctime test_silcthread \
+ test_silcdll test_silcenv test_silctimer test_silcbitops \
+ test_silcregex test_silcbuffmt test_silcdir test_silcthreadqueue
LIBS = $(SILC_COMMON_LIBS)
-LDADD = -L.. -L../.. -lsilc
+LDADD = -L.. -L../.. -lsrt
include $(top_srcdir)/Makefile.defines.in
/* SilcAsyncOperation tests */
-#include "silc.h"
+#include "silcruntime.h"
#include "silcfsm.h"
#include "silcasync.h"
}
SILC_LOG_DEBUG(("Allocating scheduler"));
- schedule = silc_schedule_init(0, NULL, NULL);
+ schedule = silc_schedule_init(0, NULL, NULL, NULL);
f = silc_calloc(1, sizeof(*f));
if (!f)
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* atomic operation tests */
-#include "silc.h"
-#include "silcatomic.h"
+#include "silcruntime.h"
int main(int argc, char **argv)
{
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* Bit operation tests */
-#include "silc.h"
+#include "silcruntime.h"
int main(int argc, char **argv)
{
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* Buffer formatting tests */
-#include "silc.h"
+#include "silcruntime.h"
int print(SilcStack stack, SilcBuffer buf, void *value, void *context)
{
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcDir tests */
-#include "silc.h"
+#include "silcruntime.h"
int main(int argc, char **argv)
{
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcDll tests */
-#include "silc.h"
+#include "silcruntime.h"
int main(int argc, char **argv)
{
SILC_LOG_DEBUG(("Load shared object /lib/libc.so.6"));
dll = silc_dll_load("/lib/libc.so.6");
+ if (!dll)
+ dll = silc_dll_load("/lib64/libc.so.6");
if (!dll) {
SILC_LOG_DEBUG(("Cannot load: %s", silc_dll_error(dll)));
goto err;
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* environment tests */
-#include "silc.h"
+#include "silcruntime.h"
int main(int argc, char **argv)
{
goto err;
success = TRUE;
- for (i = 0; i < SILC_ERR_MAX + 10; i++) {
- fprintf(stderr, "%d: ", i);
- silc_set_errno(i);
- }
-
err:
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SILC FD Stream tests */
-#include "silc.h"
+#include "silcruntime.h"
SilcBool success = FALSE;
SilcSchedule schedule;
}
SILC_LOG_DEBUG(("Allocating scheduler"));
- schedule = silc_schedule_init(0, NULL, NULL);
+ schedule = silc_schedule_init(0, NULL, NULL, NULL);
if (!schedule)
goto err;
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SILC FSM tests */
-#include "silc.h"
+#include "silcruntime.h"
#include "silcfsm.h"
typedef void (*Callback)(void *context);
}
SILC_LOG_DEBUG(("Allocating scheduler"));
- schedule = silc_schedule_init(0, NULL, NULL);
+ schedule = silc_schedule_init(0, NULL, NULL, NULL);
f = silc_calloc(1, sizeof(*f));
if (!f)
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* Hash table tests */
-#include "silc.h"
+#include "silcruntime.h"
typedef struct entry_struct {
char name[8];
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcList tests */
-#include "silc.h"
+#include "silcruntime.h"
struct foo {
int i;
silc_list_add(list, f1);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
SILC_LOG_DEBUG(("Delete the entry"));
- silc_list_del(list, f1);
+ silc_list_del(list, f1);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END)
goto err;
silc_list_add(list, f1);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
SILC_LOG_DEBUG(("Delete the entry"));
- silc_list_del(list, f1);
+ silc_list_del(list, f1);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END)
goto err;
silc_list_insert(list, NULL, f4);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_insert(list, f1, f4);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_insert(list, f3, f4);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_insert(list, NULL, f4);
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_start(list);
silc_list_del(list, f1);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_del(list, f3);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_del(list, f2);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
silc_list_start(list);
while ((f = silc_list_get(list)) != SILC_LIST_END) {
- SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
+ SILC_LOG_DEBUG(("entry %d, %p, next=%p, prev=%p", f->i, f, f->next,
f->prev));
}
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcMime tests */
-#include "silc.h"
+#include "silcruntime.h"
#include "silcmime.h"
int main(int argc, char **argv)
silc_log_set_debug_string("*mime*,*errno*");
}
- /*
+ /*
* Simple MIME test
*/
SILC_LOG_DEBUG(("Allocating MIME message context"));
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* Locking performance tests. Gives locsk&unlocks/second. */
/* Version 1.0 */
-#include "silc.h"
+#include "silcruntime.h"
typedef struct {
SilcThread thread;
sleep(1);
val = rdtsc() - val;
val /= 1000; /* Gives us milliseconds */
+ cpu_freq = val;
fprintf(stderr, "CPU frequency: %llu\n", val);
max_locks = MAX_LOCKS;
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SILC Net API tests */
-#include "silc.h"
+#include "silcruntime.h"
SilcSchedule schedule;
}
SILC_LOG_DEBUG(("Allocating scheduler"));
- schedule = silc_schedule_init(0, NULL, NULL);
+ schedule = silc_schedule_init(0, NULL, NULL, NULL);
f = silc_calloc(1, sizeof(*f));
if (!f)
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* Regex tests */
-#include "silc.h"
+#include "silcruntime.h"
int main(int argc, char **argv)
{
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcSchedule tests */
-#include "silc.h"
+#include "silcruntime.h"
typedef void (*Callback)(void *context);
SILC_TASK_CALLBACK(cont2)
{
#ifdef SILC_DEBUG
- silc_schedule_stats(schedule);
+// silc_schedule_stats(schedule);
#endif /* SILC_DEBUG */
SILC_LOG_DEBUG(("Adding %d fd tasks", NUM_FTASK - 10));
for (i = 0; i < NUM_FTASK - 10; i++)
silc_schedule_task_add_fd(schedule, i + 5, foo, (void *)(i + 5));
#endif
+
+ silc_schedule_event_signal(schedule, "interrupted", NULL, schedule);
}
SILC_TASK_CALLBACK(cont)
int i;
#ifdef SILC_DEBUG
- silc_schedule_stats(schedule);
+// silc_schedule_stats(schedule);
#endif /* SILC_DEBUG */
SILC_LOG_DEBUG(("Adding %d timeout tasks", NUM_TTASK / 3));
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcStack tests */
-#include "silc.h"
+#include "silcruntime.h"
#define NUM_ALLS 300
stack = silc_stack_alloc(0, NULL);
if (!stack)
goto err;
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Allocating 2048 bytes from stack"));
ptr = silc_smalloc(stack, 2048);
if (!ptr)
goto err;
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Freeing the stack"));
silc_stack_free(stack);
stack = silc_stack_alloc(0, NULL);
if (!stack)
goto err;
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Pushing and allocating %d times", NUM_ALLS));
if (!silc_stack_push(stack, NULL))
if (!ptr2)
goto err;
}
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
silc_stack_pop(stack);
SILC_LOG_DEBUG(("Popping"));
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Pushing and allocating %d times", NUM_ALLS));
if (!silc_stack_push(stack, NULL))
if (!ptr2)
goto err;
}
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
silc_stack_pop(stack);
SILC_LOG_DEBUG(("Popping"));
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Pushing %d times", NUM_ALLS / 2));
for (i = 0; i < NUM_ALLS / 2; i++) {
if (!ptr2)
goto err;
}
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Popping %d times", NUM_ALLS / 2));
for (i = 0; i < NUM_ALLS / 2; i++)
silc_stack_pop(stack);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Pushing and reallocating %d times", NUM_ALLS / 10));
ptr2 = NULL;
if (!ptr2)
goto err;
}
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
silc_stack_pop(stack);
SILC_LOG_DEBUG(("Popping"));
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Creating child stack"));
child = silc_stack_alloc(8190, stack);
if (!ptr2)
goto err;
}
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Popping %d times", NUM_ALLS / 2));
for (i = 0; i < NUM_ALLS / 2; i++)
silc_stack_pop(child);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Pushing and reallocating %d times", NUM_ALLS / 10));
ptr2 = NULL;
goto err;
}
ptr = silc_smalloc(child, 100000);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child);
+#endif /* SILC_DIST_INPLACE */
silc_stack_pop(child);
SILC_LOG_DEBUG(("Popping"));
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child);
+#endif /* SILC_DIST_INPLACE */
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
silc_stack_free(child);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Creating child stack"));
child = silc_stack_alloc(8192, stack);
if (!ptr2)
goto err;
}
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Popping %d times", NUM_ALLS / 10));
for (i = 0; i < NUM_ALLS / 10; i++)
silc_stack_pop(child);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Pushing and reallocating %d times", NUM_ALLS / 10));
ptr2 = NULL;
SILC_LOG_DEBUG(("Allocate child from child"));
child2 = silc_stack_alloc(0, child);
ptr = silc_smalloc(child2, 500000);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child2);
+#endif /* SILC_DIST_INPLACE */
silc_stack_free(child2);
- silc_stack_stats(child);
+#ifdef SILC_DIST_INPLACE
+ silc_stack_stats(child2);
+#endif /* SILC_DIST_INPLACE */
silc_stack_pop(child);
SILC_LOG_DEBUG(("Popping"));
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(child);
+#endif /* SILC_DIST_INPLACE */
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
silc_stack_free(child);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Purge stack"));
silc_stack_purge(stack);
+#ifdef SILC_DIST_INPLACE
silc_stack_stats(stack);
+#endif /* SILC_DIST_INPLACE */
SILC_LOG_DEBUG(("Current alignment: %d", silc_stack_get_alignment(stack)));
SILC_LOG_DEBUG(("Set alignemtn to 16"));
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* Stringprep tests */
-#include "silc.h"
+#include "silcruntime.h"
typedef struct {
const char *comment;
{"Locale test",
"Päivää", "päivää", 0, SILC_STRING_LOCALE},
{"Locale test2",
- "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'",
+ "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'",
"#öäöö/&#\\#(&(&#(.äöääöääöäö^'", 0, SILC_STRING_LOCALE},
/* Some libidn tests */
{"Locale test",
"Päivää", "päivää", 0, SILC_STRING_LOCALE},
{"Locale test2",
- "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'",
+ "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'",
"#öäöö/&#\\#(&(&#(.äöääöääöäö^'", 0, SILC_STRING_LOCALE},
};
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* UTF-8 decoding tests */
/* Other string util tests too */
-#include "silc.h"
+#include "silcruntime.h"
#define utf8fail(n, data, len) \
const unsigned char u##n[] = (data); \
/* To UTF-8 */
l = silc_utf8_encoded_len(s3, strlen(s3), SILC_STRING_LDAP_DN);
if (!l)
- goto err;
+ goto err;
s4 = silc_calloc(l + 1, sizeof(*s4));
silc_utf8_encode(s3, strlen(s3), SILC_STRING_LDAP_DN, s4, l);
SILC_LOG_DEBUG(("utf8 = %s", s4));
s2 = "PÄIVÄÄ VUAN YRJÖ";
l = silc_utf8_encoded_len(s1, strlen(s1), SILC_STRING_LOCALE);
if (!l)
- goto err;
+ goto err;
s3 = silc_calloc(l + 1, sizeof(*s3));
silc_utf8_encode(s1, strlen(s1), SILC_STRING_LOCALE, s3, l);
l = silc_utf8_encoded_len(s2, strlen(s2), SILC_STRING_LOCALE);
if (!l)
- goto err;
+ goto err;
s4 = silc_calloc(l + 1, sizeof(*s4));
silc_utf8_encode(s2, strlen(s2), SILC_STRING_LOCALE, s4, l);
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcThreadPool tests */
-#include "silc.h"
+#include "silcruntime.h"
SilcSchedule schedule;
silc_log_set_debug_string("*thread*,*errno*");
}
- schedule = silc_schedule_init(0, NULL, NULL);
+ schedule = silc_schedule_init(0, NULL, NULL, NULL);
if (!schedule)
goto err;
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcTime tests */
-#include "silc.h"
+#include "silcruntime.h"
int main(int argc, char **argv)
{
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
/* SilcTimer tests */
-#include "silc.h"
+#include "silcruntime.h"
SilcSchedule schedule;
SilcTimerStruct timer;
silc_timer_start_time(&timer, &st);
silc_timer_value_time(&timer, &t);
silc_time_universal_string(&st, ts, sizeof(ts));
- SILC_LOG_DEBUG(("Start time: %s", ts));
+ SILC_LOG_DEBUG(("Start time: %s", ts));
silc_time_universal_string(&t, ts, sizeof(ts));
- SILC_LOG_DEBUG(("End time: %s", ts));
+ SILC_LOG_DEBUG(("End time: %s", ts));
success = TRUE;
silc_schedule_stop(schedule);
silc_log_set_debug_string("*timer*,*errno*");
}
- schedule = silc_schedule_init(0, NULL, NULL);
+ schedule = silc_schedule_init(0, NULL, NULL, NULL);
if (!schedule)
goto err;
SILC_LOG_DEBUG(("Testing was %s", success ? "SUCCESS" : "FAILURE"));
fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
- return success;
+ return !success;
}
Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
*/
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
{
SilcDir dir;
- if (!name || !strlen(!name)) {
+ if (!name || !strlen(name)) {
silc_set_errno(SILC_ERR_INVALID_ARGUMENT);
return NULL;
}
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
-#include "silcnet.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
SilcSocketStream sock = stream;
SilcSockaddr s;
struct sockaddr *from;
- int len, flen;
+ int len;
+ unsigned int flen;
SILC_LOG_DEBUG(("Reading data from UDP socket %d", sock->sock));
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1998 - 2007 Pekka Riikonen
+ Copyright (C) 1998 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
#if defined(HAVE_EPOLL_WAIT)
#include <sys/epoll.h>
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/************************ Static utility functions **************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2007 Pekka Riikonen
+ Copyright (C) 2001 - 2008 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
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/**************************** SILC Thread API *******************************/
#if (defined(SILC_THREADS) && defined(HAVE_PTHREAD_KEY_CREATE) && \
defined(HAVE_PTHREAD_ONCE))
+static SilcBool key_set = FALSE;
static pthread_key_t key;
static pthread_once_t key_once = PTHREAD_ONCE_INIT;
{
if (pthread_key_create(&key, silc_thread_tls_destructor))
SILC_LOG_ERROR(("Error creating Thread-local storage"));
+ key_set = TRUE;
}
SilcTls silc_thread_tls_init(void)
SilcTls silc_thread_get_tls(void)
{
+ if (!key_set)
+ return NULL;
return pthread_getspecific(key);
}
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 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
*/
-#include "silc.h"
+#include "silcruntime.h"
/* Returns the username of the user. If the global variable LOGNAME
does not exists we will get the name from the password file. */
Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
#
-# silc.m4
+# srt.m4
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2007 Pekka Riikonen
+# Copyright (C) 2007 - 2008 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
# Usage: SILC_SYSTEM_IS_SMP([ACTION-IF-FOUND] [, ACTION-IF-NOT-FOUND]
# [, ACTION-IF-NOT-DETECTED])
#
-# The ACTION-IF-NOT-DETECTED is called if we could not detect whether or
+# The ACTION-IF-NOT-DETECTED is called if we could not detect whether or
# not the system is SMP.
#
# x_is_smp variable is set to true or false as a result for calling this
-# function. Caller may use the variable to check for the result in the
+# function. Caller may use the variable to check for the result in the
# code.
#
AC_DEFUN([SILC_SYSTEM_IS_SMP],
# Function to check for CPU feature flags.
#
-# Usage: SILC_CPU_FLAG(flag [, ACTION-IF-FOUND] [, ACTION-IF-NOT-FOUND])
+# Usage: SILC_CPU_FLAG(flag, enable, [, ACTION-IF-FOUND]
+# [, ACTION-IF-NOT-FOUND])
#
# x_have_cpu_<flag> variable is set to true or false value as a result for
# calling this function for the <flag>. Caller may use the variable to
-# check the result in the code.
+# check the result in the code. If <enable> is true this will add
+# AC_ARG_ENABLE option for the <flag>.
#
AC_DEFUN([SILC_CPU_FLAG],
[
AC_MSG_CHECKING(whether CPU supports $1)
x_have_cpu_$1=false
- case "$target" in
- *-*-linux*)
- # Take data from Linux /proc
- if test -f /proc/cpuinfo; then
- cpuflags=`grep "^flags.*$1 " /proc/cpuinfo 2> /dev/null`
+ if test x$2 = xtrue; then
+ AC_ARG_ENABLE($1,
+ [ --enable-$1 ],
+ [
+ AC_MSG_RESULT(yes - enabled by --enable-$1)
+ x_have_cpu_$1=true
+ ])
+ fi
+
+ if test x$x_have_cpu_$1 = xfalse; then
+ case "$target" in
+ *-*-linux*)
+ # Take data from Linux /proc
+ if test -f /proc/cpuinfo; then
+ cpuflags=`grep "^flags.*$1 " /proc/cpuinfo 2> /dev/null`
+ if test $? != 0; then
+ AC_MSG_RESULT(no)
+ x_have_cpu_$1=false
+ ifelse([$4], , :, [$4])
+ else
+ AC_MSG_RESULT(yes)
+ x_have_cpu_$1=true
+ ifelse([$3], , :, [$3])
+ fi
+ else
+ AC_MSG_RESULT(no)
+ x_have_cpu_$1=false
+ ifelse([$4], , :, [$4])
+ fi
+ ;;
+
+ *-*-*bsd*)
+ # BSDs have some flags in sysctl 'machdep' variable
+ cpuflags=`/sbin/sysctl machdep 2> /dev/null | grep "\.$1.*.1"`
if test $? != 0; then
AC_MSG_RESULT(no)
- ifelse([$3], , :, [$3])
+ x_have_cpu_$1=false
+ ifelse([$4], , :, [$4])
else
AC_MSG_RESULT(yes)
x_have_cpu_$1=true
- ifelse([$2], , :, [$2])
+ ifelse([$3], , :, [$3])
fi
- else
- AC_MSG_RESULT(no)
- ifelse([$3], , :, [$3])
- fi
- ;;
-
- *-*-*bsd*)
- # BSDs have some flags in sysctl 'machdep' variable
- cpuflags=`/sbin/sysctl machdep 2> /dev/null | grep "\.$1.*.1"`
- if test $? != 0; then
- AC_MSG_RESULT(no)
- ifelse([$3], , :, [$3])
- else
- AC_MSG_RESULT(yes)
- x_have_cpu_$1=true
- ifelse([$2], , :, [$2])
- fi
- ;;
+ ;;
- *)
- AC_MSG_RESULT(no, cannot detect on this system)
- ifelse([$3], , :, [$3])
- ;;
- esac
+ *)
+ AC_MSG_RESULT(no - cannot detect on this system)
+ x_have_cpu_$1=false
+ ifelse([$4], , :, [$4])
+ ;;
+ esac
+ fi
])
# Function to check if compiler option works with the compiler. If you
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-SUBDIRS = libsilc libsilcclient
+SUBDIRS =
EXTRA_DIST = \
silcdefs.h silc.dsw copy_dll \
tests all.dsp clean_dist.pl README \
- libsilc_static libsilcclient_static
+ libsilc_static
include $(top_srcdir)/Makefile.defines.in