[noobish question] Problems when compiling OpenSSL

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
victorprosa
Posts: 37
Joined: Wed Jan 14, 2009 5:53 am

[noobish question] Problems when compiling OpenSSL

Post by victorprosa »

I feel a little bit ashamed making this question, because no one seems to have this problem, but i am stuck with this for 2 days...

user$> gunzip < openssl-0.9.7j.tar.gz | tar xv

*Then cd over to openssl-0.9.7j

To Patch:
----------

user$> patch -p1 < ../openssl-0.9.7j.patch

To configure and compile, run:
-------------------------------

user$> ./Configure psp --prefix=$(psp-config --psp-prefix) threads zlib no-shared no-asm

Then:

user$> make

To install, as root run:
-------------------------

root$> make install
Unzip-> Done
cd -> Done
patch -> Done
Configure -> Done
Make -> Failed

Code: Select all

cversion.c&#58; In function ‘SSLeay_version’&#58;
cversion.c&#58;105&#58; erro&#58; ‘usr’ undeclared &#40;first use in this function&#41;
cversion.c&#58;105&#58; erro&#58; &#40;Each undeclared identifier is reported only once
cversion.c&#58;105&#58; erro&#58; for each function it appears in.&#41;
cversion.c&#58;105&#58; erro&#58; ‘local’ undeclared &#40;first use in this function&#41;
cversion.c&#58;105&#58; erro&#58; ‘pspdev’ undeclared &#40;first use in this function&#41;
cversion.c&#58;105&#58; erro&#58; ‘psp’ undeclared &#40;first use in this function&#41;
cversion.c&#58;105&#58; erro&#58; ‘ssl’ undeclared &#40;first use in this function&#41;
cversion.c&#58;108&#58; erro&#58; expected ‘;’ before string constant
make&#91;1&#93;&#58; ** &#91;cversion.o&#93; Erro 1
Do you have any sugestion of what should I do?

PS: Please, don't tell me to use jojojoris' port, because my project requires raf's port...
Criptych
Posts: 64
Joined: Sat Sep 12, 2009 5:18 am

Post by Criptych »

From the error messages, it sounds like maybe a string isn't properly quoted. What's on line 105 of cversion.c?
"You hungry? I haven't eaten since later this afternoon."
victorprosa
Posts: 37
Joined: Wed Jan 14, 2009 5:53 am

Post by victorprosa »

I thought that would be better to post the entire file:

Code: Select all

/* crypto/cversion.c */
/* Copyright &#40;C&#41; 1995-1998 Eric Young &#40;[email protected]&#41;
 * All rights reserved.
 *
 * This package is an SSL implementation written
 * by Eric Young &#40;[email protected]&#41;.
 * The implementation was written so as to conform with Netscapes SSL.
 * 
 * This library is free for commercial and non-commercial use as long as
 * the following conditions are aheared to.  The following conditions
 * apply to all code found in this distribution, be it the RC4, RSA,
 * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
 * included with this distribution is covered by the same copyright terms
 * except that the holder is Tim Hudson &#40;[email protected]&#41;.
 * 
 * Copyright remains Eric Young's, and as such any Copyright notices in
 * the code are not to be removed.
 * If this package is used in a product, Eric Young should be given attribution
 * as the author of the parts of the library used.
 * This can be in the form of a textual message at program startup or
 * in documentation &#40;online or textual&#41; provided with the package.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met&#58;
 * 1. Redistributions of source code must retain the copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement&#58;
 *    "This product includes cryptographic software written by
 *     Eric Young &#40;[email protected]&#41;"
 *    The word 'cryptographic' can be left out if the rouines from the library
 *    being used are not cryptographic related &#58;-&#41;.
 * 4. If you include any Windows specific code &#40;or a derivative thereof&#41; from 
 *    the apps directory &#40;application code&#41; you must include an acknowledgement&#58;
 *    "This product includes software written by Tim Hudson &#40;[email protected]&#41;"
 * 
 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES &#40;INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION&#41;
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT &#40;INCLUDING NEGLIGENCE OR OTHERWISE&#41; ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 * The licence and distribution terms for any publically available version or
 * derivative of this code cannot be changed.  i.e. this code cannot simply be
 * copied and put under another distribution licence
 * &#91;including the GNU Public Licence.&#93;
 */

#include <stdio.h>
#include <string.h>
#include "cryptlib.h"
#include <openssl/crypto.h>

#ifndef NO_WINDOWS_BRAINDEATH
#include "buildinf.h"
#endif

const char *SSLeay_version&#40;int t&#41;
	&#123;
	if &#40;t == SSLEAY_VERSION&#41;
		return OPENSSL_VERSION_TEXT;
	if &#40;t == SSLEAY_BUILT_ON&#41;
		&#123;
#ifdef DATE
		static char buf&#91;sizeof&#40;DATE&#41;+11&#93;;

		BIO_snprintf&#40;buf,sizeof buf,"built on&#58; %s",DATE&#41;;
		return&#40;buf&#41;;
#else
		return&#40;"built on&#58; date not available"&#41;;
#endif
		&#125;
	if &#40;t == SSLEAY_CFLAGS&#41;
		&#123;
#ifdef CFLAGS
		static char buf&#91;sizeof&#40;CFLAGS&#41;+11&#93;;

		BIO_snprintf&#40;buf,sizeof buf,"compiler&#58; %s",CFLAGS&#41;;
		return&#40;buf&#41;;
#else
		return&#40;"compiler&#58; information not available"&#41;;
#endif
		&#125;
	if &#40;t == SSLEAY_PLATFORM&#41;
		&#123;
#ifdef PLATFORM
		static char buf&#91;sizeof&#40;PLATFORM&#41;+11&#93;;

		BIO_snprintf&#40;buf,sizeof buf,"platform&#58; %s", PLATFORM&#41;;
		return&#40;buf&#41;;
#else
		return&#40;"platform&#58; information not available"&#41;;
#endif
		&#125;
	if &#40;t == SSLEAY_DIR&#41;
		&#123;
#ifdef OPENSSLDIR
		return "OPENSSLDIR&#58; \"" OPENSSLDIR "\"";
#else
		return "OPENSSLDIR&#58; N/A";
#endif
		&#125;
	return&#40;"not available"&#41;;
	&#125;

unsigned long SSLeay&#40;void&#41;
	&#123;
	return&#40;SSLEAY_VERSION_NUMBER&#41;;
	&#125;
And, as you can see, line 105:

Code: Select all

        if &#40;t == SSLEAY_DIR&#41;
By the way, thank you for taking interest =]
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

I don't know what went wrong, but you could just replace the whole function with

Code: Select all

const char *SSLeay_version&#40;int t&#41;
   &#123;
   return&#40;"not available"&#41;;
   &#125;
and it should still work.
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

I made my own port a while ago:

http://jojosoft.1free.ws/viewtopic.php?f=6&t=15

I created a simple build script

Code: Select all

int main&#40;&#41;&#123;
     SetupCallbacks&#40;&#41;;
     makeNiceGame&#40;&#41;;
     sceKernelExitGame&#40;&#41;;
&#125;
victorprosa
Posts: 37
Joined: Wed Jan 14, 2009 5:53 am

Post by victorprosa »

jimparis:

Thanks for your help, interesting way to solve the problem, xD
but, as far as i explored, this change won't give major problems...

Ahn, about the problem...
Some time ago, I started studying old PSP codes, and seems that later versions of the SDK doesn't seem to be as connected as it used to be in 2006...
A great quantity of the codes are still working, but i need to include a lot of libs that used to be all interconnected, you just had to call 1 to get all the functions...
Maybe this is the problem of the OpenSSL port also...

-------------

jojojoris:
I already know your port and i admire the effort of yours =]
but as soon as i am working with old codes, they require the old port from raf's...
coyotebean
Posts: 18
Joined: Sat Dec 05, 2009 1:02 am

Post by coyotebean »

My wild guess would be some problem with OPENSSLDIR

"usr" "local" "pspdev" "psp" "ssl"

looks like the path to your openssl. It is probably not being "quoted" properly.
Post Reply