import libs = libgetopt_port%lib{getopt_port}

# Upstream tests pass string literals as char* argv elements.
#
if ($cxx.class == 'gcc')
{
  if ($cxx.id == 'clang')
    cxx.coptions += -Wno-deprecated-writable-strings \
                    -Wno-c++11-compat-deprecated-writable-strings \
                    -Wno-writable-strings \
                    -Wno-deprecated-declarations \
                    -Wno-unused-function

  cxx.coptions += -Wno-write-strings \
                  -Wno-deprecated-declarations \
                  -Wno-unused-function \
                  -fsigned-char
}

# MinGW CRT already defines getopt. Keep our archive first.
#
if ($cxx.target.system == 'mingw32')
  cxx.loptions += -Wl,--allow-multiple-definition

exe{driver}: {h cxx}{**} $libs
