<commit_before>dnl Check for Qt

AC_SUBST(QMAKE)

AC_MSG_CHECKING([for qmake in env.vars QMAKE and QTDIR])
if test ! -z "$QMAKE"; then
  AC_MSG_RESULT([$QMAKE])
elif test -f $QTDIR/bin/qmake; then
  QMAKE=$QTDIR/bin/qmake
  AC_MSG_RESULT([$QMAKE])
else
  AC_MSG_RESULT([no])
  AC_CHECK_PROGS(QMAKE,qmake-qt4 qmake-mac qmake,"")
fi

AC_MSG_CHECKING([for lrelease in env.vars LRELEASE and QTDIR])
if test ! -z "$LRELEASE"; then
  AC_MSG_RESULT([$LRELEASE])
elif test -f $QTDIR/bin/lrelease; then
  LRELEASE=$QTDIR/bin/lrelease
  AC_MSG_RESULT([$LRELEASE])
else
  AC_MSG_RESULT([no])
  AC_CHECK_PROGS(LRELEASE,lrelease-qt4 lrelease,"")
fi

if test -n "$QMAKE"; then
  AC_MSG_CHECKING([for qmake arguments])
  if echo $host | grep darwin; then
    echo "#!/bin/sh -x" > ./qmake.sh
    echo "$QMAKE \$*" >> ./qmake.sh
    echo 'MAKEFILE=`echo -- $* | grep -o "Makefile@<:@A-Z.a-z@:>@*"`' >> ./qmake.sh
    echo 'if test -z "$MAKEFILE"; then MAKEFILE=Makefile; fi' >> ./qmake.sh
    # echo 'echo $MAKEFILE' >> ./qmake.sh
    echo 'cat $MAKEFILE | \
      sed "s/-arch i386//g" | \
      sed "s/-arch x86_64//g" | \
      sed "s/-arch//g" | \
      sed "s/-Xarch@<:@^ @:>@*//g" > $MAKEFILE.fixed && \
      mv $MAKEFILE.fixed $MAKEFILE' >> qmake.sh
    QMAKE="sh `pwd`/qmake.sh"
  # Needed? Maybe
  elif test "$host" != "$build"; then
    QMAKE_LIBDIR_QT=`$QMAKE -query QT_INSTALL_LIBS | sed "s/$build_short/$host_short/"`<commit_msg>Allow configure to detect QT5<commit_after>dnl Check for Qt

AC_SUBST(QMAKE)

AC_MSG_CHECKING([for qmake in env.vars QMAKE and QTDIR])
if test ! -z "$QMAKE"; then
  AC_MSG_RESULT([$QMAKE])
elif test -f $QTDIR/bin/qmake; then
  QMAKE=$QTDIR/bin/qmake
  AC_MSG_RESULT([$QMAKE])
else
  AC_MSG_RESULT([no])
  AC_CHECK_PROGS(QMAKE,qmake qmake-mac qmake-qt4,"")
fi

AC_MSG_CHECKING([for lrelease in env.vars LRELEASE and QTDIR])
if test ! -z "$LRELEASE"; then
  AC_MSG_RESULT([$LRELEASE])
elif test -f $QTDIR/bin/lrelease; then
  LRELEASE=$QTDIR/bin/lrelease
  AC_MSG_RESULT([$LRELEASE])
else
  AC_MSG_RESULT([no])
  AC_CHECK_PROGS(LRELEASE,lrelease-qt4 lrelease,"")
fi

if test -n "$QMAKE"; then
  AC_MSG_CHECKING([for qmake arguments])

  if "$QMAKE" -qt5 -v > /dev/null 2>&1; then
    QMAKE="$QMAKE -qt5"
  elif "$QMAKE" -qt4 -v > /dev/null 2>&1; then
    QMAKE="$QMAKE -qt4"
    QT4BUILD="-DQT4_BUILD:Boolean=OFF"
  elif "$QMAKE" -v 2>&1 | grep "Qt version 5"; then
    true
  elif "$QMAKE" -v 2>&1 | grep "Qt version 4"; then
    QT4BUILD="-DQT4_BUILD:Boolean=OFF"
  else
    QMAKE_VERSION=`"$QMAKE" -v`
    AC_MSG_ERROR([qmake does not report qt version 4 or 5: $QMAKE_VERSION])
  fi

  if echo $host | grep darwin; then
    echo "#!/bin/sh -x" > ./qmake.sh
    echo "$QMAKE \$*" >> ./qmake.sh
    echo 'MAKEFILE=`echo -- $* | grep -o "Makefile@<:@A-Z.a-z@:>@*"`' >> ./qmake.sh
    echo 'if test -z "$MAKEFILE"; then MAKEFILE=Makefile; fi' >> ./qmake.sh
    # echo 'echo $MAKEFILE' >> ./qmake.sh
    echo 'cat $MAKEFILE | \
      sed "s/-arch i386//g" | \
      sed "s/-arch x86_64//g" | \
      sed "s/-arch//g" | \
      sed "s/-Xarch@<:@^ @:>@*//g" > $MAKEFILE.fixed && \
      mv $MAKEFILE.fixed $MAKEFILE' >> qmake.sh
    QMAKE="sh `pwd`/qmake.sh"
  # Needed? Maybe
  elif test "$host" != "$build"; then
    QMAKE_LIBDIR_QT=`$QMAKE -query QT_INSTALL_LIBS | sed "s/$build_short/$host_short/"`
{'fraction_non_alphanumeric': 0.18146253385495034, 'fraction_numerical': 0.011736382786638579, 'mean_word_length': 3.333767926988266, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3979564', 'n_tokens_mistral': 1491, 'n_tokens_neox': 1377, 'n_words': 314}