Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -77,11 +77,10 @@ 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)" ;; -D) shift @@ -182,12 +181,17 @@ fi done test x"$lib" = x"no" -a x"$plugin" = x"no" && \ out_suffix="$($OBJFW_CONFIG --prog-suffix)" + +if test x"$lib" = x"yes"; then + export LIB="$out_prefix$out$out_suffix" + LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --lib-ldflags)" +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 Index: utils/objfw-config.in ================================================================== --- utils/objfw-config.in +++ utils/objfw-config.in @@ -82,13 +82,14 @@ fi printf "%s" "$LIB_CFLAGS" ;; --lib-ldflags) - if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then - echo "LIB_MAJOR and LIB_MINOR need to be set!" \ - 1>&2 + if test x"$LIB" = x"" -o x"$LIB_MAJOR" = x"" \ + -o x"$LIB_MINOR" = x""; then + printf "LIB, LIB_MAJOR and LIB_MINOR need " 2>&1 + echo "to be set!" 1>&2 exit 1 fi printf "%s" "$LIB_LDFLAGS" ;;