ObjFW  Diff

Differences From Artifact [99ed5dfce7]:

To Artifact [e66fb4b258]:


13
14
15
16
17
18
19


20
21
22
23
24
25
26
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28







+
+







#  Public License, either version 2 or 3, which can be found in the file
#  LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
#  file.
#

prefix="@prefix@"
exec_prefix="@exec_prefix@"
datarootdir="@datarootdir@"
datadir="@datadir@"
libdir="@libdir@"
CFLAGS=""
CPPFLAGS="@OBJFW_CPPFLAGS@ -I@includedir@"
CXXFLAGS=""
OBJC="@OBJC@"
OBJCFLAGS="@OBJFW_OBJCFLAGS@"
LIB_CFLAGS="@LIB_CFLAGS@"
55
56
57
58
59
60
61


62
63
64
65
66
67
68
69
70
71
72
73
74
75






























76
77
78
79
80
81
82
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116







+
+














+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







    --libs            Outputs the required LIBS
    --lib-cflags      Outputs CFLAGS for building a library
    --lib-ldflags     Outputs LDFLAGS for building a library
    --lib-prefix      Outputs the prefix for libraries
    --lib-suffix      Outputs the suffix for libraries
    --objc            Outputs the OBJC used to compile ObjFW
    --objcflags       Outputs the required OBJCFLAGS
    --package         Additionally outputs the flags for the specified package
    --packages-dir    Outputs the directory where flags for packages are stored
    --plugin-cflags   Outputs CFLAGS for building a plugin
    --plugin-ldflags  Outputs LDFLAGS for building a plugin
    --plugin-suffix   Outputs the suffix for plugins
    --prog-suffix     Outputs the suffix for binaries
    --reexport        Outputs LDFLAGS to reexport ObjFW
    --rpath           Outputs LDFLAGS for using rpath
    --static-libs     Outputs the required LIBS to link ObjFW statically
    --version         Outputs the installed version
__EOF__
	exit $1
}

test -z "$1" && show_help 1

package_version() {
	if test "$1" != "1"; then
		echo "Unsupported package version: $1"
		exit 1
	fi
}

include_package() {
	if ! test -f "$datadir/objfw/packages/$1"; then
		echo "No such package: $1"
		exit 1
	fi

	source "$datadir/objfw/packages/$1"
}

add_package_flags() {
	while test -n "$1"; do
		case "$1" in
			--package)
				shift
				include_package "$1"
				;;
		esac
		shift
	done
}

add_package_flags "$@"

while test -n "$1"; do
	case "$1" in
		--all)
			printf "%s %s %s " "$CFLAGS" "$CPPFLAGS" "$CXXFLAGS"
			printf "%s %s " "$OBJCFLAGS" "$LDFLAGS"
			printf "%s %s " "$LDFLAGS_REEXPORT" "$LDFLAGS_RPATH"
			printf "%s" "$LIBS"
150
151
152
153
154
155
156







157
158
159
160
161
162
163
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204







+
+
+
+
+
+
+







			;;
		--reexport)
			printf "%s" "$LDFLAGS_REEXPORT"
			;;
		--rpath)
			printf "%s" "$LDFLAGS_RPATH"
			;;
		--package)
			# Already included into the flags.
			shift
			;;
		--packages-dir)
			printf "%s" "$datadir/objfw/packages"
			;;
		--plugin-cflags)
			printf "%s" "$PLUGIN_CFLAGS"
			;;
		--plugin-ldflags)
			printf "%s" "$PLUGIN_LDFLAGS"
			;;
		--plugin-suffix)