Skip to content

Commit

Permalink
ps3: Stop relying on env vars when building, use paths set in ./confi…
Browse files Browse the repository at this point in the history
…gure.ps3 instead
  • Loading branch information
andoma committed Mar 17, 2018
1 parent 8d25559 commit f891b4c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
6 changes: 1 addition & 5 deletions Autobuild/ps3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ cleanup() {
exit 1
}

export PS3DEV=${TOOLCHAIN}
export PSL1GHT=${TOOLCHAIN}/psl1ght
export PATH=$PATH:$PS3DEV/bin:$PS3DEV/host/ppu/bin:$PS3DEV/host/spu/bin
export PATH=$PATH:$PSL1GHT/host/bin

echo "Toolchain from: '${TOOLCHAIN_URL}' Local install in: ${TOOLCHAIN}"
if [ -d $TOOLCHAIN ]; then
echo "Toolchain seems to exist"
Expand Down Expand Up @@ -42,6 +37,7 @@ else
fi

./configure.ps3 --build=${TARGET} \
--ps3dev=${TOOLCHAIN} --psl1ght=${TOOLCHAIN}/psl1ght \
${RELEASE} \
${VERSIONARGS} \
--cleanbuild \
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ ALLDEPS += ${STAMPS}

OPTFLAGS ?= -O${OPTLEVEL}

VERSION ?= $(shell echo ${GIT_DESCRIBE_OUTPUT} | awk -F. '{ print $$1 "." $$2 "." $$3 }')

PROG=${BUILDDIR}/movian
LIB=${BUILDDIR}/libmovian

Expand Down Expand Up @@ -814,7 +816,6 @@ BUNDLE_OBJS=$(BUNDLE_SRCS:%.c=%.o)

# Common CFLAGS for all files
CFLAGS_com += -g -funsigned-char ${OPTFLAGS} ${CFLAGS_dbg}
#CFLAGS_com += -D_FILE_OFFSET_BITS=64
CFLAGS_com += -iquote${BUILDDIR} -iquote${C}/src -iquote${C}

# Tools
Expand Down
21 changes: 14 additions & 7 deletions configure.ps3
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ DEFAULT_UI="glw"
CONFIGURE_POSTFIX="ps3"

source support/configure.inc
TOOLCHAIN="${PS3DEV}/host/ppu/bin/ppu-"
CC=${TOOLCHAIN}gcc

LIBAV_CFLAGS="-mminimal-toc -I${PSL1GHT}/target/include -B${PSL1GHT}/target/lib -B${PS3DEV}/host/ppu/lib -I${PS3DEV}/host/ppu/include -include ${TOPDIR}/support/nostrictansi.h"

LIBAV_ARCH_FLAGS="--cross-prefix=${PS3DEV}/host/ppu/bin/ppu- --enable-cross-compile --arch=powerpc64 --cpu=cell --target-os=none --malloc-prefix=my --disable-shared --enable-static"


enable sqlite_internal
Expand Down Expand Up @@ -56,11 +50,23 @@ for opt do
;;
--logtarget=*) DEFAULT_LOGTARGET="$optval"
;;
--ps3dev=*) PS3DEV="$optval"
;;
--psl1ght=*) PSL1GHT="$optval"
;;
*)
common_opt $opt $optval
esac
done

TOOLCHAIN="${PS3DEV}/host/ppu/bin/ppu-"
CC=${TOOLCHAIN}gcc

LIBAV_CFLAGS="-mminimal-toc -I${PSL1GHT}/target/include -B${PSL1GHT}/target/lib -B${PS3DEV}/host/ppu/lib -I${PS3DEV}/host/ppu/include -include ${TOPDIR}/support/nostrictansi.h"

LIBAV_ARCH_FLAGS="--cross-prefix=${PS3DEV}/host/ppu/bin/ppu- --enable-cross-compile --arch=powerpc64 --cpu=cell --target-os=none --malloc-prefix=my --disable-shared --enable-static"


setup_env "$@"


Expand All @@ -79,6 +85,7 @@ fi
cat >> ${CONFIG_MAK} <<EOF
CFLAGS_cfg += -mminimal-toc -DWORDS_BIGENDIAN
CFLAGS_cfg += -DPATH_MAX=512 -DPS3 -D_FILE_OFFSET_BITS=64
PSL1GHT := - ${PSL1GHT}
CFLAGS_cfg += -I${PSL1GHT}/target/include
CFLAGS_cfg += -I${PS3DEV}/host/ppu/include
CFLAGS_cfg += -I${PS3DEV}/host/ppu/include/freetype2
Expand All @@ -87,7 +94,7 @@ SQLITE_PLATFORM_DEFINES += -DSQLITE_OS_OTHER=1
EOF

#
#
#
#
cat >> ${CONFIG_MAK} <<EOF
LDFLAGS_cfg += -lvdec -lrtc
Expand Down
2 changes: 0 additions & 2 deletions src/arch/android/android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ DX := ${ANDROID_BUILD_TOOLS}/dx
ZIPALIGN := ${ANDROID_BUILD_TOOLS}/zipalign
APKSIGNER := ${ANDROID_BUILD_TOOLS}/apksigner

VERSION ?= $(shell echo ${GIT_DESCRIBE_OUTPUT} | awk -F. '{ print $$1 "." $$2 "." $$3 }')

NUMVER := $(shell echo ${VERSION} | awk -F. '{ print $$3 + $$2 * 100000 + $$1 * 10000000 }')

R_JAVA := ${BUILDDIR}/java/com/lonelycoder/mediaplayer/R.java
Expand Down
2 changes: 0 additions & 2 deletions src/arch/nacl/nacl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ stage: ${STAGEFILES} ${BUILDDIR}/stage/app.pexe
dbgstage: ${STAGEFILES} ${BUILDDIR}/stage/app.bundle
rm -f ${BUILDDIR}/stage/app.pexe

VERSION := $(shell support/getver.sh)

DISTARCHIVE := ${BUILDDIR}/${APPNAMEUSER}-${VERSION}.zip

${DISTARCHIVE}: ${STAGEFILES} ${BUILDDIR}/stage/app.pexe
Expand Down
16 changes: 10 additions & 6 deletions src/arch/ps3/ps3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ SRCS += src/htsmsg/persistent_file.c
# Install
#

VERSION := $(shell support/getver.sh)
SFO := $(PSL1GHT)/host/bin/sfo.py
PKG := $(PSL1GHT)/host/bin/pkg.py
MAKE_SELF := $(PSL1GHT)/host/bin/make_self
MAKE_SELF_NPDRM := $(PSL1GHT)/host/bin/make_self_npdrm
SPRXLINKER := $(PSL1GHT)/host/bin/sprxlinker
PACKAGE_FINALIZE := $(PSL1GHT)/host/bin/package_finalize

ICON0 := $(TOPDIR)/support/ps3icon.png
APPID := HTSS00003
CONTENTID := UP0001-$(APPID)_00-0000000000000000
Expand All @@ -44,11 +48,11 @@ $(BUILDDIR)/PARAM.SFO: $(SFOXML)
${EBOOT}: support/ps3/eboot.c src/arch/ps3/ps3.mk
$(CC) $(CFLAGS_com) $(CFLAGS) $(CFLAGS_cfg) -o $@ $< ${LDFLAGS_EBOOT}
${STRIP} $@
sprxlinker $@
${SPRXLINKER} $@

${ELF}: ${BUILDDIR}/${APPNAME}.ziptail src/arch/ps3/ps3.mk
${STRIP} -o $@ $<
sprxlinker $@
${SPRXLINKER} $@

${SYMS}: ${BUILDDIR}/${APPNAME}.ziptail src/arch/ps3/ps3.mk
${OBJDUMP} -t -j .text $< | awk '{print $$1 " " $$NF}'|sort >$@
Expand All @@ -59,15 +63,15 @@ ${ZS}: ${BUILDDIR}/zipbundles/bundle.zip ${SYMS} src/arch/ps3/ps3.mk $(BUILDDIR
zip -9j ${ZS} ${SYMS} $(BUILDDIR)/PARAM.SFO $(BUILDDIR)/ICON0.PNG

${SELF}: ${ELF} ${ZS} src/arch/ps3/ps3.mk
make_self $< $@
${MAKE_SELF} $< $@
cat ${ZS} >>$@

$(BUILDDIR)/pkg/USRDIR/${APPNAME}.self: ${SELF} src/arch/ps3/ps3.mk
cp $< $@

$(BUILDDIR)/pkg/USRDIR/EBOOT.BIN: ${EBOOT} src/arch/ps3/ps3.mk
@mkdir -p $(BUILDDIR)/pkg/USRDIR
make_self_npdrm $< $@ $(CONTENTID)
${MAKE_SELF_NPDRM} $< $@ $(CONTENTID)

$(BUILDDIR)/${APPNAME}.pkg: $(BUILDDIR)/pkg/USRDIR/EBOOT.BIN $(BUILDDIR)/pkg/USRDIR/${APPNAME}.self $(BUILDDIR)/PARAM.SFO
cp $(ICON0) $(BUILDDIR)/pkg/ICON0.PNG
Expand All @@ -76,7 +80,7 @@ $(BUILDDIR)/${APPNAME}.pkg: $(BUILDDIR)/pkg/USRDIR/EBOOT.BIN $(BUILDDIR)/pkg/USR

$(BUILDDIR)/${APPNAME}_geohot.pkg: $(BUILDDIR)/${APPNAME}.pkg src/arch/ps3/ps3.mk
cp $< $@
package_finalize $@
${PACKAGE_FINALIZE} $@

pkg: $(BUILDDIR)/${APPNAME}.pkg $(BUILDDIR)/${APPNAME}_geohot.pkg
self: ${SELF}
Expand Down

0 comments on commit f891b4c

Please sign in to comment.