Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -48,10 +48,11 @@ flags_done="no" out="" objs="" link="no" +lib="no" out_prefix="" out_suffix="" while test x"$1" != "x"; do case "$1" in @@ -75,10 +76,11 @@ 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)" ;; @@ -121,12 +123,14 @@ 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 Index: utils/objfw-config.in ================================================================== --- utils/objfw-config.in +++ utils/objfw-config.in @@ -14,10 +14,11 @@ 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: @@ -34,10 +35,11 @@ --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 } @@ -112,10 +114,13 @@ 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