From d5326035402d8326f0b84ddce79cb67dd27db740 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 13 May 2007 15:33:34 +0000 Subject: [PATCH] Aded Symbina support. Added new Carbide.c++ project files for compiling SILC Toolki for Symbian OS. --- CHANGES | 6 ++++ README.SYMBIAN | 62 +++++++++++++++++++++++------------ includes/silcsymbian.h | 20 +++++++---- symbian/bld.inf | 11 +++++++ symbian/silc.mmp | 41 +++++++++++++++++++++++ symbian/silc_static.mmp | 38 +++++++++++++++++++++ symbian/silcclient.mmp | 17 ++++++++++ symbian/silcclient_static.mmp | 14 ++++++++ symbian/silcdefs.h | 8 ++--- 9 files changed, 185 insertions(+), 32 deletions(-) create mode 100644 symbian/bld.inf create mode 100644 symbian/silc.mmp create mode 100644 symbian/silc_static.mmp create mode 100644 symbian/silcclient.mmp create mode 100644 symbian/silcclient_static.mmp diff --git a/CHANGES b/CHANGES index 9e7d93c5..5ddf1fde 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Sun May 13 18:27:13 EEST 2007 Pekka Riikonen + + * Fixed client library initialization when the running callback + is not given to silc_client_init. Affected file is + lib/silcclient/client.c. + Sun May 13 16:54:35 CEST 2007 Jochen Eisinger * Fix several warnings in Irssi's Makefiles. diff --git a/README.SYMBIAN b/README.SYMBIAN index 6093a905..84fe4dc9 100644 --- a/README.SYMBIAN +++ b/README.SYMBIAN @@ -9,14 +9,21 @@ target. The SILC Toolkit has not been tested with other compilers or build systems. The build environment expects MS Windows. +Requirements +============ + +- MS Windows +- Carbide.c++ 1.2 or newer + + Installing Build Environment ============================ If you do not have a working Carbide.c++ and Symbian OS SDK environment installed in your MS Windows system it needs to be done first. -1) Download the freely available Carbide.c++ Express from Nokia at - http://forum.nokia.com. The exact hyprelink location changes often, so +1) Download the freely available Carbide.c++ from Nokia at + http://forum.nokia.com. The exact hyperlink location changes often, so it is not referenced here. It is usually under "Tools and SDKs" link. 2) After installation a web browser is opened automatically by the @@ -37,22 +44,35 @@ installed in your MS Windows system it needs to be done first. Building with Carbide.c++ ========================= -After starting the Carbide.c++, you should import one of the SILC Toolkit -projects under symbian/ directory in the SILC Toolkit package. Four -projects exist: - - libsilc/ - SILC Core DLL - libsilcclient/ - SILC Client DLL - libsilc_static/ - SILC Core static library - libsilcclient_static/ - SILC Client static library - -After loading the project, the first thing to do is to add a path variable -to define where the SILC Toolkit sources are located. Go to Window -> -Preferences. Then, go to General -> Workspace -> Linked Resources. Add -a new SILCROOT path variable. It should point to the drive and directory -where the extracted SILC Toolkit sources are located. For example, if you -extracted the SILC Toolkit package into C:\temp\silc-toolkit-1.1.5 the -SILCROOT should point to C:\temp. This needs to be done only once. - -After that, the building is ready to begin. Choose the target you want -(emulator or device, debug or release version) and start building. +After starting the Carbide.c++ you will need to import the SILC Toolkit +project. Go to File -> Import -> Symbian OS -> Symbian OS Bld.inf file, +and go to the extracted SILC Toolkit source tree and find symbian/bld.inf +file and import it. When Carbide.c++ asks for the Root Directory, select +the root of the extracted SILC Toolkit source tree, if not already +selected. + +After importing the project it is immediately ready for building. By +default, it will build the following libraries: + + silc.dll - SILC Core DLL + silcclient.dll - SILC Client DLL + silc.lib - SILC Core static library + silcclient.lib - SILC Client static library + +Before building select the target for which you want to build. Possible +targets are Emulator or Phone with Debug or Release. + + +Using SILC Toolkit in Your Project +================================== + +When linking with SILC libraries your application will need to also link +the following Symbian libraries: + + estlib + euser + insock + esock + +You will also need to include the \epoc32\include\libc into your system +include path in your project, if not already included. diff --git a/includes/silcsymbian.h b/includes/silcsymbian.h index 396a1210..505a149c 100644 --- a/includes/silcsymbian.h +++ b/includes/silcsymbian.h @@ -6,14 +6,14 @@ Copyright (C) 2002 - 2006 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. + The contents of this file are subject to one of the Licenses specified + in the COPYING file; You may not use this file except in compliance + with 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. + The software distributed under the License is distributed on an "AS IS" + basis, in the hope that it will be useful, but WITHOUT WARRANTY OF ANY + KIND, either expressed or implied. See the COPYING file for more + information. */ /* Native Symbian specific includes and definitions. */ @@ -39,5 +39,11 @@ /* And just in case, include stddef.h here to get the Symbian one as early as possible. */ #include +#include +#include + +/* Some internal routines */ +void silc_symbian_usleep(long microseconds); +void silc_symbian_debug(const char *function, int line, char *string); #endif /* SILCSYMBIAN_H */ diff --git a/symbian/bld.inf b/symbian/bld.inf new file mode 100644 index 00000000..a7252292 --- /dev/null +++ b/symbian/bld.inf @@ -0,0 +1,11 @@ +PRJ_PLATFORMS +GCCE WINSCW + +PRJ_MMPFILES +silc.mmp +silc_static.mmp +silcclient.mmp +silcclient_static.mmp + +PRJ_TESTMMPFILES +test_silcnet.mmp diff --git a/symbian/silc.mmp b/symbian/silc.mmp new file mode 100644 index 00000000..c1b02bd2 --- /dev/null +++ b/symbian/silc.mmp @@ -0,0 +1,41 @@ +TARGETTYPE dll +TARGET silc.dll +VENDORID 0x12345678 + +UID 0x1deadbe1 0xdeadbe11 + +SYSTEMINCLUDE \epoc32\include \epoc32\include\libc \epoc32\include\variant . +CAPABILITY NONE +MACRO HAVE_SILCDEFS_H + +SOURCEPATH ..\lib\contrib +SOURCE getopti.c nfkc.c regexpr.c rfc3454.c stringprep.c +SOURCEPATH ..\lib\silcapputil +SOURCE silcapputil.c silcidcache.c +SOURCEPATH ..\lib\silcasn1 +SOURCE silcasn1.c silcasn1_decode.c silcasn1_encode.c silcber.c +SOURCEPATH ..\lib\silccore +SOURCE silcargument.c silcattrs.c silcauth.c silcchannel.c silccommand.c silcid.c silcmessage.c silcnotify.c silcpacket.c silcpubkey.c silcstatus.c +SOURCEPATH ..\lib\silccrypt +SOURCE aes.c blowfish.c cast.c md5.c none.c rc5.c rsa.c sha1.c sha256.c silccipher.c silchash.c silchmac.c silcpk.c silcpkcs.c silcpkcs1.c silcrng.c twofish.c +SOURCEPATH ..\lib\silchttp +SOURCE silchttpserver.c +SOURCEPATH ..\lib\silcmath +SOURCE modinv.c mp_tma.c mpbin.c silcprimegen.c tma.c +SOURCEPATH ..\lib\silcsftp +SOURCE sftp_client.c sftp_fs_memory.c sftp_server.c sftp_util.c +SOURCEPATH ..\lib\silcskr +SOURCE silcskr.c +SOURCEPATH ..\lib\silcutil +SOURCE silcasync.c silcbuffmt.c silcconfig.c silcfdstream.c silcfileutil.c silcfsm.c silchashtable.c silclog.c silcmemory.c silcmime.c silcnet.c silcschedule.c silcsnprintf.c silcsocketstream.c silcstack.c silcstream.c silcstringprep.c silcstrutil.c silctime.c silcutf8.c silcutil.c +SOURCEPATH ..\lib\silcutil\symbian +SOURCE silcsymbiannet.cpp silcsymbianscheduler.cpp silcsymbiansocketstream.cpp silcsymbianthread.cpp silcsymbianutil.cpp +SOURCEPATH ..\lib\silcvcard +SOURCE silcvcard.c +SOURCEPATH ..\lib\silcske +SOURCE groups.c payload.c silcconnauth.c silcske.c + +USERINCLUDE . ..\includes ..\lib\silcutil ..\lib\silcvcard ..\lib\silccore ..\lib\silcasn1 ..\lib\contrib ..\lib\silchttp ..\lib\silcapputil ..\lib\silcskr ..\lib\silccrypt ..\lib\silcmath ..\lib\silcsftp ..\lib\silcske + + +LIBRARY estlib.lib euser.lib insock.lib esock.lib diff --git a/symbian/silc_static.mmp b/symbian/silc_static.mmp new file mode 100644 index 00000000..55ded7c2 --- /dev/null +++ b/symbian/silc_static.mmp @@ -0,0 +1,38 @@ +TARGETTYPE lib +TARGET silc.lib +VENDORID 0x00000000 + +UID 0x00000000 0x00000000 + +SYSTEMINCLUDE \epoc32\include \epoc32\include\libc \epoc32\include\variant . +CAPABILITY NONE +MACRO HAVE_SILCDEFS_H + +SOURCEPATH ..\lib\contrib +SOURCE getopti.c nfkc.c regexpr.c rfc3454.c stringprep.c +SOURCEPATH ..\lib\silcapputil +SOURCE silcapputil.c silcidcache.c +SOURCEPATH ..\lib\silcasn1 +SOURCE silcasn1.c silcasn1_decode.c silcasn1_encode.c silcber.c +SOURCEPATH ..\lib\silccore +SOURCE silcargument.c silcattrs.c silcauth.c silcchannel.c silccommand.c silcid.c silcmessage.c silcnotify.c silcpacket.c silcpubkey.c silcstatus.c +SOURCEPATH ..\lib\silccrypt +SOURCE aes.c blowfish.c cast.c md5.c none.c rc5.c rsa.c sha1.c sha256.c silccipher.c silchash.c silchmac.c silcpk.c silcpkcs.c silcpkcs1.c silcrng.c twofish.c +SOURCEPATH ..\lib\silchttp +SOURCE silchttpserver.c +SOURCEPATH ..\lib\silcmath +SOURCE modinv.c mp_tma.c mpbin.c silcprimegen.c tma.c +SOURCEPATH ..\lib\silcsftp +SOURCE sftp_client.c sftp_fs_memory.c sftp_server.c sftp_util.c +SOURCEPATH ..\lib\silcskr +SOURCE silcskr.c +SOURCEPATH ..\lib\silcutil +SOURCE silcasync.c silcbuffmt.c silcconfig.c silcfdstream.c silcfileutil.c silcfsm.c silchashtable.c silclog.c silcmemory.c silcmime.c silcnet.c silcschedule.c silcsnprintf.c silcsocketstream.c silcstack.c silcstream.c silcstringprep.c silcstrutil.c silctime.c silcutf8.c silcutil.c +SOURCEPATH ..\lib\silcutil\symbian +SOURCE silcsymbiannet.cpp silcsymbianscheduler.cpp silcsymbiansocketstream.cpp silcsymbianthread.cpp silcsymbianutil.cpp +SOURCEPATH ..\lib\silcvcard +SOURCE silcvcard.c +SOURCEPATH ..\lib\silcske +SOURCE groups.c payload.c silcconnauth.c silcske.c + +USERINCLUDE . ..\includes ..\lib\silcutil ..\lib\silcvcard ..\lib\silccore ..\lib\silcasn1 ..\lib\contrib ..\lib\silchttp ..\lib\silcapputil ..\lib\silcskr ..\lib\silccrypt ..\lib\silcmath ..\lib\silcsftp ..\lib\silcske diff --git a/symbian/silcclient.mmp b/symbian/silcclient.mmp new file mode 100644 index 00000000..d8a16b9f --- /dev/null +++ b/symbian/silcclient.mmp @@ -0,0 +1,17 @@ +TARGETTYPE dll +TARGET silcclient.dll +VENDORID 0x12345678 + +UID 0x1deadbe1 0xdeadbe10 + +SYSTEMINCLUDE \epoc32\include \epoc32\include\libc \epoc32\include\variant . +CAPABILITY NONE +MACRO HAVE_SILCDEFS_H + +SOURCEPATH ..\lib\silcclient +SOURCE client.c client_attrs.c client_channel.c client_connect.c client_entry.c client_ftp.c client_keyagr.c client_listener.c client_notify.c client_prvmsg.c client_register.c command.c command_reply.c + +USERINCLUDE . ..\includes ..\lib\silcutil ..\lib\silcvcard ..\lib\silccore ..\lib\silcasn1 ..\lib\contrib ..\lib\silchttp ..\lib\silcapputil ..\lib\silcskr ..\lib\silccrypt ..\lib\silcmath ..\lib\silcsftp ..\lib\silcske ..\lib\silcclient + + +LIBRARY estlib.lib euser.lib insock.lib esock.lib silc.lib diff --git a/symbian/silcclient_static.mmp b/symbian/silcclient_static.mmp new file mode 100644 index 00000000..29c6a50a --- /dev/null +++ b/symbian/silcclient_static.mmp @@ -0,0 +1,14 @@ +TARGETTYPE lib +TARGET silcclient.lib +VENDORID 0x00000000 + +UID 0x00000000 0x00000000 + +SYSTEMINCLUDE \epoc32\include \epoc32\include\libc \epoc32\include\variant . +CAPABILITY NONE +MACRO HAVE_SILCDEFS_H + +SOURCEPATH ..\lib\silcclient +SOURCE client.c client_attrs.c client_channel.c client_connect.c client_entry.c client_ftp.c client_keyagr.c client_listener.c client_notify.c client_prvmsg.c client_register.c command.c command_reply.c + +USERINCLUDE . ..\includes ..\lib\silcutil ..\lib\silcvcard ..\lib\silccore ..\lib\silcasn1 ..\lib\contrib ..\lib\silchttp ..\lib\silcapputil ..\lib\silcskr ..\lib\silccrypt ..\lib\silcmath ..\lib\silcsftp ..\lib\silcske ..\lib\silcclient diff --git a/symbian/silcdefs.h b/symbian/silcdefs.h index 30d40b0f..e307a5df 100644 --- a/symbian/silcdefs.h +++ b/symbian/silcdefs.h @@ -41,7 +41,7 @@ #define HAVE_GETENV 1 /* Define to 1 if you have the `getgid' function. */ -#define HAVE_GETGID 1 +//#define HAVE_GETGID 1 /* Define to 1 if you have the `gethostbyaddr' function. */ #define HAVE_GETHOSTBYADDR 1 @@ -50,10 +50,10 @@ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the `getpgid' function. */ -#define HAVE_GETPGID 1 +//#define HAVE_GETPGID 1 /* Define to 1 if you have the `getpgrp' function. */ -#define HAVE_GETPGRP 1 +//#define HAVE_GETPGRP 1 /* Define to 1 if you have the `getpid' function. */ #define HAVE_GETPID 1 @@ -65,7 +65,7 @@ #define HAVE_GETSERVBYPORT 1 /* Define to 1 if you have the `getsid' function. */ -#define HAVE_GETSID 1 +//#define HAVE_GETSID 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 -- 2.24.0