ObjFW  Check-in [6a9cca294d]

Overview
Comment:objfw-compile: Add support for --package
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6a9cca294dd873dfe2fe14be378d3a72bbf501ffbcd89a168ddb86bf1e24c6ee
User & Date: js on 2019-01-13 23:39:28
Other Links: manifest | tags
Context
2019-01-17
21:59
class_registerAlias_np(): Acquire the global mutex check-in: 1ac944d7c1 user: js tags: trunk
2019-01-13
23:39
objfw-compile: Add support for --package check-in: 6a9cca294d user: js tags: trunk
2019-01-12
19:46
objfw-config: Add support for packages check-in: 9911d60502 user: js tags: trunk
Changes

Modified utils/objfw-compile from [3fef84efeb] to [08e4a5d920].

22
23
24
25
26
27
28















29
30
31
32
33
34
35
36
37
38
39
40
fi

if ! which $OBJFW_CONFIG >/dev/null 2>&1; then
	echo "You need to have ObjFW and $OBJFW_CONFIG installed!"
	exit 1
fi
















CPPFLAGS="$CPPFLAGS $($OBJFW_CONFIG --cppflags)"
OBJC="$($OBJFW_CONFIG --objc)"
OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --objcflags) -Wall -g"
LIBS="$LIBS $($OBJFW_CONFIG --libs)"
LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --ldflags --rpath)"

if test x"$1" = "x"; then
	echo "Syntax: objfw-compile -o outname source1.m source2.m ..."
	exit 1
fi

status_compiling() {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

|
|
|







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
fi

if ! which $OBJFW_CONFIG >/dev/null 2>&1; then
	echo "You need to have ObjFW and $OBJFW_CONFIG installed!"
	exit 1
fi

parse_packages() {
	packages=""

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

CPPFLAGS="$CPPFLAGS $($OBJFW_CONFIG $packages --cppflags)"
OBJC="$($OBJFW_CONFIG --objc)"
OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG $packages --objcflags) -Wall -g"
LIBS="$LIBS $($OBJFW_CONFIG $packages --libs)"
LDFLAGS="$LDFLAGS $($OBJFW_CONFIG $packages --ldflags --rpath)"

if test x"$1" = "x"; then
	echo "Syntax: objfw-compile -o outname source1.m source2.m ..."
	exit 1
fi

status_compiling() {
99
100
101
102
103
104
105




106
107
108
109
110
111
112
			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)"




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








>
>
>
>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
			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

Modified utils/objfw-config.in from [e66fb4b258] to [3230b8f5bb].

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
117
		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"
			;;







|












|







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
117
		exit 1
	fi

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

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

add_package_flags "$@"

while test x"$1" != "x"; 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"
			;;