ObjFW  Check-in [e0b3940077]

Overview
Comment:Add support for building plugins to objfw-compile and objfw-config.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e0b394007791862fe1df02a6cb78f48674c4ba967491db04012c35f27fcf3b28
User & Date: js on 2010-11-21 13:35:24
Other Links: manifest | tags
Context
2010-11-21
20:30
OFXMLParser: Correctly handle spaces in attributes. check-in: aba290270b user: js tags: trunk
13:35
Add support for building plugins to objfw-compile and objfw-config. check-in: e0b3940077 user: js tags: trunk
13:26
objfw-compile: Don't care about the order in which flags are specified. check-in: 5936b9f9c3 user: js tags: trunk
Changes

Modified utils/objfw-compile from [a7608ce4ad] to [782b1683dd].

57
58
59
60
61
62
63





64
65
66
67
68
69
70
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75







+
+
+
+
+







while test x"$1" != "x"; do
	case "$1" in
		-o|--out)
			shift
			out="$1"
			;;
		--lib)
			if test x"$plugin" = x"yes"; then
				echo "You can't use --lib and --plugin!"
				exit 1
			fi

			shift

			if ! echo "$1" | grep "^[0-9]\+\.[0-9]\+" >/dev/null
			then
				echo "$1 is not a valid library version!"
				exit 1
			fi
108
109
110
111
112
113
114











115
116
117
118
119
120
121
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137







+
+
+
+
+
+
+
+
+
+
+







			;;
		-L*)
			LIBS="$LIBS $1"
			;;
		-O*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		--plugin)
			if test x"$lib" = x"yes"; then
				echo "You can't use --lib and --plugin!"
				exit 1
			fi

			plugin="yes"
			OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --plugin-cflags)"
			LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --plugin-ldflags)"
			out_suffix="$($OBJFW_CONFIG --plugin-suffix)"
			;;
		-W*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		-*)
			echo "Unknown option: $1"
			exit 1
			;;
133
134
135
136
137
138
139





140


141
142
143
144
145
146
147
149
150
151
152
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
168
169







+
+
+
+
+
-
+
+








if test x"$out" = x""; then
	echo "No output name specified! Use -o or --out!"
	exit 1
fi

for i in $srcs; do
	if test x"$lib" = x"yes"; then
		obj="${i%.m}.lib.o"
	elif test x"$plugin" = x"yes"; then
		obj="${i%.m}.plugin.o"
	else
	obj="${i%.m}.o"
		obj="${i%.m}.o"
	fi
	objs="$objs $obj"
	build="no"
	deps=$($OBJC -E -M $CPPFLAGS $ENV_CPPFLAGS $i | \
	       sed 's/.*: //' | sed 's/\\//g')

	if test -f "$obj"; then
		for dep in $deps; do
156
157
158
159
160
161
162

163

164
165
166
167
168
169
170
178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193







+
-
+







		status_compiling $i
		$OBJC $CPPFLAGS $OBJCFLAGS -c -o $obj $i || \
			status_compile_failed $i $?
		status_compiled $i
	fi
done

test x"$lib" = x"no" -a x"$plugin" = x"no" && \
test x"$lib" = x"no" && out_suffix="$($OBJFW_CONFIG --prog-suffix)"
	out_suffix="$($OBJFW_CONFIG --prog-suffix)"

if test ! -f "$out_prefix$out$out_suffix" -o x"$link" = x"yes"; then
	status_linking $out_prefix$out$out_suffix
	$OBJC -o $out_prefix$out$out_suffix $objs $LIBS $ENV_LIBS $LDFLAGS \
		$ENV_LDFLAGS || status_link_failed $out $?
	status_linked $out_prefix$out$out_suffix
fi

Modified utils/objfw-config.in from [8395f387d0] to [7edc8114c5].

12
13
14
15
16
17
18



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







+
+
+







LIB_LDFLAGS="@LIB_LDFLAGS@"
LIB_PREFIX="@LIB_PREFIX@"
LIB_SUFFIX="@LIB_SUFFIX@"
LDFLAGS=""
LDFLAGS_REEXPORT="@LDFLAGS_REEXPORT@"
LDFLAGS_RPATH="@LDFLAGS_RPATH@"
LIBS="-L${libdir} -lobjfw @LIBS@"
PLUGIN_CFLAGS="@PLUGIN_CFLAGS@"
PLUGIN_LDFLAGS="@PLUGIN_LDFLAGS@"
PLUGIN_SUFFIX="@PLUGIN_SUFFIX@"
PROG_SUFFIX="@EXEEXT@"
VERSION="0.4-dev"

show_help() {
	cat <<__EOF__
objfw-config: Available arguments are:

112
113
114
115
116
117
118









119
120
121
122
123
124
125
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137







+
+
+
+
+
+
+
+
+







			;;
		--reexport)
			printf "%s" "$LDFLAGS_REEXPORT"
			;;
		--rpath)
			printf "%s" "$LDFLAGS_RPATH"
			;;
		--plugin-cflags)
			printf "%s" "$PLUGIN_CFLAGS"
			;;
		--plugin-ldflags)
			printf "%s" "$PLUGIN_LDFLAGS"
			;;
		--plugin-suffix)
			printf "%s" "$PLUGIN_SUFFIX"
			;;
		--prog-suffix)
			printf "%s" "$PROG_SUFFIX"
			;;
		--version)
			printf "%s" "$VERSION"
			;;
		*)