1 Star 0 Fork 0

Shun/ultimatepp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
configure_makefile 3.56 KB
一键复制 编辑 原始数据 按行查看 历史
cxl 提交于 2021-01-19 12:16 . configure_makefile MacOS support
#!/usr/bin/env bash
cp $1.in $1
uname=`uname`
if [[ "$uname" == 'SunOS' ]]; then
echo Configuring $1 for OpenSolaris
sed -i 's/-DflagPOSIX -DflagLINUX/-DflagPOSIX -DflagSOLARIS/' $1
sed -i 's/-Wl,--gc-sections $(LINKOPTIONS)/$(LINKOPTIONS)/' $1
sed -i 's/GCC-Gcc-Gui-Linux-Main-Posix-Shared/GCC-Gcc-Gui-Main-Posix-Shared-Solaris/' $1
sed -i 's/GCC-Gcc-Gui-Linux-Posix-Shared/GCC-Gcc-Gui-Posix-Shared-Solaris/' $1
sed -i 's/GCC-Gcc-Linux-Main-Posix-Shared/GCC-Gcc-Main-Posix-Shared-Solaris/' $1
sed -i 's/GCC-Gcc-Linux-Posix-Shared/GCC-Gcc-Posix-Shared-Solaris/' $1
sed -i 's/$(LIBPATH) -Wl,-O,2 $(LDFLAGS)/$(LIBPATH) $(LDFLAGS)/' $1
sed -i 's/-lpthread /-lposix4 /' $1
sed -i 's/-lrt /-lsocket -lnsl /' $1
fi
if [[ "$uname" == 'FreeBSD' ]]; then
echo Configuring $1 for FreeBSD
sed -i '' 's/-DflagPOSIX -DflagLINUX/-DflagPOSIX -DflagBSD -DflagFREEBSD/' $1
sed -i '' 's/-Wl,--gc-sections $(LINKOPTIONS)/$(LINKOPTIONS)/' $1
sed -i '' 's/GCC-Gcc-Gui-Linux-Main-Posix-Shared/GCC-Bsd-Freebsd-Gcc-Gui-Main-Posix-Shared/' $1
sed -i '' 's/GCC-Gcc-Gui-Linux-Posix-Shared/GCC-Bsd-Freebsd-Gcc-Gui-Posix-Shared/' $1
sed -i '' 's/GCC-Gcc-Linux-Main-Posix-Shared/GCC-Bsd-Freebsd-Gcc-Main-Posix-Shared/' $1
sed -i '' 's/GCC-Gcc-Linux-Posix-Shared/GCC-Bsd-Freebsd-Gcc-Posix-Shared/' $1
sed -i '' 's/$(LIBPATH) -Wl,-O,2 $(LDFLAGS)/$(LIBPATH) $(LDFLAGS)/' $1
sed -i '' 's/-ldl /-lexecinfo /' $1
fi
if [[ "$uname" == 'OpenBSD' ]]; then
echo Configuring $1 for OpenBSD
sed -i.bak 's/-DflagPOSIX -DflagLINUX/-DflagPOSIX -DflagBSD -DflagOPENBSD/' $1
sed -i.bak 's/-Wl,--gc-sections $(LINKOPTIONS)/$(LINKOPTIONS)/' $1
sed -i.bak 's#LIBPATH =#LIBPATH = -L"/usr/local/lib"#' $1
sed -i.bak 's#-I./ -I$(UPPOUT)#-I/usr/local/include -I./ -I$(UPPOUT)#' $1
sed -i.bak 's/GCC-Gcc-Gui-Linux-Main-Posix-Shared/GCC-Bsd-Gcc-Gui-Main-Openbsd-Posix-Shared/' $1
sed -i.bak 's/GCC-Gcc-Gui-Linux-Posix-Shared/GCC-Bsd-Gcc-Gui-Openbsd-Posix-Shared/' $1
sed -i.bak 's/GCC-Gcc-Linux-Main-Posix-Shared/GCC-Bsd-Gcc-Main-Openbsd-Posix-Shared/' $1
sed -i.bak 's/GCC-Gcc-Linux-Posix-Shared/GCC-Bsd-Gcc-Openbsd-Posix-Shared/' $1
sed -i.bak 's/$(LIBPATH) -Wl,-O,2 $(LDFLAGS)/$(LIBPATH) $(LDFLAGS)/' $1
sed -i.bak 's/-ldl /-lexecinfo /' $1
sed -i.bak 's/-lrt / /' $1
rm $1.bak
fi
if [[ "$uname" == 'NetBSD' ]]; then
echo Configuring $1 for OpenBSD
sed -i.bak 's/-DflagPOSIX -DflagLINUX/-DflagPOSIX -DflagBSD -DflagNETBSD/' $1
sed -i.bak 's/-Wl,--gc-sections $(LINKOPTIONS)/$(LINKOPTIONS)/' $1
sed -i.bak 's#LIBPATH =#LIBPATH = -L"/usr/local/lib"#' $1
sed -i.bak 's#-I./ -I$(UPPOUT)#-I/usr/local/include -I./ -I$(UPPOUT)#' $1
sed -i.bak 's/$(LIBPATH) -Wl,-O,2 $(LDFLAGS)/$(LIBPATH) $(LDFLAGS)/' $1
sed -i.bak 's/-ldl /-lexecinfo /' $1
sed -i.bak 's/-lrt / /' $1
rm $1.bak
fi
if [[ "$uname" == 'Darwin' ]]; then
echo Configuring $1 for MacOS
sed -i.bak 's/\`pkg-config --cflags libpng\` \`pkg-config --cflags freetype2\` \`pkg-config --cflags x11\` \`pkg-config --cflags fontconfig\` \`pkg-config --cflags xcb\` \`pkg-config --cflags expat\`/ /' $1
sed -i.bak 's/-Wl,--gc-sections $(LINKOPTIONS)/$(LINKOPTIONS)/' $1
sed -i.bak 's/$(LINKER) -o "$(OutFile)" -Wl,-s $(LIBPATH) -Wl,-O,2 $(LDFLAGS) -Wl,--start-group/$(LINKER) -o "$(OutFile)" $(LIBPATH) $(LDFLAGS)/' $1
sed -i.bak 's/\`pkg-config --libs libpng\`/ /' $1
sed -i.bak 's/\`pkg-config --libs freetype2\`/ /' $1
sed -i.bak 's/\`pkg-config --libs x11\`/ /' $1
sed -i.bak 's/\`pkg-config --libs fontconfig\`/ /' $1
sed -i.bak 's/\`pkg-config --libs xcb\`/ /' $1
sed -i.bak 's/\`pkg-config --libs expat\`/ /' $1
sed -i.bak 's/-lrt /-lpng /' $1
sed -i.bak 's/-Wl,--end-group/ /' $1
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/shun_dev/ultimatepp.git
[email protected]:shun_dev/ultimatepp.git
shun_dev
ultimatepp
ultimatepp
master

搜索帮助