Changeset 187 in Main


Ignore:
Timestamp:
Sep 28, 2024, 9:07:34 AM (7 weeks ago)
Author:
Nishi
Message:

kinda works

Location:
trunk
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Platform/ps3.mk

    r186 r187  
    11# $Id$
    22
    3 PREFIX = ms0:/PSP/GAME/httpd
     3PREFIX = /dev_hdd0/httpd
    44
    5 CC = psp-gcc
    6 AR = psp-ar
    7 CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -I /usr/local/pspdev/psp/sdk/include -D_PSP_FW_VERSION=600
    8 LDFLAGS = -Wl,-zmax-page-size=128 -L /usr/local/pspdev/psp/sdk/lib
    9 LIBS = -lpspgum -lpspgu -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspnet -lpspnet_apctl -lcglue -lpspwlan
     5CC = ppu-gcc
     6AR = ppu-ar
     7CFLAGS = -g -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -I /usr/local/ps3dev/ppu/include
     8LDFLAGS = -L /usr/local/ps3dev/ppu/lib
     9LIBS = -lnet -lsysmodule -lsysutil -lrt -llv2
    1010EXEC = .elf
    1111LIB = .so
    1212MODULE =
    13 SERVADD = psp-fixup-imports tewi.elf && psp-strip tewi.elf -o tewi_strip.elf
    14 TARGET = tewi.pbp
     13SERVADD = ppu-strip tewi.elf -o tewi_strip.elf
     14TARGET = tewi.pkg
  • trunk/Server/Makefile

    r183 r187  
    2222        mksfoex -d MEMSIZE=1 'Tewi HTTPd' $@
    2323
     24tewi.self: tewi_strip$(EXEC)
     25        sprxlinker tewi_strip$(EXEC)
     26        make_self_npdrm tewi_strip$(EXEC) $@ UP0001-TEWI_00-0000000000000000
     27        fself tewi_strip$(EXEC) tewi.fake.self
     28
     29tewi.pkg: tewi.self
     30        mkdir -p pkg/USRDIR
     31        cp /usr/local/ps3dev/bin/ICON0.PNG pkg/ICON0.PNG
     32        make_self_npdrm tewi.elf pkg/USRDIR/EBOOT.BIN UP0001-TEWI_00-0000000000000000
     33        sfo.py --title "Tewi HTTPd" --appid "TEWI" -f /usr/local/ps3dev/bin/sfo.xml pkg/PARAM.SFO
     34        pkg.py --contentid UP0001-TEWI_00-0000000000000000 pkg/ $@
     35        rm -rf pkg
     36
    2437.c.o:
    2538        $(CC) $(CFLAGS) $(EXTCFLAGS) -c -o $@ $<
     
    2942
    3043clean:
    31         rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp
     44        rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp *.self *.pkg
  • trunk/Server/config.c

    r182 r187  
    102102        config.server_admin = cm_strdup(SERVER_ADMIN);
    103103        config.defined[0] = NULL;
    104 #ifdef _PSP
     104#if defined(_PSP)
    105105        strcpy(config.hostname, "psp");
     106#elif defined(__PPU__)
     107        strcpy(config.hostname, "ps3");
    106108#else
    107109        gethostname(config.hostname, 1024);
  • trunk/Server/http.c

    r147 r187  
    2020#else
    2121#ifdef USE_POLL
     22#ifdef __PPU__
     23#include <net/poll.h>
     24#else
    2225#include <poll.h>
     26#endif
    2327#else
    2428#include <sys/select.h>
  • trunk/Server/main.c

    r183 r187  
    241241        }
    242242        printf("Connected, My IP is %s\n", info.ip);
     243#elif defined(__PPU__)
     244        printf("PS3 Bootstrap, Tewi/%s\n", tw_get_version());
     245        netInitialize();
    243246#endif
    244247        int st = startup(argc, argv);
  • trunk/Server/module.c

    r182 r187  
    1616extern struct tw_config config;
    1717
    18 #ifdef _PSP
     18#if defined(_PSP) || defined(__PPU__)
    1919void* tw_module_load(const char* path) { return NULL; }
    2020
  • trunk/Server/server.c

    r183 r187  
    4343#else
    4444#ifdef USE_POLL
     45#ifdef __PPU__
     46#include <net/poll.h>
     47#else
    4548#include <poll.h>
     49#endif
    4650#else
    4751#include <sys/select.h>
     
    5054#include <arpa/inet.h>
    5155#include <netinet/in.h>
     56#ifndef __PPU__
    5257#include <netinet/tcp.h>
     58#endif
    5359#ifndef NO_GETADDRINFO
    5460#include <netdb.h>
     
    136142                        return 1;
    137143                }
     144#ifndef __PPU__
    138145                if(setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*)&yes, sizeof(yes)) < 0) {
    139146                        close_socket(sock);
     
    141148                        return 1;
    142149                }
     150#endif
    143151#ifndef NO_IPV6
    144152                int no = 0;
     
    431439#elif defined(__HAIKU__)
    432440int32_t tw_server_pass(void* ptr) {
    433 #elif defined(_PSP)
     441#elif defined(_PSP) || defined(__PPU__)
    434442int tw_server_pass(void* ptr) {
    435443#endif
    436 #if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP)
     444#if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP) || defined(__PPU__)
    437445        int sock = ((struct pass_entry*)ptr)->sock;
    438446        bool ssl = ((struct pass_entry*)ptr)->ssl;
     
    514522                                        struct tm tm;
    515523                                        strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm);
    516 #if defined(__MINGW32__) || defined(_PSP)
     524#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__)
    517525                                        time_t t = 0;
    518526                                        struct tm* btm = localtime(&t);
     
    919927                                        int sock = accept(sockets[i], (struct sockaddr*)&claddr, &clen);
    920928                                        cm_log("Server", "New connection accepted");
    921 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP)
     929#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP) || defined(__PPU__)
    922930                                        struct pass_entry* e = malloc(sizeof(*e));
    923931                                        e->sock = sock;
     
    945953                                                }
    946954                                        }
    947 #elif defined(_PSP)
     955#elif defined(_PSP) || defined(__PPU__)
    948956                                                tw_server_pass(e);
    949957#elif defined(__HAIKU__)
  • trunk/Server/tw_config.h

    r156 r187  
    1919#define NO_IPV6
    2020#else
     21#ifdef __PPU__
     22#include <net/net.h>
     23#endif
    2124#include <netinet/in.h>
    2225#ifdef __HAIKU__
  • trunk/Server/version.c

    r183 r187  
    2222#elif defined(_PSP)
    2323    "PSP"
     24#elif defined(__PPU__)
     25    "PS3"
    2426#else
    2527    "Unix"
  • trunk/config.h.tmpl

    r182 r187  
    2828#endif
    2929
    30 #if defined(_PSP) && !defined(NO_IPV6)
     30#if (defined(_PSP) || defined(__PPU__)) && !defined(NO_IPV6)
    3131#define NO_IPV6
    32 /* PSP does not have IPv6 */
     32/* PSP/PS3 does not have IPv6 */
    3333#endif
    3434
    35 #if defined(_PSP) && defined(USE_POLL)
     35#if (defined(_PSP)) && defined(USE_POLL)
    3636#undef USE_POLL
    3737/* Force select(2) for PSP */
    3838#endif
    3939
    40 #if defined(_PSP) && defined(HAS_CHROOT)
     40#if (defined(_PSP) || defined(__PPU__)) && defined(HAS_CHROOT)
    4141#undef HAS_CHROOT
    42 /* PSP should not have chroot */
     42/* PSP/PS3 should not have chroot */
    4343#endif
    4444
    45 #if defined(_PSP) && !defined(NO_GETADDRINFO)
     45#if (defined(_PSP) || defined(__PPU__)) && !defined(NO_GETADDRINFO)
    4646#define NO_GETADDRINFO
    47 /* PSP should not have getaddrinfo */
     47/* PSP/PS3 should not have getaddrinfo */
    4848#endif
    4949
  • trunk/psp.sh

    r184 r187  
    33export PSPDEV=/usr/local/pspdev
    44export PATH=$PATH:/usr/local/pspdev/bin
     5cat config.h.tmpl | sed -E 's/#undef (NO_SSL)/#define \1/g' > config.h
    56rm -rf httpd
    67make PLATFORM=psp DESTDIR=httpd/ install
Note: See TracChangeset for help on using the changeset viewer.