zdoom-macos-deps/deps/sdl2/bin/sdl2-config

66 lines
1.8 KiB
Text
Raw Normal View History

2020-12-17 10:04:59 +00:00
#!/bin/sh
2022-08-20 07:01:20 +00:00
# Get the canonical path of the folder containing this script
bindir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
# Calculate the canonical path of the prefix, relative to the folder of this script
prefix=$(cd -P -- "$bindir/../" && printf '%s\n' "$(pwd -P)")
exec_prefix=${prefix}
2020-12-17 10:04:59 +00:00
exec_prefix_set=no
2022-08-20 07:01:20 +00:00
libdir=${exec_prefix}/lib
2020-12-17 10:04:59 +00:00
#usage="\
#Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
usage="\
Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
2022-08-20 07:01:20 +00:00
echo 2.24.0
2020-12-17 10:04:59 +00:00
;;
--cflags)
2022-08-20 07:01:20 +00:00
echo -I${prefix}/include/SDL2 -D_THREAD_SAFE
2020-12-17 10:04:59 +00:00
;;
2022-08-20 07:01:20 +00:00
# --libs)
# echo -L${exec_prefix}/lib -lSDL2
# ;;
# --static-libs)
2020-12-17 10:04:59 +00:00
--libs|--static-libs)
2022-08-20 07:01:20 +00:00
sdl_static_libs=$(echo " -lSDL2 -lSDL2 -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,IOKit -Wl,-framework,ForceFeedback -Wl,-framework,Carbon -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AVFoundation -Wl,-framework,Foundation -Wl,-weak_framework,Metal -Wl,-weak_framework,QuartzCore -lm" | sed -E "s#-lSDL2[ $]#$libdir/libSDL2.a #g")
echo -L${exec_prefix}/lib $sdl_static_libs
2020-12-17 10:04:59 +00:00
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done