Created SILC Runtime Toolkit git repository Part II.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 26 Jan 2008 19:29:28 +0000 (21:29 +0200)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 26 Jan 2008 19:29:28 +0000 (21:29 +0200)
Added lib/silcutil/silcruntime.h.in, the file that is the main include
file for application programmers.

Added includes/silcompile.h which is included only during compilation
of the Runtime Toolkit.

Changed all files to use the silcruntime.h instead of silc.h header
file.

Made the many other changes in makefiles, configuration scripts and
other files to try to complete the creation of the Runtime git
repository.

100 files changed:
.gitignore
CHANGES.RUNTIME
Makefile.ad
Makefile.defines_int.in
TODO
apps/Makefile.ad
configure.ad
distdir/autodist.conf [new file with mode: 0644]
distdir/client [deleted file]
distdir/default
distdir/post-dist
distdir/runtime [new file with mode: 0644]
distdir/server [deleted file]
includes/silc.h.in
includes/silccompile.h [new file with mode: 0644]
lib/.gitignore
lib/Makefile.ad
lib/Makefile.runtime.ad [new file with mode: 0644]
lib/configure.ad [deleted file]
lib/contrib/stringprep.h
lib/silcutil/.gitignore
lib/silcutil/DIRECTORY
lib/silcutil/Makefile.ad
lib/silcutil/silcasync.c
lib/silcutil/silcbase64.c
lib/silcutil/silcbitops.c
lib/silcutil/silcbuffer.h
lib/silcutil/silcbuffmt.c
lib/silcutil/silcconfig.c
lib/silcutil/silcconfig.h
lib/silcutil/silcdll.c
lib/silcutil/silcenv.c
lib/silcutil/silcenv.h
lib/silcutil/silcerrno.c
lib/silcutil/silcfdstream.c
lib/silcutil/silcfileutil.c
lib/silcutil/silcfileutil.h
lib/silcutil/silcfsm.c
lib/silcutil/silcgetopt.c
lib/silcutil/silchashtable.c
lib/silcutil/silclog.c
lib/silcutil/silcmemory.c
lib/silcutil/silcmime.c
lib/silcutil/silcmime.h
lib/silcutil/silcnet.c
lib/silcutil/silcregex.c
lib/silcutil/silcregex.h
lib/silcutil/silcschedule.c
lib/silcutil/silcschedule.h
lib/silcutil/silcsnprintf.c
lib/silcutil/silcsocketstream.c
lib/silcutil/silcsocketstream.h
lib/silcutil/silcstack.c
lib/silcutil/silcstack.h
lib/silcutil/silcstream.c
lib/silcutil/silcstream.h
lib/silcutil/silcstringprep.c
lib/silcutil/silcstrutil.c
lib/silcutil/silcstrutil.h
lib/silcutil/silcthread.c
lib/silcutil/silctime.c
lib/silcutil/silctimer.c
lib/silcutil/silctypes.h
lib/silcutil/silcutf8.c
lib/silcutil/silcutil.c
lib/silcutil/stacktrace.c
lib/silcutil/symbian/.gitignore
lib/silcutil/tests/Makefile.am
lib/silcutil/tests/test_silcasync.c
lib/silcutil/tests/test_silcatomic.c
lib/silcutil/tests/test_silcbitops.c
lib/silcutil/tests/test_silcbuffmt.c
lib/silcutil/tests/test_silcdir.c
lib/silcutil/tests/test_silcdll.c
lib/silcutil/tests/test_silcenv.c
lib/silcutil/tests/test_silcfdstream.c
lib/silcutil/tests/test_silcfsm.c
lib/silcutil/tests/test_silchashtable.c
lib/silcutil/tests/test_silclist.c
lib/silcutil/tests/test_silcmime.c
lib/silcutil/tests/test_silcmutex.c
lib/silcutil/tests/test_silcnet.c
lib/silcutil/tests/test_silcregex.c
lib/silcutil/tests/test_silcschedule.c
lib/silcutil/tests/test_silcstack.c
lib/silcutil/tests/test_silcstringprep.c
lib/silcutil/tests/test_silcstrutil.c
lib/silcutil/tests/test_silcthread.c
lib/silcutil/tests/test_silctime.c
lib/silcutil/tests/test_silctimer.c
lib/silcutil/unix/.gitignore
lib/silcutil/unix/silcunixdir.c
lib/silcutil/unix/silcunixnet.c
lib/silcutil/unix/silcunixschedule.c
lib/silcutil/unix/silcunixsocketstream.c
lib/silcutil/unix/silcunixthread.c
lib/silcutil/unix/silcunixutil.c
lib/silcutil/win32/.gitignore
srt.m4
win32/Makefile.am

index 4c10a89fb69fd6ba5276b3298be9c464fa4152de..67ff1f2f829a740aa9d4aa1bcdd309847b829066 100644 (file)
@@ -1,3 +1,7 @@
+.gitignore
+autodist.dist
+autodist.log
+makedist.log
 Makefile
 Makefile.defines
 Makefile.defines_int
@@ -14,12 +18,13 @@ config.status
 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
index d62f668f5e9d20e3a654f3c9b4f471706bdf8094..5be15e2608f43d11473dc02fe723b914e598bf3c 100644 (file)
@@ -1,3 +1,8 @@
+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].
@@ -362,4 +367,4 @@ Mon Jul  2 17:13:51 EEST 2007  Pekka Riikonen <priikone@silcnet.org>
 
 -----------------------------------------------------------------------------
 
-For older changes please see the CHANGES file from the CVS tree.
+For older changes please see the CHANGES file from the GIT tree.
index e7dacff6ace2a8de2956e5997ad740dd20415011..611d85aec05797366925d7cddaa08a866d56ee50 100644 (file)
 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
index 8d639153c575d373b8e57a9bed8c4e411996137f..92fd95cd1041f39b136560d571b8ce1aa53e5a53 100644 (file)
@@ -30,7 +30,7 @@ silc_install_prefix=@prefix@
 # 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
@@ -57,4 +57,4 @@ mandir = $(DESTDIR)@mandir@
 #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
diff --git a/TODO b/TODO
index 9ae2702568d95075169fb8a366e0b8448ea3fefe..4a432c6782316fd6ed3e236daa8233ea87dc7fa7 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,5 @@
-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
@@ -38,61 +38,15 @@ General
    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.
@@ -211,347 +165,3 @@ lib/silcutil/symbian/
    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.
index 4c8d26d6b6d8f0bd2ea735047ce95fc16bf91baa..42c6b686b5006fd23ad839b33e2fefa7c81742bf 100644 (file)
 
 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 =
index a162625abcec1e1d736b10ac98c1d637e88310d4..3fad742985fb10bc4978605984b66e60ca0c8a97 100644 (file)
@@ -29,30 +29,81 @@ AC_PROG_EGREP
 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
@@ -94,11 +145,11 @@ case "$host_cpu" in
     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)
@@ -107,11 +158,11 @@ case "$host_cpu" in
     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
@@ -120,11 +171,11 @@ case "$host_cpu" in
     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
@@ -142,82 +193,67 @@ AM_CONDITIONAL(SILC_X86_64, test x$cpu_x86_64 = xtrue)
 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
@@ -231,14 +267,15 @@ AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
 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)
@@ -254,24 +291,90 @@ AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
 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)
@@ -281,8 +384,7 @@ AC_CHECK_FUNCS(setgroups initgroups nl_langinfo nanosleep)
 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])
@@ -290,154 +392,50 @@ AC_CHECK_FUNC(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(
@@ -538,400 +536,324 @@ if test x$va_copy = xfalse; then
   )
 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"
@@ -1110,8 +1032,7 @@ if test x$has_iconv = xtrue; then
   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]]],
@@ -1264,216 +1185,83 @@ if test x$has_threads = xtrue; then
   __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"
@@ -1486,37 +1274,8 @@ echo " sbin directory ................: $s_sbindir"
 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
@@ -1533,11 +1292,19 @@ else
 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
@@ -1547,4 +1314,3 @@ echo " Multi-threads support .........: $threads"
 echo " Debugging enabled .............: $summary_debug"
 echo ""
 echo "Compile the sources with 'make' or 'gmake' command."
-#endif SILC_DIST_COMPILER
diff --git a/distdir/autodist.conf b/distdir/autodist.conf
new file mode 100644 (file)
index 0000000..207e228
--- /dev/null
@@ -0,0 +1,49 @@
+# 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"
diff --git a/distdir/client b/distdir/client
deleted file mode 100644 (file)
index 4ad2f05..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-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
index 87acf3476a0fef29a554df16ac74be6efa8812c6..3ca6c68d0173f2334084cc0960f0f0fa5e6179e9 100644 (file)
@@ -8,18 +8,6 @@
 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
index c026866e1abbe260c59e36bea4bf3c4e3702fafe..cf1f93bdc670098ac3fc24250688dfee898ee5c3 100644 (file)
@@ -6,9 +6,8 @@ package=$3
 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
-
diff --git a/distdir/runtime b/distdir/runtime
new file mode 100644 (file)
index 0000000..e0ec673
--- /dev/null
@@ -0,0 +1,29 @@
+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
diff --git a/distdir/server b/distdir/server
deleted file mode 100644 (file)
index 4734b30..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-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
index c64d33b8a9e483b767703723d764e0e767666e22..f573e3d3df83587b3649406cc635c745d59c61ca 100644 (file)
 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@
 
diff --git a/includes/silccompile.h b/includes/silccompile.h
new file mode 100644 (file)
index 0000000..9cd0378
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+
+  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 */
index a324157c2a5916a43fab93b2568b52d241d4cbae..a501f929e844b99a5df69d6b3df47a773f7b5a1e 100644 (file)
@@ -1,3 +1,8 @@
 Makefile
-Makefile.in
-Makefile.am
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
index 9f3cb4671acfe2071bbb4107c951ee8275c2210c..0fbdfd86a58e8d028368792db8f67d422c50ee1a 100644 (file)
@@ -3,7 +3,7 @@
 #
 #  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
diff --git a/lib/Makefile.runtime.ad b/lib/Makefile.runtime.ad
new file mode 100644 (file)
index 0000000..c71f102
--- /dev/null
@@ -0,0 +1,83 @@
+#
+#  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
diff --git a/lib/configure.ad b/lib/configure.ad
deleted file mode 100644 (file)
index d9b6ba3..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-#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
index 84349cab5123f4f54e1ebaede83dd93618c174de..b610dbb5534c55f4a16c5ff5fcb1ec98fbbf5ca3 100644 (file)
@@ -30,7 +30,7 @@ extern "C"
 #include <stddef.h>            /* size_t */
 #include <stdlib.h>
 
-#include "silc.h"
+#include "silcruntime.h"
 
 #ifndef uint32_t
 #define uint32_t SilcUInt32
index 282522db0342d8750454b3dc162493b5fc709cc8..a501f929e844b99a5df69d6b3df47a773f7b5a1e 100644 (file)
@@ -1,2 +1,8 @@
 Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
index 436bec94080c2ec0e94b50c07839075c4c90e3d6..daf3fb791cc5c0ea46e2a1666ec0c7f9f8482005 100644 (file)
@@ -1,6 +1,7 @@
 <!--
-@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
@@ -35,7 +38,7 @@
 @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 />
index 8e86f36b721d3e5b9562664d42883de8bd957492..3456e38d37d7cff1f1730df5d0da39c36bd8128b 100644 (file)
@@ -3,7 +3,7 @@
 #
 #  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
@@ -23,26 +23,14 @@ else
 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
 
@@ -77,9 +65,9 @@ libsilcutil_la_SOURCES = \
        silcbitops.c    \
        silcerrno.c     \
        silcgetopt.c    \
-       silcregex.c
+       silcregex.c     \
+       silcthreadqueue.c
 
-#ifdef SILC_DIST_TOOLKIT
 include_HEADERS =      \
        $(SILC_DIST_HEADER) \
        silcbuffer.h    \
@@ -128,10 +116,10 @@ include_HEADERS = \
        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)
 
index 216e30af0fe57ec8ed91f3d1c93972ed6803902c..09d3d1cf9fee54591e494bd9876cfec803f98667 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Halts async operation */
 
index ba9b2c8de95f20f8cf1e6b52c19149ab0473a43b..17d199d45ebc5c5ef9ec5377af419116f03ac267 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 static unsigned char pem_enc[64] =
 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
index 405ed539b5f7535b55620c21313d02e924f3c8a3..dfb9dea6db87eeb52f8ceb81035e5235ed2065e6 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#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))
index dc9d405cdb51ea3b0714179ab9261c2b1e16fed6..6083fbb83f99d8b0fb603bc2d7ea373fb5541f03 100644 (file)
@@ -16,7 +16,7 @@
   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
  *
index 6534696384896110510b0844fa623379fb38f49b..944841d4f284896fdaccf805126ba8f1319b13a2 100644 (file)
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************** Types and definitions ***************************/
 
@@ -180,7 +179,7 @@ int silc_buffer_sformat_vp_i(SilcStack stack, SilcBuffer dst, va_list ap,
     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;
@@ -284,7 +283,7 @@ int silc_buffer_sformat_vp_i(SilcStack stack, SilcBuffer dst, va_list ap,
 
        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;
@@ -669,7 +668,7 @@ int silc_buffer_sunformat_vp_i(SilcStack stack, SilcBuffer src, va_list ap,
     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;
index 55524a32077ce3919cac0be5edfbe353dc7d6b08..0568bd42eb04ce8b0b458c3fa3c7db30866f1fb6 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* limit debug logging verbosity */
 #if 0
index c58bd28a32c4cbe6901036814126c4c697146324..4d4be4252bcb9b57b2a00ef17ff12f73c39619ed 100644 (file)
  *
  * 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
index 59ca44d50b778af146017d794194294f96567d36..2c5de41d5c07748cf270da59523419b8f83f1ae1 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Load shared object */
 
@@ -48,7 +48,9 @@ SilcDll silc_dll_load(const char *object_path)
 void silc_dll_close(SilcDll dll)
 {
 #ifdef SILC_UNIX
+#if defined(HAVE_DLOPEN)
   dlclose(dll);
+#endif /* HAVE_DLOPEN */
 #elif SILC_WIN32
   FreeLibrary(dll);
 #else
@@ -61,7 +63,9 @@ void silc_dll_close(SilcDll dll)
 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
@@ -77,7 +81,9 @@ void *silc_dll_getsym(SilcDll dll, const char *symbol)
 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
index fda4849058d83213f30586b857bbfa49f14a9ecc..fe50269d030b102dae660812c9c2a9cad7ed645f 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Set environment variable with value */
 
index f8474c6c4e562c41538f0467c48a2995910ce03b..97dd663043cf019f7de0627bbc386cfd96ee965d 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -90,5 +90,4 @@ SilcBool silc_unsetenv(const char *variable);
  ***/
 SilcBool silc_clearenv(void);
 
-
 #endif /* SILCENV_H */
index 5f415e94aa3fccf3ceea959bd629a6328ca10410..c8245c647e6b330fc127d219e21fcb41b8f153da 100644 (file)
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Get last error */
 
@@ -44,8 +44,6 @@ void silc_set_errno(SilcResult error)
       return;
   }
 
-  SILC_LOG_DEBUG(("Error: %s (%d)", silc_errno_string(error), error));
-
   tls->error_reason[0] = '\0';
   tls->error = error;
 }
@@ -59,8 +57,6 @@ void silc_set_errno_nofail(SilcResult error)
   if (!tls)
     return;
 
-  SILC_LOG_DEBUG(("Error: %s (%d)", silc_errno_string(error), error));
-
   tls->error_reason[0] = '\0';
   tls->error = error;
 }
@@ -83,9 +79,6 @@ void silc_set_errno_reason(SilcResult error, const char *format, ...)
   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;
 }
 
@@ -103,9 +96,6 @@ void silc_set_errno_reason_nofail(SilcResult error, const char *format, ...)
   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;
 }
 
index ea043f2bec1b57945e7119b77bcde8e1ff0f3139..5ba65ba99b8c4c36105df0c40f51ea377f029d35 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************** Types and definitions ***************************/
 
index ea48479bde029971bfc15d6e37d695f73545031c..a4b9739c2075fb040d10a5759e11f0147ff68c0d 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   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'. */
index b3b0312c31b14cac69ea23e78f411bf9657dfc7c..a02c49b3a3126a56982f7ea234dacf3c0a33c2ca 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -21,8 +21,8 @@
  *
  * 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.
  *
  ***/
 
index 2ded983253aa77906cd439210b69306afe92116c..bbd297a04fcce2c78b6188aefa387e7f356ee66c 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 SILC_TASK_CALLBACK(silc_fsm_run);
 SILC_TASK_CALLBACK(silc_fsm_finish_fsm);
index 569761766b10d7c0ed3824defdf6f3f0f062be72..32d4d8f68374889657fc1b98e50d83f082dfb100 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Getopt, like getopt(3). */
 
index 13c655e792160a6af32414ee3c2d65784fc6848e..f440be49488a7829153046ccaf58a79a0f60a87f 100644 (file)
@@ -4,7 +4,7 @@
 
   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
index d0bec0c1c4320c5e45cc7cec183f5614b0f4c6c9..18cff9a55b8b012f10ed40d073d5fc6102f46b9b 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* SilcLogSettings context */
 typedef struct {
index b7f69df850e64e33bca5d273d9a85f69f055ecf5..f57ff458d51ad70d00053dc3ec1ffaa794c4fb78 100644 (file)
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 #ifndef SILC_STACKTRACE
 
index 839eb354b9ea6841c129d104e765f184588a6b69..293393bc8a1b85e1ef2cc062b1e5e0289718614a 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************** Types and definitions ***************************/
 
index 664b526a06adbaaa137947327282a30b437c5edc..3b22e6184623051c1ccb2db8bfc6472a996a3d98 100644 (file)
  *
  * 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.
  *
  ***/
index edd982a6ccfed5b7e50bc2c42320835c5002b9e2..5c6dadb06beeed621903b241d5dc0608a1f5708c 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Returns bound port from listener */
 
@@ -112,7 +111,7 @@ int silc_net_set_socket_opt(int sock, int level, int option, int on)
 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;
@@ -383,7 +382,8 @@ SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname,
                                     char **ip)
 {
   char host[1024];
-  int rval, len;
+  int rval;
+  unsigned int len;
 
 #ifdef HAVE_IPV6
   struct sockaddr_storage remote;
@@ -462,7 +462,8 @@ SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname,
                                      char **ip)
 {
   char host[1024];
-  int rval, len;
+  int rval;
+  unsigned int len;
 
 #ifdef HAVE_IPV6
   struct sockaddr_storage local;
@@ -540,7 +541,7 @@ SilcUInt16 silc_net_get_remote_port(SilcSocket sock)
 {
 #ifdef HAVE_IPV6
   struct sockaddr_storage remote;
-  int len;
+  unsigned int len;
   char s[NI_MAXSERV];
 
   memset(&remote, 0, sizeof(remote));
@@ -555,7 +556,7 @@ SilcUInt16 silc_net_get_remote_port(SilcSocket sock)
   return atoi(s);
 #else
   struct sockaddr_in remote;
-  int len;
+  unsigned int len;
 
   memset(&remote, 0, sizeof(remote));
   len = sizeof(remote);
@@ -572,7 +573,7 @@ SilcUInt16 silc_net_get_local_port(SilcSocket sock)
 {
 #ifdef HAVE_IPV6
   struct sockaddr_storage local;
-  int len;
+  unsigned int len;
   char s[NI_MAXSERV];
 
   memset(&local, 0, sizeof(local));
@@ -587,7 +588,7 @@ SilcUInt16 silc_net_get_local_port(SilcSocket sock)
   return atoi(s);
 #else
   struct sockaddr_in local;
-  int len;
+  unsigned int len;
 
   memset(&local, 0, sizeof(local));
   len = sizeof(local);
index dba552b7e34b9fb976fcc9b893b6dec6d18a0267..8444969560c561eca7c4cc046e15a2226b142371 100644 (file)
@@ -36,7 +36,7 @@
   - SilcStack support         compile/match without real memory allocations
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 #define RE_NREGS       128     /* number of registers available */
 
@@ -2315,7 +2315,7 @@ SilcBool silc_regex_compile(SilcRegex regexp, const char *regex,
     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);
 
@@ -2359,8 +2359,8 @@ SilcBool silc_regex_match(SilcRegex regexp, const char *string,
     f |= RE_NOTEOL;
 
   /* Search */
-  ret = silc_re_search(regexp, (char *)string, string_len, 0, string_len,
-                      num_match ? &regs : NULL, f);
+  ret = silc_re_search(regexp, (unsigned char *)string, string_len, 0,
+                      string_len, num_match ? &regs : NULL, f);
   if (ret < 0) {
     if (ret == -1)
       silc_set_errno(SILC_ERR_NOT_FOUND);
index 4047088f8a6767ac10899b2ed6c7f4522c1b8aae..8b5a66544f26fd3893bb2c3717110eabae1c6d94 100644 (file)
@@ -370,6 +370,11 @@ SilcBool silc_regex_buffer(SilcBuffer buffer, const char *regex,
  *    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);
 
index 5550181a7da686d070e2103a6a1d8ac33140e9dd..bb9c19f26178b1d3f76f01eccb1f40a90828ad06 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************** Types and definitions ***************************/
 
@@ -227,13 +226,15 @@ static void silc_schedule_task_remove(SilcSchedule schedule, SilcTask task)
 
     /* 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;
   }
 
@@ -880,10 +881,12 @@ SilcBool silc_schedule_task_del(SilcSchedule schedule, SilcTask task)
 
     /* 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;
index c3120181464b75be38a703e8c48666c7e632591c..9cb47540e54b7cd9f6aee6f8da5108385e253d6d 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -57,7 +57,8 @@
  * 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.
  *
  ***/
 
index d49b6d1fa85df441aef677f93d99f3340432b281..120ab0271b2600ebf767b004f7ba63337e08362b 100644 (file)
@@ -55,7 +55,7 @@
  *
  **************************************************************/
 
-#include "silc.h"
+#include "silcruntime.h"
 
 #ifdef HAVE_LONG_DOUBLE
 #define LDOUBLE long double
index e11fff73a5a5b29fdd1922b6d1b2b60476fedc97..7f61e51865a6203b3f70b10ca4f281871d955e55 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************** Types and definitions ***************************/
 
index 46cce4faede773f7accd4678d7eceab457d746f6..ad7ce71d18911925fd5a64ac666e00a073ee3379 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -230,7 +230,7 @@ SilcBool silc_socket_stream_set_info(SilcStream stream,
  *    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.
  *
  ***/
index 3fd06d331459680cefa66328ccdb735500c6f866..6a2d5d6b107fa9c56574e44bee507d5962319b9b 100644 (file)
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************** Types and definitions ***************************/
 
index f2663eef949e4b37b8774b9391d85ca56a301d48..0a41e6ba2fa5e2f057aa7ccde70deb15870157d7 100644 (file)
@@ -21,7 +21,7 @@
  *
  * 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
@@ -163,7 +163,7 @@ void silc_stack_free(SilcStack stack);
  *
  * 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
@@ -223,8 +223,8 @@ SilcUInt32 silc_stack_push(SilcStack stack, SilcStackFrame *frame);
  *
  * 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
@@ -295,7 +295,8 @@ void *silc_stack_malloc(SilcStack stack, SilcUInt32 size);
  * 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,
index af4789dfeeb495054b71c3f72137a55038b91ba9..5e01ad398ddde01047a1ddf9b71ebc6d4b51e589 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 typedef struct {
   SilcStreamOps *ops;
index 85364d2a08cd316127ffeedd689738e99736f52d..d88efa9243a05e2e0182d64fb289cbdafeacce19 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -26,6 +26,9 @@
  * 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.
index b1716cc501f0c783042b34a4e2ceb6db16882324..96cc9cbd7245a73b44b493d8869ceb20f25b0d6b 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,8 +17,7 @@
 
 */
 
-#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
index 3251c2b0a4d47c43255ca71746e17cf899ffedb4..f13233e0aef2e173441f3476b92f3f3bea7d6a74 100644 (file)
@@ -4,7 +4,7 @@
 
   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
index bc692975259bc59632b126fa4b7556d720482ea8..2caeb4c7f50b4eff9c1d4c6c140e3e58d80fd79f 100644 (file)
@@ -21,9 +21,7 @@
  *
  * DESCRIPTION
  *
- * String manipulation utility routines.  These routines provides
- * various helper functions for encoding, decoding and otherwise
- * managing strings.
+ * Various string utility routines.
  *
  ***/
 
index 8e51a15d13ef4c182382cf029f3b0f41512c3deb..aad875a000091b862e219b967cafa905fa674018 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /***************************** Thread Pool API *****************************/
 
index 4dc7f2172ec5470d0a78ff4736aefa5e38d2ffba..37444269efd4ce08ed2d0b7bea4bc39bd06a9710 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Fills the SilcTime structure with correct values */
 
index 0313a3158698f8a7ea502cc688ad10311e07d6dd..049341b77d8df6c9df51306f81969ee54dc6e26e 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /* Start timer */
 
index 08b0532032b6d67eb06401239c4cc5c79c9777bb..8cbb20d0e77dd0bb5027460623341f3f13c04336 100644 (file)
@@ -255,7 +255,7 @@ typedef SilcUInt32 * void *;
  *    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
  */
index 8bbb5ece2a23d8242835b07032af9af47c4d649c..617c3d475327d177abf2a16204915e2d7181926d 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,8 +17,7 @@
 
 */
 
-#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'.
@@ -508,7 +507,7 @@ SilcUInt32 silc_utf8_decode(const unsigned char *utf8, SilcUInt32 utf8_len,
              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;
index 75e85f933fbecc049e1251b132f6b338714590d2..0d6498f390e954a86457237ac52f92ee7f23d377 100644 (file)
@@ -20,9 +20,8 @@
  * 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
@@ -256,14 +255,14 @@ char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len)
     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)
@@ -271,7 +270,7 @@ char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len)
   if ((i + 1) % 2 == 0)
     *(--cp) = '\0';
 
-  return fingerprint;
+  return (char *)fingerprint;
 }
 
 /* Return TRUE if the `data' is ASCII string. */
index 9f335e44258dffe481751c37de03a3fb05a2a61d..e1563415de8735a275799052d2a66af25b345b53 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 #ifdef SILC_STACKTRACE
 
index 282522db0342d8750454b3dc162493b5fc709cc8..a501f929e844b99a5df69d6b3df47a773f7b5a1e 100644 (file)
@@ -1,2 +1,8 @@
 Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
index 94f01274a7d7c5fc8191e9bc64e57fc6041cddc1..e4997279f5a3b872b4e50d485bc90111aeaa710a 100644 (file)
@@ -3,7 +3,7 @@
 #
 #  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
index 92ff6669157fbb2cd22aa91fec59c3c5f6751d41..7e8be9e38fde4b46e76c021cb897c428ec2cd43f 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcAsyncOperation tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 #include "silcfsm.h"
 #include "silcasync.h"
 
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
   }
 
   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)
@@ -154,5 +154,5 @@ 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;
 }
index 59637427bbeac05c8ec241dd7f26ee1a50725988..f1f998720f9240457ed245fd0bb51d287ff6a9d5 100644 (file)
@@ -1,7 +1,6 @@
 /* atomic operation tests */
 
-#include "silc.h"
-#include "silcatomic.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
@@ -115,5 +114,5 @@ 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;
 }
index 0c5b1e6eb599a1d946233d3385a327c26e0977ba..80fb00f0ac12a60c9b0d61cea17e7b03cb711b79 100644 (file)
@@ -1,6 +1,6 @@
 /* Bit operation tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
@@ -134,5 +134,5 @@ 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;
 }
index 44bac0ac44de196c4929678c46d849352650d9a9..6e856e974e743e1b7f102104d18d0b224e172002 100644 (file)
@@ -1,6 +1,6 @@
 /* Buffer formatting tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int print(SilcStack stack, SilcBuffer buf, void *value, void *context)
 {
@@ -153,5 +153,5 @@ 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;
 }
index e9e369418cc7011cae3eb7e4a51acac6b22ebb7c..151aad67862aaf4626da4551f54e8f94f2eac2a9 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcDir tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
@@ -49,5 +49,5 @@ 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;
 }
index e4c3b9ebd70e869482dfcadcf59a36553fe4a65d..a9805cff1b173eb525906540a0d5c2805a1b8b6c 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcDll tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
@@ -17,6 +17,8 @@ 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;
@@ -37,5 +39,5 @@ 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;
 }
index bd56d9373be0b4fb7e094446a296f540119617ec..52a5e81e9fc3f5aff594572077470fed6fcc47cb 100644 (file)
@@ -1,6 +1,6 @@
 /* environment tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
@@ -21,14 +21,9 @@ 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;
 }
index dfc231733b92040517a864e970f4f1dac5c205b6..c3c3b99c431013e2351839d8cd6d87a8cfd3d535 100644 (file)
@@ -1,6 +1,6 @@
 /* SILC FD Stream tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 SilcBool success = FALSE;
 SilcSchedule schedule;
@@ -203,7 +203,7 @@ int main(int argc, char **argv)
   }
 
   SILC_LOG_DEBUG(("Allocating scheduler"));
-  schedule = silc_schedule_init(0, NULL, NULL);
+  schedule = silc_schedule_init(0, NULL, NULL, NULL);
   if (!schedule)
     goto err;
 
@@ -227,5 +227,5 @@ 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;
 }
index 782165f65c7ea09298259afa8ee40ca9e96487f1..8cfda2dcc570c44df26fb5fff872a4fe024c8534 100644 (file)
@@ -1,6 +1,6 @@
 /* SILC FSM tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 #include "silcfsm.h"
 
 typedef void (*Callback)(void *context);
@@ -454,7 +454,7 @@ int main(int argc, char **argv)
   }
 
   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)
@@ -482,5 +482,5 @@ 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;
 }
index 742b372872c9e7172f21b9e8c26d450110946390..2ee6ddbbf8089bb8ec97bbffa4ab9c0230762303 100644 (file)
@@ -1,6 +1,6 @@
 /* Hash table tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 typedef struct entry_struct {
   char name[8];
@@ -313,5 +313,5 @@ 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;
 }
index f0783f37473774c858a1b01a22332c6bd07a14b2..9efff72a047f6574d1ea50e2a3014456e2e77aec 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcList tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 struct foo {
   int i;
@@ -42,11 +42,11 @@ int main(int argc, char **argv)
   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;
@@ -55,11 +55,11 @@ int main(int argc, char **argv)
   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;
@@ -68,7 +68,7 @@ int main(int argc, char **argv)
   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));
   }
 
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
 
   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));
   }
 
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
   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));
   }
 
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
   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));
   }
 
@@ -116,24 +116,24 @@ int main(int argc, char **argv)
   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));
   }
 
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
 
   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));
   }
 
@@ -151,7 +151,7 @@ int main(int argc, char **argv)
 
   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));
   }
 
@@ -161,5 +161,5 @@ 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;
 }
index d3b7d35d9fe956a74dc03d51087c703eb11b8760..5cf38bd82a8f4791b15f6223f8d7b613cb68484d 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcMime tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 #include "silcmime.h"
 
 int main(int argc, char **argv)
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
     silc_log_set_debug_string("*mime*,*errno*");
   }
 
-  /* 
+  /*
    * Simple MIME test
    */
   SILC_LOG_DEBUG(("Allocating MIME message context"));
@@ -279,5 +279,5 @@ 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;
 }
index ffe17bd66762e2b6f8807a8fe2f2628207f05f6d..e52e1aafa6e739cac0f0df25987039ce2c2a0468 100644 (file)
@@ -1,7 +1,7 @@
 /* Locking performance tests.  Gives locsk&unlocks/second. */
 /* Version 1.0 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 typedef struct {
   SilcThread thread;
@@ -84,6 +84,7 @@ int main(int argc, char **argv)
   sleep(1);
   val = rdtsc() - val;
   val /= 1000;                 /* Gives us milliseconds */
+  cpu_freq = val;
   fprintf(stderr, "CPU frequency: %llu\n", val);
 
   max_locks = MAX_LOCKS;
@@ -179,5 +180,5 @@ int main(int argc, char **argv)
 
   fprintf(stderr, "Testing was %s\n", success ? "SUCCESS" : "FAILURE");
 
-  return success;
+  return !success;
 }
index 7b1551cebbd5859dba12740319c92f6e98407735..d478ed588c7c6e0d208e6bb1cc9897b0331c304b 100644 (file)
@@ -1,6 +1,6 @@
 /* SILC Net API tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 SilcSchedule schedule;
 
@@ -203,7 +203,7 @@ int main(int argc, char **argv)
   }
 
   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)
@@ -231,5 +231,5 @@ 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;
 }
index c1c6b44b8093c297f872242d423ef2bb4d7dd816..c0e970c01fa86fe31ac896ff84532ca545c5729e 100644 (file)
@@ -1,6 +1,6 @@
 /* Regex tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
@@ -612,5 +612,5 @@ 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;
 }
index 28d2563245557ca800dc30ee7a764cd3a3553245..216f14e60a03125713a62276438b24515308b95b 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcSchedule tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 typedef void (*Callback)(void *context);
 
@@ -41,7 +41,7 @@ SILC_TASK_CALLBACK(timeout)
 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));
@@ -50,6 +50,8 @@ SILC_TASK_CALLBACK(cont2)
   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)
@@ -57,7 +59,7 @@ 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));
@@ -185,5 +187,5 @@ 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;
 }
index 34b6fc3fead140a024985a44912668bea998d2cd..00d65b1506a5482882bf81fc6dfd34d4b30903ad 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcStack tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 #define NUM_ALLS 300
 
@@ -22,13 +22,17 @@ int main(int argc, char **argv)
   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);
@@ -37,7 +41,9 @@ int main(int argc, char **argv)
   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))
@@ -47,10 +53,14 @@ int main(int argc, char **argv)
     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))
@@ -60,10 +70,14 @@ int main(int argc, char **argv)
     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++) {
@@ -73,11 +87,15 @@ int main(int argc, char **argv)
     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;
@@ -88,10 +106,14 @@ int main(int argc, char **argv)
     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);
@@ -105,11 +127,15 @@ int main(int argc, char **argv)
     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;
@@ -121,13 +147,21 @@ int main(int argc, char **argv)
       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);
@@ -141,11 +175,15 @@ int main(int argc, char **argv)
     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;
@@ -159,19 +197,31 @@ int main(int argc, char **argv)
   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"));
@@ -203,5 +253,5 @@ 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;
 }
index 82fc8ca2cf8bee216c6926c69ca93c170e50ce3a..ff56171feaa5a63a496fec31c7dd4c3c039d50f4 100644 (file)
@@ -1,6 +1,6 @@
 /* Stringprep tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 typedef struct {
   const char *comment;
@@ -30,7 +30,7 @@ const test_st tests[] = {
   {"Locale test",
    "Päivää", "päivää", 0, SILC_STRING_LOCALE},
   {"Locale test2",
-   "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'", 
+   "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'",
    "#öäöö/&#\\#(&(&#(.äöääöääöäö^'", 0, SILC_STRING_LOCALE},
 
   /* Some libidn tests */
@@ -64,7 +64,7 @@ const test_st tests_norm[] = {
   {"Locale test",
    "Päivää", "päivää", 0, SILC_STRING_LOCALE},
   {"Locale test2",
-   "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'", 
+   "#öäöö/&#\\#(&(&#(.äöäÄÖäÄÖÄÖ^'",
    "#öäöö/&#\\#(&(&#(.äöääöääöäö^'", 0, SILC_STRING_LOCALE},
 };
 
@@ -163,5 +163,5 @@ 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;
 }
index a728dfd5f16c5f2606cf61357417c81e09835835..33bfc6215133047e8422d36c7704d152ab58576b 100644 (file)
@@ -1,7 +1,7 @@
 /* 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);           \
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
   /* 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));
@@ -139,13 +139,13 @@ int main(int argc, char **argv)
   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);
 
@@ -192,5 +192,5 @@ 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;
 }
index da078b3e8af34b79a7bfa783b79e08720bb149ec..75546654c0303eabee2af9bb02ef6aeaa560a026 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcThreadPool tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 SilcSchedule schedule;
 
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
     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;
 
@@ -103,5 +103,5 @@ 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;
 }
index d269eb60fccf550fb1683870a3f2ecaa0acc24b2..822899019393d2ee190756293556152a002e9e3e 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcTime tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 int main(int argc, char **argv)
 {
@@ -41,5 +41,5 @@ 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;
 }
index e0646cf7bd78a5567113121352014328456600be..f23957565e45d1e73f9d7d54cab9997a84dfa672 100644 (file)
@@ -1,6 +1,6 @@
 /* SilcTimer tests */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 SilcSchedule schedule;
 SilcTimerStruct timer;
@@ -40,9 +40,9 @@ SILC_TASK_CALLBACK(check)
     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);
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
     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;
 
@@ -90,5 +90,5 @@ 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;
 }
index 282522db0342d8750454b3dc162493b5fc709cc8..a501f929e844b99a5df69d6b3df47a773f7b5a1e 100644 (file)
@@ -1,2 +1,8 @@
 Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
index 9d8d1b163a90d38712dce37c8d877548df8b0c2c..49de3079fd59ffa4d33cb2486524a6e55af9c38b 100644 (file)
@@ -17,7 +17,7 @@
 
 */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************** Types and definitions ***************************/
 
@@ -42,7 +42,7 @@ SilcDir silc_dir_open(const char *name)
 {
   SilcDir dir;
 
-  if (!name || !strlen(!name)) {
+  if (!name || !strlen(name)) {
     silc_set_errno(SILC_ERR_INVALID_ARGUMENT);
     return NULL;
   }
index 15720dcd53691f8903f6141776aaf7ac636fbb7f..f18af24e4f8e961b859cfb0648fb80fac6b45c05 100644 (file)
@@ -4,7 +4,7 @@
 
   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 ***************************/
 
@@ -524,7 +522,8 @@ int silc_net_udp_receive(SilcStream stream, char *remote_ip_addr,
   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));
 
index d81cfa751668172aa9d3789a7a51c26bac0a473a..5626eef546ae4d8a82519d7aa8f1bb55e27d5762 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 #if defined(HAVE_EPOLL_WAIT)
 #include <sys/epoll.h>
index 86c8491a9e95fced746b6086aea981034fd96dbd..552fa611167d3326b0dfbaedf6926a20fcd8c859 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /************************ Static utility functions **************************/
 
index 1f13f6190035fb21786fd543a7e5c1fb695993ea..2a826251a2ae0825e73f535678e6002d1c9b89af 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -16,9 +16,8 @@
   GNU General Public License for more details.
 
 */
-/* $Id$ */
 
-#include "silc.h"
+#include "silcruntime.h"
 
 /**************************** SILC Thread API *******************************/
 
@@ -343,6 +342,7 @@ SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex,
 #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;
 
@@ -355,6 +355,7 @@ static void silc_thread_tls_alloc(void)
 {
   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)
@@ -379,6 +380,8 @@ SilcTls silc_thread_tls_init(void)
 
 SilcTls silc_thread_get_tls(void)
 {
+  if (!key_set)
+    return NULL;
   return pthread_getspecific(key);
 }
 
index ef608f92e54b699f18f489f2a0776040bc300b37..def4f1d783913b291909fbf9d0a8c820c8a9da07 100644 (file)
@@ -4,7 +4,7 @@
 
   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
@@ -17,7 +17,7 @@
 
 */
 
-#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. */
index 282522db0342d8750454b3dc162493b5fc709cc8..a501f929e844b99a5df69d6b3df47a773f7b5a1e 100644 (file)
@@ -1,2 +1,8 @@
 Makefile
-Makefile.in
+*.in
+*.am
+*.o
+*.lo
+*.la
+*.a
+*.pc
diff --git a/srt.m4 b/srt.m4
index 300f3035dd4ae72750c6ce9f8b9ee62bce5e638f..4a3c6119bf0fb020da35ae157d5d206e710f0c4b 100644 (file)
--- a/srt.m4
+++ b/srt.m4
@@ -1,9 +1,9 @@
 #
-#  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],
@@ -77,54 +77,71 @@ 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
index 8f4dc98ff9c851d19d8f10b7ee400f333cc50d77..26d56ef49ad0dedeebcda50c7e3f830286575a9b 100644 (file)
 
 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