Skip to content

Commit

Permalink
qb: Turn $CONFIG_DEFINES from a temporary file into a variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbea committed Nov 24, 2017
1 parent 7ac5eda commit 6351e21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ pkg/apple/iOS/modules/
obj-unix/
.vagrant/

.CONFIG_DEFINES
/pkg/msvc/Release Cg/*.exe
/pkg/msvc/Release Cg/*.iobj
/pkg/msvc/Release Cg/*.ipdb
Expand Down
15 changes: 6 additions & 9 deletions qb/qb.libs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
MAKEFILE_DEFINES=''
CONFIG_DEFINES='.CONFIG_DEFINES'
cat /dev/null > "$CONFIG_DEFINES"
#cat /dev/null > "${CONFIG_DEFINES=.CONFIG_DEFINES}"
CONFIG_DEFINES=''

[ "$PREFIX" ] || PREFIX="/usr/local"

add_define_header()
{ echo "$1=$2" >> "$CONFIG_DEFINES";}
{ CONFIG_DEFINES="${CONFIG_DEFINES} $1=$2"; }

add_define_make()
{ MAKEFILE_DEFINES="${MAKEFILE_DEFINES} $1=$2"; }
Expand Down Expand Up @@ -207,9 +205,10 @@ create_config_header()
shift
done

while IFS='=' read -r VAR VAL; do
printf %s\\n "#define $VAR $VAL"
done < "$CONFIG_DEFINES"
eval "set -- $CONFIG_DEFINES"
for VAR do
printf %s\\n "#define ${VAR%%=*} ${VAR#*=}"
done

printf %s\\n '#endif'
} > "$outfile"
Expand Down Expand Up @@ -264,5 +263,3 @@ create_config_make()
}

. qb/config.libs.sh

rm -f -- "$CONFIG_DEFINES"

0 comments on commit 6351e21

Please sign in to comment.