Skip to content

Commit b75a826

Browse files
authored
Merge pull request #699 from uyjulian/pkgconfig
Add pkg-config wrapper
2 parents fa8d296 + 0ab080f commit b75a826

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

Defs.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ EE_OBJCOPY ?= $(EE_TOOL_PREFIX)objcopy
2424
EE_STRIP ?= $(EE_TOOL_PREFIX)strip
2525
EE_ADDR2LINE ?= $(EE_TOOL_PREFIX)addr2line
2626
EE_RANLIB ?= $(EE_TOOL_PREFIX)ranlib
27+
EE_PKG_CONFIG ?= $(EE_TOOL_PREFIX)pkg-config
2728

2829
#
2930
# Defintions for the IOP toolchain.

samples/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Licenced under Academic Free License version 2.0
77
# Review ps2sdk README & LICENSE files for further details.
88

9+
BIN_TARGET = $(PS2SDK)/bin
910
SAMPLES_TARGET = $(PS2SDK)/samples
1011
SHARE_TARGET = $(PS2DEV)/share
1112

@@ -28,7 +29,8 @@ release-samples:
2829
cp -f Makefile.eeglobal_cpp_sample $(SAMPLES_TARGET)/Makefile.eeglobal_cpp
2930
cp -f Makefile.iopglobal_sample $(SAMPLES_TARGET)/Makefile.iopglobal
3031
cp -f ps2dev.cmake $(SHARE_TARGET)/ps2dev.cmake
31-
cp -f ps2dev_iop.cmake $(SHARE_TARGET)/ps2dev_iop.cmake
32+
cp -f pkg-config.in $(BIN_TARGET)/$(EE_TOOL_PREFIX)pkg-config
33+
chmod 755 $(BIN_TARGET)/$(EE_TOOL_PREFIX)pkg-config
3234

3335
release-clean:
3436
rm -f -r $(SAMPLES_TARGET)

samples/pkg-config.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
3+
command -v pkg-config >/dev/null 2>&1 || { printf >&2 "pkg-config is not found\n"; exit 1; }
4+
5+
# Ensure host libraries are not being used
6+
7+
export PKG_CONFIG_DIR=
8+
export PKG_CONFIG_PATH=
9+
export PKG_CONFIG_SYSROOT_DIR=
10+
11+
export PKG_CONFIG_LIBDIR=${PS2SDK}/ports/lib/pkgconfig:${PS2DEV}/gsKit/lib/pkgconfig:${PS2SDK}/ee/lib/pkgconfig
12+
13+
test "$1" = '--version' && exec pkg-config "$@"
14+
exec pkg-config --static "$@"

samples/ps2dev.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ SET(CMAKE_EXE_LINKER_FLAGS_INIT ${EE_LDFLAGS})
4848

4949
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostartfiles -Wl,-r -Wl,-d")
5050

51+
find_program(PKG_CONFIG_EXECUTABLE NAMES mips64r5900el-ps2-elf-pkg-config HINTS "$ENV{PS2SDK}/bin")
52+
if (NOT PKG_CONFIG_EXECUTABLE)
53+
message(FATAL_ERROR "Could not find mips64r5900el-ps2-elf-pkg-config")
54+
endif()
55+
5156
SET(PS2 TRUE)
5257
SET(PLATFORM_PS2 TRUE)
5358
SET(EE TRUE)

0 commit comments

Comments
 (0)