Debian Codegraph @

mswindows/osgeo4w/libpng-config

raw
1 #! /bin/sh
2
3 # libpng-config
4 # provides configuration info for libpng.
5
6 # Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson
7
8 # This code is released under the libpng license.
9 # For conditions of distribution and use, see the disclaimer
10 # and license in png.h
11
12 # Modeled after libxml-config.
13 # Adopted for GRASS by Huidae Cho
14
15 prefix="${OSGEO4W_ROOT_MSYS}"
16 version="$(sed '/^#define PNG_LIBPNG_VER_STRING/!d; s/^[^"]*"\|"//g' ${prefix}/include/libpng*/png.h)"
17 dll_version="$(sed '/^#define PNG_LIBPNG_VER_SHAREDLIB/!d; s/^[^0-9]*\|[^0-9]*$//g' ${prefix}/include/libpng*/png.h)"
18 exec_prefix="${prefix}"
19 libdir="${prefix}/lib"
20 includedir="${prefix}/include/libpng${dll_version}"
21 libs="-lpng${dll_version}"
22 all_libs="${libs} -lm -lz"
23 I_opts="-I${includedir}"
24 L_opts="-L${libdir}"
25 R_opts=""
26 cppflags=""
27 ccopts=""
28 ldopts=""
29
30 usage()
31 {
32 cat <<EOF
33 Usage: $0 [OPTION] ...
34
35 Known values for OPTION are:
36
37 --prefix print libpng prefix
38 --libdir print path to directory containing library
39 --libs print library linking information
40 --ccopts print compiler options
41 --cppflags print pre-processor flags
42 --cflags print preprocessor flags, I_opts, and compiler options
43 --I_opts print "-I" include options
44 --L_opts print linker "-L" flags for dynamic linking
45 --R_opts print dynamic linker "-R" or "-rpath" flags
46 --ldopts print linker options
47 --ldflags print linker flags (ldopts, L_opts, R_opts, and libs)
48 --static revise subsequent outputs for static linking
49 --help print this help and exit
50 --dll-version print DLL version information
51 --version print version information
52 EOF
53
54 exit $1
55 }
56
57 if test $# -eq 0; then
58 usage 1
59 fi
60
61 while test $# -gt 0; do
62 case "$1" in
63
64 --prefix)
65 echo ${prefix}
66 ;;
67
68 --version)
69 echo ${version}
70 exit 0
71 ;;
72
73 --dll-version)
74 echo ${dll_version}
75 exit 0
76 ;;
77
78 --help)
79 usage 0
80 ;;
81
82 --ccopts)
83 echo ${ccopts}
84 ;;
85
86 --cppflags)
87 echo ${cppflags}
88 ;;
89
90 --cflags)
91 echo ${I_opts} ${cppflags} ${ccopts}
92 ;;
93
94 --libdir)
95 echo ${libdir}
96 ;;
97
98 --libs)
99 echo ${libs}
100 ;;
101
102 --I_opts)
103 echo ${I_opts}
104 ;;
105
106 --L_opts)
107 echo ${L_opts}
108 ;;
109
110 --R_opts)
111 echo ${R_opts}
112 ;;
113
114 --ldopts)
115 echo ${ldopts}
116 ;;
117
118 --ldflags)
119 echo ${ldopts} ${L_opts} ${R_opts} ${libs}
120 ;;
121
122 --static)
123 R_opts=""
124 libs=${all_libs}
125 ;;
126
127 *)
128 usage
129 exit 1
130 ;;
131 esac
132 shift
133 done
134
135 exit 0