#!/bin/sh

print_help()
{
  echo "Usage: mruby-config [switches]"
  echo "  switches:"
  echo "  --cc                        print compiler name"
  echo "  --cflags                    print flags passed to compiler"
  echo "  --ld                        print linker name"
  echo "  --ldflags                   print flags passed to linker"
  echo "  --ldflags-before-libs       print flags passed to linker before linked libraries"
  echo "  --libs                      print linked libraries"
  echo "  --libmruby-path             print libmruby path"
  echo "  --help                      print this help"
  exit 0
}

if [ $# -eq 0 ]; then
   print_help
fi

while [ $# -gt 0 ]; do
  case $1 in
    --cc) echo gcc;;
    --cflags) echo -std=gnu99 -Os -fomit-frame-pointer -DMRB_USE_READLINE -DMRB_UTF8_STRING -DMRB_USE_RATIONAL -DMRB_USE_COMPLEX -I"/usr/include" -I"/home/buildozer/aports/community/mruby/src/mruby-3.1.0/mrbgems/mruby-time/include" -I"/home/buildozer/aports/community/mruby/src/mruby-3.1.0/mrbgems/mruby-io/include";;
    --ld) echo g++;;
    --ldflags) echo  -L/usr/lib;;
    --ldflags-before-libs) ;;
    --libs) echo -lmruby -lm;;
    --libmruby-path) echo /usr/lib/libmruby.a;;
    *) print_help;;
  esac
  shift
done
