Posted: Sun 03 Jun 2018, 03:04 Post subject:
A Script to Wrap all gcc functions w/ CPLUS_INCLUDE_PATH Subject description: & gcc version
So I wanted to use the latest gcc on TazPup and every function (e.g. c++ and gcc) had a -63 suffix at the end of it. I thought it might be good to link gcc to gcc-63 and then I though, while maybe instead I should great a wrapper function called gcc which exports the necessary environmental variables (we could also add compiler options).
So the script can do either depending on if you set the variable "METHOD" to either wrap or link. I think I might want a third option where it will export the environmental variables if they aren't already set.
Anyway, I really don't know if any of this is a good Idea but here is my script
read -r -d '' HDR <<'EOF'
D='$' #I can't get the dollar sign end of line terminator to work with sed no matter what I do!
for line in `cat /var/lib/tazpkg/installed/gcc63/files.list`; do #'/usr/bin/c++-63'; do #
read -r -d '' SED_EXP <<EOF
export SED_EXP #Not sure if this is necessary
export line #Not sure if this is necessary
EXP=$( echo "$line" | sed -n "$SED_EXP")
if [ -n "$b" ]; then
DNAME="$( dirname $a)"; echo "DNAME=$DNAME"
LNAME="$( basename $a )"
case $METHOD in
echo "$HDR" > "$LNAME"; echo "$ONAME "'$@'>>"$LNAME"; chmod 773 "$LNAME"; ;;
ln -s "$ONAME" "$LNAME"; ;;
The biggest headache was getting sed to do the write thing, and I still can't get the '$' symbol to match the end of the line, so I guess this is a potential bug in my script. Fortunately none of the paths I'm applying it to have -63 in the middle so the bug hasn't caused me problems yet.
I'm thinking that I'll try it with perl instead of sed due to not being able to match the end of the line with sed.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum