Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -24,15 +24,30 @@ 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)" +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 --objcflags) -Wall -g" -LIBS="$LIBS $($OBJFW_CONFIG --libs)" -LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --ldflags --rpath)" +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 @@ -101,10 +116,14 @@ 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 Index: utils/objfw-config.in ================================================================== --- utils/objfw-config.in +++ utils/objfw-config.in @@ -92,11 +92,11 @@ source "$datadir/objfw/packages/$1" } add_package_flags() { - while test -n "$1"; do + while test x"$1" != "x"; do case "$1" in --package) shift include_package "$1" ;; @@ -105,11 +105,11 @@ done } add_package_flags "$@" -while test -n "$1"; do +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"