ObjFW  Check-in [478feb4614]

Overview
Comment:Style change: Don't indent cases in shell scripts
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 478feb461404827d13c62a258554e5e46d6db515d4b5e6be49003a9cea9bdeb7
User & Date: js on 2020-12-22 23:10:48
Other Links: manifest | tags
Context
2020-12-22
23:20
Don't use fcntl() on MorphOS / AmigaOS check-in: a32bbc81fe user: js tags: trunk
23:10
Style change: Don't indent cases in shell scripts check-in: 478feb4614 user: js tags: trunk
23:04
Update buildsys check-in: 0a58a95122 user: js tags: trunk
Changes

Modified .travis/before_install.sh from [479fa2374a] to [bab3d81641].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then
	case "$TRAVIS_CPU_ARCH" in
		amd64 | s390x)
			pkgs="gobjc-multilib"
			;;
		*)
			pkgs="gobjc"
			;;
	esac

	pkgs="$pkgs libsctp-dev"

	if grep precise /etc/lsb-release >/dev/null; then
		pkgs="$pkgs ipx"
	fi



|
|
|
|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then
	case "$TRAVIS_CPU_ARCH" in
	amd64 | s390x)
		pkgs="gobjc-multilib"
		;;
	*)
		pkgs="gobjc"
		;;
	esac

	pkgs="$pkgs libsctp-dev"

	if grep precise /etc/lsb-release >/dev/null; then
		pkgs="$pkgs ipx"
	fi

Modified .travis/script.sh from [6432052d0a] to [d2b60e0160].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
}

if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then
	build_32_64() {
		build OBJC="$CC" $@

		case "$TRAVIS_CPU_ARCH" in
			amd64)
				build OBJC="$CC -m32" \
					--host=i686-pc-linux-gnu $@
				;;
			s390x)
				build OBJC="$CC -m31" \
					--host=s390-pc-linux-gnu $@
				;;
		esac
	}

	build_32_64
	build_32_64 --enable-seluid24
	build_32_64 --disable-compiler-tls








|
|
<
|
|
|
<
|







10
11
12
13
14
15
16
17
18

19
20
21

22
23
24
25
26
27
28
29
}

if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then
	build_32_64() {
		build OBJC="$CC" $@

		case "$TRAVIS_CPU_ARCH" in
		amd64)
			build OBJC="$CC -m32" --host=i686-pc-linux-gnu $@

			;;
		s390x)
			build OBJC="$CC -m31" --host=s390-pc-linux-gnu $@

			;;
		esac
	}

	build_32_64
	build_32_64 --enable-seluid24
	build_32_64 --disable-compiler-tls

Modified utils/objfw-compile from [8cbd1f94ba] to [b60ea87171].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
fi

parse_packages() {
	packages=""

	while test x"$1" != "x"; do
		case "$1" in
			--package)
				shift
				packages="$packages --package $1"
				;;
		esac
		shift
	done
}
parse_packages "$@"

show_help() {







|
|
|
|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
fi

parse_packages() {
	packages=""

	while test x"$1" != "x"; do
		case "$1" in
		--package)
			shift
			packages="$packages --package $1"
			;;
		esac
		shift
	done
}
parse_packages "$@"

show_help() {
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
lib="no"
plugin="no"
out_prefix=""
out_suffix=""

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

			export LIB_MAJOR="${1%.*}"
			export LIB_MINOR="${1#*.}"

			lib="yes"
			OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --lib-cflags)"
			out_prefix="$($OBJFW_CONFIG --lib-prefix)"
			out_suffix="$($OBJFW_CONFIG --lib-suffix)"
			;;
		--package)
			# Already included into the flags.
			shift
			;;
		--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)"
			;;
		--arc)
			OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --arc)"
			;;
		--builddir)
			shift
			builddir="$1"
			;;
		-D)
			shift
			CPPFLAGS="$CPPFLAGS -D$1"
			;;
		-D*)
			CPPFLAGS="$CPPFLAGS $1"
			;;
		-framework)
			shift
			LIBS="$LIBS -framework $1"
			;;
		-f*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		-F)
			shift
			LIBS="$LIBS -F$1"
			;;
		-F*)
			LIBS="$LIBS $1"
			;;
		-g*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		-I)
			shift
			CPPFLAGS="$CPPFLAGS -I$1"
			;;
		-I*)
			CPPFLAGS="$CPPFLAGS $1"
			;;
		-l)
			shift
			LIBS="$LIBS -l$1"
			;;
		-l*)
			LIBS="$LIBS $1"
			;;
		-L)
			shift
			LIBS="$LIBS -L$1"
			;;
		-L*)
			LIBS="$LIBS $1"
			;;
		-m*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		-O*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		-pthread)
			OBJCFLAGS="$OBJCFLAGS $1"
			LDFLAGS="$LDFLAGS $1"
			;;
		-std=*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		-Wl,*)
			LDFLAGS="$LDFLAGS $1"
			;;
		-W*)
			OBJCFLAGS="$OBJCFLAGS $1"
			;;
		--help)
			show_help
			exit 0
			;;
		-*)
			echo "Unknown option: $1"
			exit 1
			;;
		*.m)
			srcs="$srcs $1"
			;;
		*.mm)
			srcs="$srcs $1"
			link_stdcpp="yes"
			;;
		*)
			echo "Only .m and .mm files can be compiled!" 1>&2
			exit 1
			;;
	esac

	shift
done

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

case "$builddir" in
	"")
		;;
	*/)
		;;
	*)
		builddir="$builddir/"
		;;
esac

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

	if test -f "$obj"; then







|
|
|
|
|
|
|
|
|

|

|
<
|
|
|

|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|











|
|
|
|
|
|
|




|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
lib="no"
plugin="no"
out_prefix=""
out_suffix=""

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

		export LIB_MAJOR="${1%.*}"
		export LIB_MINOR="${1#*.}"

		lib="yes"
		OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --lib-cflags)"
		out_prefix="$($OBJFW_CONFIG --lib-prefix)"
		out_suffix="$($OBJFW_CONFIG --lib-suffix)"
		;;
	--package)
		# Already included into the flags.
		shift
		;;
	--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)"
		;;
	--arc)
		OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --arc)"
		;;
	--builddir)
		shift
		builddir="$1"
		;;
	-D)
		shift
		CPPFLAGS="$CPPFLAGS -D$1"
		;;
	-D*)
		CPPFLAGS="$CPPFLAGS $1"
		;;
	-framework)
		shift
		LIBS="$LIBS -framework $1"
		;;
	-f*)
		OBJCFLAGS="$OBJCFLAGS $1"
		;;
	-F)
		shift
		LIBS="$LIBS -F$1"
		;;
	-F*)
		LIBS="$LIBS $1"
		;;
	-g*)
		OBJCFLAGS="$OBJCFLAGS $1"
		;;
	-I)
		shift
		CPPFLAGS="$CPPFLAGS -I$1"
		;;
	-I*)
		CPPFLAGS="$CPPFLAGS $1"
		;;
	-l)
		shift
		LIBS="$LIBS -l$1"
		;;
	-l*)
		LIBS="$LIBS $1"
		;;
	-L)
		shift
		LIBS="$LIBS -L$1"
		;;
	-L*)
		LIBS="$LIBS $1"
		;;
	-m*)
		OBJCFLAGS="$OBJCFLAGS $1"
		;;
	-O*)
		OBJCFLAGS="$OBJCFLAGS $1"
		;;
	-pthread)
		OBJCFLAGS="$OBJCFLAGS $1"
		LDFLAGS="$LDFLAGS $1"
		;;
	-std=*)
		OBJCFLAGS="$OBJCFLAGS $1"
		;;
	-Wl,*)
		LDFLAGS="$LDFLAGS $1"
		;;
	-W*)
		OBJCFLAGS="$OBJCFLAGS $1"
		;;
	--help)
		show_help
		exit 0
		;;
	-*)
		echo "Unknown option: $1"
		exit 1
		;;
	*.m)
		srcs="$srcs $1"
		;;
	*.mm)
		srcs="$srcs $1"
		link_stdcpp="yes"
		;;
	*)
		echo "Only .m and .mm files can be compiled!" 1>&2
		exit 1
		;;
	esac

	shift
done

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

case "$builddir" in
"")
	;;
*/)
	;;
*)
	builddir="$builddir/"
	;;
esac

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

	if test -f "$obj"; then

Modified utils/objfw-config.in from [c6ea4d4954] to [2216243706].

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
	. "$packagesdir/$1.oc"
	set +e
}

parse_packages() {
	while test x"$1" != "x"; do
		case "$1" in
			--package)
				shift
				package_depends_on "$1"
				;;
		esac
		shift
	done
}
parse_packages "$@"

flag_printed="no"
output_flag() {
	if test x"$flag_printed" = x"yes"; then
		printf " %s" "$1"
	else
		printf "%s" "$1"
		flag_printed="yes"
	fi
}

while test x"$1" != "x"; do
	case "$1" in
		--all)
			output_flag "$CFLAGS $CPPFLAGS $CXXFLAGS $OBJCFLAGS"
			output_flag "$LDFLAGS $LDFLAGS_REEXPORT $LDFLAGS_RPATH"
			output_flag "$LIBS"
			;;
		--arc)
			output_flag "-fobjc-arc -fobjc-arc-exceptions"
			;;
		--cflags)
			output_flag "$CFLAGS"
			;;
		--cppflags)
			output_flag "$CPPFLAGS"
			;;
		--cxxflags)
			output_flag "$CXXFLAGS"
			;;
		--framework-libs)
			output_flag "$FRAMEWORK_LIBS"
			;;
		--help)
			show_help 0
			;;
		--objc)
			output_flag "$OBJC"
			;;
		--objcflags)
			output_flag "$OBJCFLAGS"
			;;
		--libs)
			output_flag "$LIBS"
			;;
		--lib-cflags)
			if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then
				echo "LIB_MAJOR and LIB_MINOR need to be set!" \
					1>&2
				exit 1
			fi

			output_flag "$LIB_CFLAGS"
			;;
		--lib-ldflags)
			if test x"$SHARED_LIB" = x"" -o x"$LIB_MAJOR" = x"" \
			-o x"$LIB_MINOR" = x""; then
				printf "SHARED_LIB, LIB_MAJOR and " 2>&1
				echo "LIB_MINOR need to be set!" 1>&2
				exit 1
			fi

			output_flag "$LIB_LDFLAGS"
			;;
		--lib-prefix)
			if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then
				echo "LIB_MAJOR and LIB_MINOR need to be set!" \
					1>&2
				exit 1
			fi

			output_flag "$LIB_PREFIX"
			;;
		--lib-suffix)
			if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then
				echo "LIB_MAJOR and LIB_MINOR need to be set!" \
					1>&2
				exit 1
			fi

			output_flag "$LIB_SUFFIX"
			;;
		--ldflags)
			output_flag "$LDFLAGS"
			;;
		--reexport)
			output_flag "$LDFLAGS_REEXPORT"
			;;
		--rpath)
			output_flag "$LDFLAGS_RPATH"
			;;
		--package)
			# Already included into the flags.
			shift
			;;
		--packages-dir)
			output_flag "$packagesdir"
			;;
		--plugin-cflags)
			output_flag "$PLUGIN_CFLAGS"
			;;
		--plugin-ldflags)
			output_flag "$PLUGIN_LDFLAGS"
			;;
		--plugin-suffix)
			output_flag "$PLUGIN_SUFFIX"
			;;
		--prog-suffix)
			output_flag "$PROG_SUFFIX"
			;;
		--static-libs)
			output_flag "$STATIC_LIBS"
			;;
		--version)
			output_flag "$VERSION"
			;;
		*)
			echo "Invalid option: $1" 1>&2
			exit 1
			;;
	esac
	shift
done

test x"$flag_printed" = x"yes" && echo
exit 0







|
|
|
|


















|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|

|
|
|
|
|
|
|
|
|

|
|
|
|
|
<
|
|

|
|
|
|
|
<
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|






94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174

175
176
177
178
179
180
181
182

183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
	. "$packagesdir/$1.oc"
	set +e
}

parse_packages() {
	while test x"$1" != "x"; do
		case "$1" in
		--package)
			shift
			package_depends_on "$1"
			;;
		esac
		shift
	done
}
parse_packages "$@"

flag_printed="no"
output_flag() {
	if test x"$flag_printed" = x"yes"; then
		printf " %s" "$1"
	else
		printf "%s" "$1"
		flag_printed="yes"
	fi
}

while test x"$1" != "x"; do
	case "$1" in
	--all)
		output_flag "$CFLAGS $CPPFLAGS $CXXFLAGS $OBJCFLAGS"
		output_flag "$LDFLAGS $LDFLAGS_REEXPORT $LDFLAGS_RPATH $LIBS"

		;;
	--arc)
		output_flag "-fobjc-arc -fobjc-arc-exceptions"
		;;
	--cflags)
		output_flag "$CFLAGS"
		;;
	--cppflags)
		output_flag "$CPPFLAGS"
		;;
	--cxxflags)
		output_flag "$CXXFLAGS"
		;;
	--framework-libs)
		output_flag "$FRAMEWORK_LIBS"
		;;
	--help)
		show_help 0
		;;
	--objc)
		output_flag "$OBJC"
		;;
	--objcflags)
		output_flag "$OBJCFLAGS"
		;;
	--libs)
		output_flag "$LIBS"
		;;
	--lib-cflags)
		if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then
			echo "LIB_MAJOR and LIB_MINOR need to be set!" 1>&2

			exit 1
		fi

		output_flag "$LIB_CFLAGS"
		;;
	--lib-ldflags)
		if test x"$SHARED_LIB" = x"" -o x"$LIB_MAJOR" = x"" \
		    -o x"$LIB_MINOR" = x""; then
			printf "SHARED_LIB, LIB_MAJOR and " 2>&1
			echo "LIB_MINOR need to be set!" 1>&2
			exit 1
		fi

		output_flag "$LIB_LDFLAGS"
		;;
	--lib-prefix)
		if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then
			echo "LIB_MAJOR and LIB_MINOR need to be set!" 1>&2

			exit 1
		fi

		output_flag "$LIB_PREFIX"
		;;
	--lib-suffix)
		if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then
			echo "LIB_MAJOR and LIB_MINOR need to be set!" 1>&2

			exit 1
		fi

		output_flag "$LIB_SUFFIX"
		;;
	--ldflags)
		output_flag "$LDFLAGS"
		;;
	--reexport)
		output_flag "$LDFLAGS_REEXPORT"
		;;
	--rpath)
		output_flag "$LDFLAGS_RPATH"
		;;
	--package)
		# Already included into the flags.
		shift
		;;
	--packages-dir)
		output_flag "$packagesdir"
		;;
	--plugin-cflags)
		output_flag "$PLUGIN_CFLAGS"
		;;
	--plugin-ldflags)
		output_flag "$PLUGIN_LDFLAGS"
		;;
	--plugin-suffix)
		output_flag "$PLUGIN_SUFFIX"
		;;
	--prog-suffix)
		output_flag "$PROG_SUFFIX"
		;;
	--static-libs)
		output_flag "$STATIC_LIBS"
		;;
	--version)
		output_flag "$VERSION"
		;;
	*)
		echo "Invalid option: $1" 1>&2
		exit 1
		;;
	esac
	shift
done

test x"$flag_printed" = x"yes" && echo
exit 0

Modified utils/objfw-new from [c18da52b55] to [6a6815b394].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

type="$1"
name="$2"

test -z "$name" && show_help

case "$1" in
	app)
		test -f "$name.m" && already_exists "$name.m"

		cat >"$name.m" <<__EOF__
#import <ObjFW/ObjFW.h>

@interface $name: OFObject <OFApplicationDelegate>
@end

OF_APPLICATION_DELEGATE($name)

@implementation $name
- (void)applicationDidFinishLaunching
{
	[OFApplication terminate];
}
@end
__EOF__
		;;
	class)
		test -f "$name.h" && already_exists "$name.h"
		test -f "$name.m" && already_exists "$name.m"

		cat >"$name.h" <<__EOF__
#import <ObjFW/ObjFW.h>

@interface $name: OFObject
@end
__EOF__
		cat >"$name.m" <<__EOF__
#import "$name.h"

@implementation $name
@end
__EOF__
		;;
	*)
		show_help
		;;
esac







|
|

|














|
|
|
|

|











|
|
|
|

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

type="$1"
name="$2"

test -z "$name" && show_help

case "$1" in
app)
	test -f "$name.m" && already_exists "$name.m"

	cat >"$name.m" <<__EOF__
#import <ObjFW/ObjFW.h>

@interface $name: OFObject <OFApplicationDelegate>
@end

OF_APPLICATION_DELEGATE($name)

@implementation $name
- (void)applicationDidFinishLaunching
{
	[OFApplication terminate];
}
@end
__EOF__
	;;
class)
	test -f "$name.h" && already_exists "$name.h"
	test -f "$name.m" && already_exists "$name.m"

	cat >"$name.h" <<__EOF__
#import <ObjFW/ObjFW.h>

@interface $name: OFObject
@end
__EOF__
		cat >"$name.m" <<__EOF__
#import "$name.h"

@implementation $name
@end
__EOF__
	;;
*)
	show_help
	;;
esac