mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Updated scripts/makefile.msys, options.awk, and vers.dfn
This commit is contained in:
parent
572ba70905
commit
10303740d1
@ -43,7 +43,7 @@ LN_SF=ln -sf
|
||||
|
||||
#ARCH = -march=pentium3
|
||||
#ARCH = -march=i686
|
||||
ARCH =
|
||||
ARCH =
|
||||
CDEBUG = -g -DPNG_DEBUG=5
|
||||
LDDEBUG =
|
||||
CRELEASE = -O2
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,18 +9,11 @@
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define HEADER PNG_DEFN_MAGIC-PNGLIB_LIBNAME {global:-PNG_DEFN_END
|
||||
|
||||
/* NOTE: PNG_JOIN is interpreted by the calling script as a signal to
|
||||
* join the two things on either side, so we can do symbol
|
||||
* substitution within the name, regular C ## joins the pp-tokens,
|
||||
* not their final values.
|
||||
*/
|
||||
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
PNG_DEFN_MAGIC- SYMBOL_PREFIX PNG_JOIN name;-PNG_DEFN_END
|
||||
PNG_DFN " @" SYMBOL_PREFIX "@@" name "@;"
|
||||
|
||||
#define TRAILER PNG_DEFN_MAGIC-local: *; };-PNG_DEFN_END
|
||||
PNG_DFN "@" PNGLIB_LIBNAME "@ {global:"
|
||||
|
||||
HEADER
|
||||
#include "../png.h"
|
||||
TRAILER
|
||||
|
||||
PNG_DFN "local: *; };"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user