[libpng15] Updated scripts/makefile.msys, options.awk, and vers.dfn

This commit is contained in:
John Bowler
2013-02-05 07:30:11 -06:00
committed by Glenn Randers-Pehrson
parent 572ba70905
commit 10303740d1
3 changed files with 32 additions and 24 deletions

View File

@@ -35,17 +35,26 @@ BEGIN{
version="libpng version unknown" # version information
version_file="" # where to find the version
err=0 # in-line exit sets this
start="PNG_DEFN_MAGIC-" # Arbitrary start
end="-PNG_DEFN_END" # Arbitrary end
ct="PNG_JOIN" # Join two tokens
cx= "/" ct "*" # Open C comment for output file
comment=start cx # Comment start
# The following definitions prevent the C preprocessor noticing the lines
# that will be in the final output file. Some C preprocessors tokenise
# the lines, for example by inserting spaces around operators, and all
# C preprocessors notice lines that start with '#', most remove comments.
# The technique adopted here is to make the final output lines into
# C strings (enclosed in double quotes), preceeded by PNG_DFN. As a
# consequence the output cannot contain a 'raw' double quote - instead put
# @' in, this will be replaced by a single " afterward. See the parser
# script dfn.awk for more capabilities (not required here). Note that if
# you need a " in a 'setting' in pnglibconf.dfa it must also be @'!
dq="@'" # For a single double quote
start=" PNG_DFN \"" # Start stuff to output (can't contain a "!)
end="\" " # End stuff to output
comment=start "/*" # Comment start
cend="*/" end # Comment end
def=start "#define PNG_" ct # Arbitrary define
sup=ct "_SUPPORTED 1" end # end supported option
und=comment "#undef PNG_" ct # Unsupported option
une=ct "_SUPPORTED" cend # end unsupported option
error=start "ERROR:" # error message
def=start "#define PNG_" # Arbitrary define
sup="_SUPPORTED 1" end # end supported option
und=comment "#undef PNG_" # Unsupported option
une="_SUPPORTED" cend # end unsupported option
error=start "ERROR:" # error message, terminate with 'end'
# Variables
deb=0 # debug - set on command line
@@ -102,7 +111,6 @@ pre && version == "search" && version_file != FILENAME{
pre && version == "search" && $0 ~ /^ \* libpng version/{
version = substr($0, 4)
gsub(/\./, " PNG_JOIN . PNG_JOIN", version)
print "version =", version >out
next
}
@@ -468,6 +476,8 @@ END{
print "" >out
print "/* SETTINGS */" >out
print comment, "settings", cend >out
# Sort (in dfn.awk) on field 2, the setting name
print "PNG_DFN_START_SORT 2" >out
finished = 0
while (!finished) {
finished = 1
@@ -524,6 +534,7 @@ END{
exit 1
}
}
print "PNG_DFN_END_SORT" >out
print comment, "end of settings", cend >out
# Now do the options - somewhat more complex. The dependency
@@ -618,6 +629,9 @@ END{
}
if (err) exit 1
# Sort options too
print "PNG_DFN_START_SORT 2" >out
# option[i] is now the complete list of all the tokens we may
# need to output, go through it as above, depth first.
finished = 0
@@ -769,10 +783,11 @@ END{
exit 1
}
}
print "PNG_DFN_END_SORT" >out
print comment, "end of options", cend >out
# Regular end - everything looks ok
if (protect != "") {
print start "#endif", cx, protect, "*/" end >out
print start "#endif", "/*", protect, "*/" end >out
}
}