Index: .travis/before_install.sh ================================================================== --- .travis/before_install.sh +++ .travis/before_install.sh @@ -1,14 +1,14 @@ #!/bin/sh if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then case "$TRAVIS_CPU_ARCH" in - amd64 | s390x) - pkgs="gobjc-multilib" - ;; - *) - pkgs="gobjc" - ;; + amd64 | s390x) + pkgs="gobjc-multilib" + ;; + *) + pkgs="gobjc" + ;; esac pkgs="$pkgs libsctp-dev" if grep precise /etc/lsb-release >/dev/null; then Index: .travis/script.sh ================================================================== --- .travis/script.sh +++ .travis/script.sh @@ -12,18 +12,16 @@ if [ "$TRAVIS_OS_NAME" = "linux" -a -z "$config" ]; then build_32_64() { build OBJC="$CC" $@ case "$TRAVIS_CPU_ARCH" in - amd64) - build OBJC="$CC -m32" \ - --host=i686-pc-linux-gnu $@ - ;; - s390x) - build OBJC="$CC -m31" \ - --host=s390-pc-linux-gnu $@ - ;; + amd64) + build OBJC="$CC -m32" --host=i686-pc-linux-gnu $@ + ;; + s390x) + build OBJC="$CC -m31" --host=s390-pc-linux-gnu $@ + ;; esac } build_32_64 build_32_64 --enable-seluid24 Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -30,14 +30,14 @@ parse_packages() { packages="" while test x"$1" != "x"; do case "$1" in - --package) - shift - packages="$packages --package $1" - ;; + --package) + shift + packages="$packages --package $1" + ;; esac shift done } parse_packages "$@" @@ -122,141 +122,140 @@ out_prefix="" out_suffix="" while test x"$1" != "x"; do case "$1" in - -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!" - exit 1 - fi - - export LIB_MAJOR="${1%.*}" - export LIB_MINOR="${1#*.}" - - 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 - fi - - plugin="yes" - OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --plugin-cflags)" - LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --plugin-ldflags)" - out_suffix="$($OBJFW_CONFIG --plugin-suffix)" - ;; - --arc) - OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --arc)" - ;; - --builddir) - shift - builddir="$1" - ;; - -D) - shift - CPPFLAGS="$CPPFLAGS -D$1" - ;; - -D*) - CPPFLAGS="$CPPFLAGS $1" - ;; - -framework) - shift - LIBS="$LIBS -framework $1" - ;; - -f*) - OBJCFLAGS="$OBJCFLAGS $1" - ;; - -F) - shift - LIBS="$LIBS -F$1" - ;; - -F*) - LIBS="$LIBS $1" - ;; - -g*) - OBJCFLAGS="$OBJCFLAGS $1" - ;; - -I) - shift - CPPFLAGS="$CPPFLAGS -I$1" - ;; - -I*) - CPPFLAGS="$CPPFLAGS $1" - ;; - -l) - shift - LIBS="$LIBS -l$1" - ;; - -l*) - LIBS="$LIBS $1" - ;; - -L) - shift - LIBS="$LIBS -L$1" - ;; - -L*) - LIBS="$LIBS $1" - ;; - -m*) - OBJCFLAGS="$OBJCFLAGS $1" - ;; - -O*) - OBJCFLAGS="$OBJCFLAGS $1" - ;; - -pthread) - OBJCFLAGS="$OBJCFLAGS $1" - LDFLAGS="$LDFLAGS $1" - ;; - -std=*) - OBJCFLAGS="$OBJCFLAGS $1" - ;; - -Wl,*) - LDFLAGS="$LDFLAGS $1" - ;; - -W*) - OBJCFLAGS="$OBJCFLAGS $1" - ;; - --help) - show_help - exit 0 - ;; - -*) - echo "Unknown option: $1" - exit 1 - ;; - *.m) - srcs="$srcs $1" - ;; - *.mm) - srcs="$srcs $1" - link_stdcpp="yes" - ;; - *) - echo "Only .m and .mm files can be compiled!" 1>&2 - exit 1 - ;; + -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!" + exit 1 + fi + + export LIB_MAJOR="${1%.*}" + export LIB_MINOR="${1#*.}" + + 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 + fi + + plugin="yes" + OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --plugin-cflags)" + LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --plugin-ldflags)" + out_suffix="$($OBJFW_CONFIG --plugin-suffix)" + ;; + --arc) + OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --arc)" + ;; + --builddir) + shift + builddir="$1" + ;; + -D) + shift + CPPFLAGS="$CPPFLAGS -D$1" + ;; + -D*) + CPPFLAGS="$CPPFLAGS $1" + ;; + -framework) + shift + LIBS="$LIBS -framework $1" + ;; + -f*) + OBJCFLAGS="$OBJCFLAGS $1" + ;; + -F) + shift + LIBS="$LIBS -F$1" + ;; + -F*) + LIBS="$LIBS $1" + ;; + -g*) + OBJCFLAGS="$OBJCFLAGS $1" + ;; + -I) + shift + CPPFLAGS="$CPPFLAGS -I$1" + ;; + -I*) + CPPFLAGS="$CPPFLAGS $1" + ;; + -l) + shift + LIBS="$LIBS -l$1" + ;; + -l*) + LIBS="$LIBS $1" + ;; + -L) + shift + LIBS="$LIBS -L$1" + ;; + -L*) + LIBS="$LIBS $1" + ;; + -m*) + OBJCFLAGS="$OBJCFLAGS $1" + ;; + -O*) + OBJCFLAGS="$OBJCFLAGS $1" + ;; + -pthread) + OBJCFLAGS="$OBJCFLAGS $1" + LDFLAGS="$LDFLAGS $1" + ;; + -std=*) + OBJCFLAGS="$OBJCFLAGS $1" + ;; + -Wl,*) + LDFLAGS="$LDFLAGS $1" + ;; + -W*) + OBJCFLAGS="$OBJCFLAGS $1" + ;; + --help) + show_help + exit 0 + ;; + -*) + echo "Unknown option: $1" + exit 1 + ;; + *.m) + srcs="$srcs $1" + ;; + *.mm) + srcs="$srcs $1" + link_stdcpp="yes" + ;; + *) + echo "Only .m and .mm files can be compiled!" 1>&2 + exit 1 + ;; esac shift done @@ -264,39 +263,39 @@ echo "No output name specified! Use -o or --out!" exit 1 fi case "$builddir" in - "") - ;; - */) - ;; - *) - builddir="$builddir/" - ;; +"") + ;; +*/) + ;; +*) + builddir="$builddir/" + ;; esac for i in $srcs; do case $i in - *.m) - if test x"$lib" = x"yes"; then - obj="$builddir${i%.m}.lib.o" - elif test x"$plugin" = x"yes"; then - obj="$builddir${i%.m}.plugin.o" - else - obj="$builddir${i%.m}.o" - fi - ;; - *.mm) - if test x"$lib" = x"yes"; then - obj="$builddir${i%.mm}.lib.o" - elif test x"$plugin" = x"yes"; then - obj="$builddir${i%.mm}.plugin.o" - else - obj="$builddir${i%.mm}.o" - fi - ;; + *.m) + if test x"$lib" = x"yes"; then + obj="$builddir${i%.m}.lib.o" + elif test x"$plugin" = x"yes"; then + obj="$builddir${i%.m}.plugin.o" + else + obj="$builddir${i%.m}.o" + fi + ;; + *.mm) + if test x"$lib" = x"yes"; then + obj="$builddir${i%.mm}.lib.o" + elif test x"$plugin" = x"yes"; then + obj="$builddir${i%.mm}.plugin.o" + else + obj="$builddir${i%.mm}.o" + fi + ;; esac objs="$objs $obj" build="no" deps=$($OBJC -E -M $CPPFLAGS $OBJCFLAGS $i | sed 's/.*: //' | sed 's/\\//g') Index: utils/objfw-config.in ================================================================== --- utils/objfw-config.in +++ utils/objfw-config.in @@ -96,14 +96,14 @@ } parse_packages() { while test x"$1" != "x"; do case "$1" in - --package) - shift - package_depends_on "$1" - ;; + --package) + shift + package_depends_on "$1" + ;; esac shift done } parse_packages "$@" @@ -118,118 +118,114 @@ fi } while test x"$1" != "x"; do case "$1" in - --all) - output_flag "$CFLAGS $CPPFLAGS $CXXFLAGS $OBJCFLAGS" - output_flag "$LDFLAGS $LDFLAGS_REEXPORT $LDFLAGS_RPATH" - output_flag "$LIBS" - ;; - --arc) - output_flag "-fobjc-arc -fobjc-arc-exceptions" - ;; - --cflags) - output_flag "$CFLAGS" - ;; - --cppflags) - output_flag "$CPPFLAGS" - ;; - --cxxflags) - output_flag "$CXXFLAGS" - ;; - --framework-libs) - output_flag "$FRAMEWORK_LIBS" - ;; - --help) - show_help 0 - ;; - --objc) - output_flag "$OBJC" - ;; - --objcflags) - output_flag "$OBJCFLAGS" - ;; - --libs) - output_flag "$LIBS" - ;; - --lib-cflags) - if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then - echo "LIB_MAJOR and LIB_MINOR need to be set!" \ - 1>&2 - exit 1 - fi - - output_flag "$LIB_CFLAGS" - ;; - --lib-ldflags) - if test x"$SHARED_LIB" = x"" -o x"$LIB_MAJOR" = x"" \ - -o x"$LIB_MINOR" = x""; then - printf "SHARED_LIB, LIB_MAJOR and " 2>&1 - echo "LIB_MINOR need to be set!" 1>&2 - exit 1 - fi - - output_flag "$LIB_LDFLAGS" - ;; - --lib-prefix) - if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then - echo "LIB_MAJOR and LIB_MINOR need to be set!" \ - 1>&2 - exit 1 - fi - - output_flag "$LIB_PREFIX" - ;; - --lib-suffix) - if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then - echo "LIB_MAJOR and LIB_MINOR need to be set!" \ - 1>&2 - exit 1 - fi - - output_flag "$LIB_SUFFIX" - ;; - --ldflags) - output_flag "$LDFLAGS" - ;; - --reexport) - output_flag "$LDFLAGS_REEXPORT" - ;; - --rpath) - output_flag "$LDFLAGS_RPATH" - ;; - --package) - # Already included into the flags. - shift - ;; - --packages-dir) - output_flag "$packagesdir" - ;; - --plugin-cflags) - output_flag "$PLUGIN_CFLAGS" - ;; - --plugin-ldflags) - output_flag "$PLUGIN_LDFLAGS" - ;; - --plugin-suffix) - output_flag "$PLUGIN_SUFFIX" - ;; - --prog-suffix) - output_flag "$PROG_SUFFIX" - ;; - --static-libs) - output_flag "$STATIC_LIBS" - ;; - --version) - output_flag "$VERSION" - ;; - *) - echo "Invalid option: $1" 1>&2 - exit 1 - ;; + --all) + output_flag "$CFLAGS $CPPFLAGS $CXXFLAGS $OBJCFLAGS" + output_flag "$LDFLAGS $LDFLAGS_REEXPORT $LDFLAGS_RPATH $LIBS" + ;; + --arc) + output_flag "-fobjc-arc -fobjc-arc-exceptions" + ;; + --cflags) + output_flag "$CFLAGS" + ;; + --cppflags) + output_flag "$CPPFLAGS" + ;; + --cxxflags) + output_flag "$CXXFLAGS" + ;; + --framework-libs) + output_flag "$FRAMEWORK_LIBS" + ;; + --help) + show_help 0 + ;; + --objc) + output_flag "$OBJC" + ;; + --objcflags) + output_flag "$OBJCFLAGS" + ;; + --libs) + output_flag "$LIBS" + ;; + --lib-cflags) + if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then + echo "LIB_MAJOR and LIB_MINOR need to be set!" 1>&2 + exit 1 + fi + + output_flag "$LIB_CFLAGS" + ;; + --lib-ldflags) + if test x"$SHARED_LIB" = x"" -o x"$LIB_MAJOR" = x"" \ + -o x"$LIB_MINOR" = x""; then + printf "SHARED_LIB, LIB_MAJOR and " 2>&1 + echo "LIB_MINOR need to be set!" 1>&2 + exit 1 + fi + + output_flag "$LIB_LDFLAGS" + ;; + --lib-prefix) + if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then + echo "LIB_MAJOR and LIB_MINOR need to be set!" 1>&2 + exit 1 + fi + + output_flag "$LIB_PREFIX" + ;; + --lib-suffix) + if test x"$LIB_MAJOR" = x"" -o x"$LIB_MINOR" = x""; then + echo "LIB_MAJOR and LIB_MINOR need to be set!" 1>&2 + exit 1 + fi + + output_flag "$LIB_SUFFIX" + ;; + --ldflags) + output_flag "$LDFLAGS" + ;; + --reexport) + output_flag "$LDFLAGS_REEXPORT" + ;; + --rpath) + output_flag "$LDFLAGS_RPATH" + ;; + --package) + # Already included into the flags. + shift + ;; + --packages-dir) + output_flag "$packagesdir" + ;; + --plugin-cflags) + output_flag "$PLUGIN_CFLAGS" + ;; + --plugin-ldflags) + output_flag "$PLUGIN_LDFLAGS" + ;; + --plugin-suffix) + output_flag "$PLUGIN_SUFFIX" + ;; + --prog-suffix) + output_flag "$PROG_SUFFIX" + ;; + --static-libs) + output_flag "$STATIC_LIBS" + ;; + --version) + output_flag "$VERSION" + ;; + *) + echo "Invalid option: $1" 1>&2 + exit 1 + ;; esac shift done test x"$flag_printed" = x"yes" && echo exit 0 Index: utils/objfw-new ================================================================== --- utils/objfw-new +++ utils/objfw-new @@ -14,14 +14,14 @@ name="$2" test -z "$name" && show_help case "$1" in - app) - test -f "$name.m" && already_exists "$name.m" +app) + test -f "$name.m" && already_exists "$name.m" - cat >"$name.m" <<__EOF__ + cat >"$name.m" <<__EOF__ #import @interface $name: OFObject @end @@ -32,16 +32,16 @@ { [OFApplication terminate]; } @end __EOF__ - ;; - class) - test -f "$name.h" && already_exists "$name.h" - test -f "$name.m" && already_exists "$name.m" + ;; +class) + test -f "$name.h" && already_exists "$name.h" + test -f "$name.m" && already_exists "$name.m" - cat >"$name.h" <<__EOF__ + cat >"$name.h" <<__EOF__ #import @interface $name: OFObject @end __EOF__ @@ -49,10 +49,10 @@ #import "$name.h" @implementation $name @end __EOF__ - ;; - *) - show_help - ;; + ;; +*) + show_help + ;; esac