Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -59,10 +59,15 @@ -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!" @@ -110,10 +115,21 @@ 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" @@ -135,11 +151,17 @@ echo "No output name specified! Use -o or --out!" exit 1 fi for i in $srcs; do - obj="${i%.m}.o" + 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" + fi objs="$objs $obj" build="no" deps=$($OBJC -E -M $CPPFLAGS $ENV_CPPFLAGS $i | \ sed 's/.*: //' | sed 's/\\//g') @@ -158,13 +180,14 @@ status_compile_failed $i $? status_compiled $i fi done -test x"$lib" = x"no" && out_suffix="$($OBJFW_CONFIG --prog-suffix)" +test x"$lib" = x"no" -a x"$plugin" = 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 Index: utils/objfw-config.in ================================================================== --- utils/objfw-config.in +++ utils/objfw-config.in @@ -14,10 +14,13 @@ 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__ @@ -114,10 +117,19 @@ 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"