Skip to content

Commit bc2de84

Browse files
author
mhaqs
committed
new libs for psl1ght - proper
- Updated libcurl to the latest version 7.31.0. - Ported polarssl 1.2.8 to psl1ght. - Reorganized ps3libraries script order to compile curl with polarssl support. SSL support is enabled in curl. - Ported lib json-c to psl1ght. - Updated patches for libcurl, polarssl for compilation. - Updated execution rights on new scripts. - zlib script execution fix introduced in last commit
1 parent 00d6007 commit bc2de84

12 files changed

+139
-17
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
diff --git a/src/main.c b/src/main.c
2-
index e33bf9b..2c37586 100644
3-
--- a/src/main.c
4-
+++ b/src/main.c
5-
@@ -5996,6 +5996,7 @@ static int create_dir_hierarchy(const char *outfile, FILE *errors)
1+
diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c
2+
--- a/src/tool_dirhie.c
3+
+++ b/src/tool_dirhie.c
4+
@@ -118,6 +118,7 @@
65
if not ending with DIR_CHAR, we need to prune it */
76
if(tempdir2 != NULL) {
87
size_t dlen = strlen(dirbuildup);
9-
+ struct stat st;
8+
+ struct stat st;
109
if(dlen)
1110
sprintf(&dirbuildup[dlen], "%s%s", DIR_CHAR, tempdir);
1211
else {
13-
@@ -6004,7 +6005,7 @@ static int create_dir_hierarchy(const char *outfile, FILE *errors)
12+
@@ -126,7 +127,7 @@
1413
else
1514
sprintf(dirbuildup, "%s%s", DIR_CHAR, tempdir);
1615
}
1716
- if(access(dirbuildup, F_OK) == -1) {
1817
+ if(stat(dirbuildup, &st) == -1) {
19-
result = mkdir(dirbuildup,(mode_t)0000750);
20-
if(-1 == result) {
18+
if(-1 == mkdir(dirbuildup,(mode_t)0000750)) {
2119
show_dir_errno(errors, dirbuildup);
22-
20+
result = CURLE_WRITE_ERROR;

patches/polarssl-1.2.8-net.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- library/net.c
2+
+++ library/net.c
3+
@@ -67,7 +67,8 @@
4+
#elif defined(sun)
5+
#include <sys/isa_defs.h>
6+
#else
7+
-#include <endian.h>
8+
+#include <machine/endian.h>
9+
+#include <net/select.h>
10+
#endif
11+
12+
#endif
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- library/timing.c
2+
+++ library/timing.c
3+
@@ -45,6 +45,7 @@
4+
#include <sys/types.h>
5+
#include <sys/time.h>
6+
#include <signal.h>
7+
+#include <net/select.h>
8+
#include <time.h>
9+
10+
struct _hr_time
11+
@@ -293,7 +294,7 @@
12+
{
13+
alarmed = 0;
14+
signal( SIGALRM, sighandler );
15+
- alarm( seconds );
16+
+ //alarm( seconds );
17+
}
18+
19+
void m_sleep( int milliseconds )

scripts/001-zlib-1.2.8.sh

100644100755
File mode changed.

scripts/015-polarssl.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/sh -e
2+
3+
# Automatic build script for polarssl
4+
# for psl1ght, playstaion 3 open source sdk.
5+
#
6+
# Originally Created by Felix Schulze on 08.04.11.
7+
# Ported to PS3Libraries to compile with psl1ght.
8+
# Copyright 2010 Felix Schulze. All rights reserved.
9+
#
10+
# Licensed under the Apache License, Version 2.0 (the "License");
11+
# you may not use this file except in compliance with the License.
12+
# You may obtain a copy of the License at
13+
#
14+
# http://www.apache.org/licenses/LICENSE-2.0
15+
#
16+
# Unless required by applicable law or agreed to in writing, software
17+
# distributed under the License is distributed on an "AS IS" BASIS,
18+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
# See the License for the specific language governing permissions and
20+
# limitations under the License.
21+
#
22+
###########################################################################
23+
# Change values here
24+
#
25+
VERSION="1.2.8"
26+
#
27+
###########################################################################
28+
#
29+
# Don't change anything here
30+
CURRENTPATH=`pwd`
31+
ARCH="powerpc64"
32+
PLATFORM="PS3"
33+
34+
## Download the source code.
35+
wget --continue --no-check-certificate -O polarssl-${VERSION}.gpl.tgz https://polarssl.org/download/polarssl-${VERSION}-gpl.tgz?do=yes
36+
37+
## Unpack the source code.
38+
rm -Rf polarssl-${VERSION} && tar xfvz polarssl-${VERSION}.gpl.tgz && cd polarssl-${VERSION}/library
39+
40+
## Patch the source code.
41+
echo "Patching net.c and timing.c for compatibility..."
42+
cat ../../../patches/polarssl-1.2.8-net.patch | patch -p1
43+
cat ../../../patches/polarssl-1.2.8-timing.patch | patch -p1
44+
45+
echo "Building polarssl for ${PLATFORM} ${SDKVERSION} ${ARCH}"
46+
47+
echo "Patching Makefile..."
48+
sed -i.bak '4d' ${CURRENTPATH}/polarssl-${VERSION}/library/Makefile
49+
50+
echo "Please stand by..."
51+
52+
export CC=$PS3DEV/ppu/bin/powerpc64-ps3-elf-gcc
53+
export LD=$PS3DEV/ppu/bin/powerpc64-ps3-elf-ld
54+
export CPP=$PS3DEV/ppu/bin/powerpc64-ps3-elf-cpp
55+
export CXX=$PS3DEV/ppu/bin/powerpc64-ps3-elf-g++
56+
export AR=$PS3DEV/ppu/bin/powerpc64-ps3-elf-ar
57+
export AS=$PS3DEV/ppu/bin/powerpc64-ps3-elf-as
58+
export NM=$PS3DEV/ppu/bin/powerpc64-ps3-elf-nm
59+
export CXXCPP=$PS3DEV/ppu/bin/powerpc64-ps3-elf-cpp
60+
export RANLIB=$PS3DEV/ppu/bin/powerpc64-ps3-elf-ranlib
61+
export LDFLAGS="-L$PS3DEV/ppu/powerpc64-ps3-elf/lib -L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib -lrt -llv2"
62+
export CFLAGS="-I${CURRENTPATH}/polarssl-${VERSION}/include -I$PS3DEV/ppu/powerpc64-ps3-elf/include -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include -mcpu=cell"
63+
64+
echo "Build library..."
65+
## Compile and install.
66+
${MAKE:-make}
67+
68+
cp libpolarssl.a $PS3DEV/portlibs/ppu/lib/libpolarssl.a
69+
cp -R ../include/polarssl $PS3DEV/portlibs/ppu/include/
70+
cp ../LICENSE $PS3DEV/portlibs/ppu/include/polarssl/LICENSE
71+
72+
echo "Building done."
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
#!/bin/sh -e
2-
# libcurl-7.21.6 by KaKaRoTo
2+
# libcurl-7.31.0 by KaKaRoTo
3+
# modified by mhaqs for 7.31.0 release and cpp compatibility
34

45
## Download the source code.
5-
wget --continue http://curl.haxx.se/download/curl-7.21.6.tar.gz
6+
wget --continue http://curl.haxx.se/download/curl-7.31.0.tar.gz
67

78
## Unpack the source code.
8-
rm -Rf curl-7.21.6 && tar xfvz curl-7.21.6.tar.gz && cd curl-7.21.6
9+
rm -Rf curl-7.31.0 && tar xfvz curl-7.31.0.tar.gz && cd curl-7.31.0
910

1011
## Patch the source code.
11-
cat ../../patches/libcurl-7.21.6.patch | patch -p1
12-
12+
cat ../../patches/libcurl-7.31.0.patch | patch -p1
1313

1414
## Create the build directory.
1515
mkdir build-ppu && cd build-ppu
1616

1717
## Configure the build.
1818
AR="ppu-ar" CC="ppu-gcc" RANLIB="ppu-ranlib" \
19-
CFLAGS="-O2 -Wall -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include -I$PSL1GHT/ppu/include/net" \
19+
CFLAGS="-O2 -Wall" \
2020
CXXFLAGS="-I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include" \
2121
CPPFLAGS=" -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include -I$PSL1GHT/ppu/include/net" \
2222
LDFLAGS="-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib" LIBS="-lnet -lsysutil -lsysmodule -lm " \
2323
PKG_CONFIG_LIBDIR="$PSL1GHT/ppu/lib/pkgconfig" PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \
2424
../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" \
25-
--includedir="$PS3DEV/portlibs/ppu/include" --libdir="$PS3DEV/portlibs/ppu/lib"
25+
--includedir="$PS3DEV/portlibs/ppu/include" --libdir="$PS3DEV/portlibs/ppu/lib" --without-ssl --with-polarssl="$PS3DEV/portlibs/ppu/include/polarssl" --with-ca-bundle="/usr/ssl/certs/ca-bundle.crt"
2626

2727
## Compile and install.
2828
${MAKE:-make} -j4 && ${MAKE:-make} install

0 commit comments

Comments
 (0)