ObjFW  Check-in [431d44b911]

Overview
Comment:Add support for PROG_SUFFIX to objfw-config and objfw-compile.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 431d44b91199a4af6bb965671199c38515ef81226a0f17cb3ad4e5ce40645a79
User & Date: js on 2010-11-01 20:33:15
Other Links: manifest | tags
Context
2010-11-06
11:27
Add -[OFArray objectsInRange:]. check-in: 009bf787e3 user: js tags: trunk
2010-11-01
20:33
Add support for PROG_SUFFIX to objfw-config and objfw-compile. check-in: 431d44b911 user: js tags: trunk
13:37
Update PLATFORMS. check-in: c1d2ff2b95 user: js tags: trunk
Changes

Modified utils/objfw-compile from [32d4cb25d4] to [505c826ae7].

46
47
48
49
50
51
52

53
54
55
56
57
58
59
	exit $2
}

flags_done="no"
out=""
objs=""
link="no"

out_prefix=""
out_suffix=""

while test x"$1" != "x"; do
	case "$1" in
		-o|--out)
			shift







>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
	exit $2
}

flags_done="no"
out=""
objs=""
link="no"
lib="no"
out_prefix=""
out_suffix=""

while test x"$1" != "x"; do
	case "$1" in
		-o|--out)
			shift
73
74
75
76
77
78
79

80
81
82
83
84
85
86
				echo "$1 is not a valid library version!"
				exit 1
			fi

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


			OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --lib-cflags)"
			LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --lib-ldflags)"
			out_prefix="$($OBJFW_CONFIG --lib-prefix)"
			out_suffix="$($OBJFW_CONFIG --lib-suffix)"
			;;
		-*)
			echo "Unknown option: $1"







>







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
				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)"
			LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --lib-ldflags)"
			out_prefix="$($OBJFW_CONFIG --lib-prefix)"
			out_suffix="$($OBJFW_CONFIG --lib-suffix)"
			;;
		-*)
			echo "Unknown option: $1"
119
120
121
122
123
124
125


126
127
128
129
130
131
132
	shift
done

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



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







>
>







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	shift
done

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

test x"$lib" = x"no" && 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 [602bb6b3fd] to [8395f387d0].

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
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@"

VERSION="0.4-dev"

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

	--all		Outputs all flags + libs
	--cflags	Outputs the required CFLAGS
	--cppflags	Outputs the required CPPFLAGS
	--cxxflags	Outputs the required CXXFLAGS
	--objc		Outputs the OBJC used to compile ObjFW
	--objcflags	Outputs the required OBJCFLAGS
	--ldflags	Outputs the required LDFLAGS
	--reexport	Outputs LDFLAGS to reexport ObjFW
	--rpath		Outputs LDFLAGS for using rpath
	--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"

	--version	Outputs the installed version
__EOF__
	exit 0
}

test -z "$1" && show_help








>




















>







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
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@"
PROG_SUFFIX="@EXEEXT@"
VERSION="0.4-dev"

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

	--all		Outputs all flags + libs
	--cflags	Outputs the required CFLAGS
	--cppflags	Outputs the required CPPFLAGS
	--cxxflags	Outputs the required CXXFLAGS
	--objc		Outputs the OBJC used to compile ObjFW
	--objcflags	Outputs the required OBJCFLAGS
	--ldflags	Outputs the required LDFLAGS
	--reexport	Outputs LDFLAGS to reexport ObjFW
	--rpath		Outputs LDFLAGS for using rpath
	--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"
	--prog-suffix	Outputs the suffix for binaries"
	--version	Outputs the installed version
__EOF__
	exit 0
}

test -z "$1" && show_help

110
111
112
113
114
115
116



117
118
119
120
121
122
123
124
125
126
127
128
129
			;;
		--reexport)
			printf "%s" "$LDFLAGS_REEXPORT"
			;;
		--rpath)
			printf "%s" "$LDFLAGS_RPATH"
			;;



		--version)
			printf "%s" "$VERSION"
			;;
		*)
			echo "Invalid option: $1" 1>&2
			exit 1
			;;
	esac

	shift
done

echo







>
>
>













112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
			;;
		--reexport)
			printf "%s" "$LDFLAGS_REEXPORT"
			;;
		--rpath)
			printf "%s" "$LDFLAGS_RPATH"
			;;
		--prog-suffix)
			printf "%s" "$PROG_SUFFIX"
			;;
		--version)
			printf "%s" "$VERSION"
			;;
		*)
			echo "Invalid option: $1" 1>&2
			exit 1
			;;
	esac

	shift
done

echo