Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -64,10 +64,11 @@ srcs="" out="" objs="" link="no" +link_stdcpp="no" lib="no" out_prefix="" out_suffix="" while test x"$1" != "x"; do @@ -158,12 +159,16 @@ exit 1 ;; *.m) srcs="$srcs $1" ;; + *.mm) + srcs="$srcs $1" + link_stdcpp="yes" + ;; *) - echo "Only .m files can be compiled!" 1>&2 + echo "Only .m and .mm files can be compiled!" 1>&2 exit 1 ;; esac shift @@ -173,17 +178,30 @@ echo "No output name specified! Use -o or --out!" exit 1 fi for i in $srcs; do - 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 + case $i in + *.m) + 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 + ;; + *.mm) + if test x"$lib" = x"yes"; then + obj="${i%.mm}.lib.o" + elif test x"$plugin" = x"yes"; then + obj="${i%.mm}.plugin.o" + else + obj="${i%.mm}.o" + fi + ;; + esac objs="$objs $obj" build="no" deps=$($OBJC -E -M $CPPFLAGS $i | sed 's/.*: //' | sed 's/\\//g') if test -f "$obj"; then @@ -203,10 +221,12 @@ fi done test x"$lib" = x"no" -a x"$plugin" = x"no" && \ out_suffix="$($OBJFW_CONFIG --prog-suffix)" + +test x"$link_stdcpp" = x"yes" && LIBS="$LIBS -lstdc++" if test x"$lib" = x"yes"; then export LIB="$out_prefix$out$out_suffix" LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --lib-ldflags)" fi