代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。