aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/modules/FindChocolatey.cmake36
-rw-r--r--cmake/modules/FindLEX.cmake8
-rw-r--r--cmake/modules/FindYACC.cmake8
-rw-r--r--config.nmake6
-rwxr-xr-xtools/runlex.sh9
5 files changed, 63 insertions, 4 deletions
diff --git a/cmake/modules/FindChocolatey.cmake b/cmake/modules/FindChocolatey.cmake
new file mode 100644
index 0000000000..d523ad6220
--- /dev/null
+++ b/cmake/modules/FindChocolatey.cmake
@@ -0,0 +1,36 @@
+# FindChocolatey
+# ----------
+#
+# this module looks for Cygwin
+
+# This code was copied from
+# http://cmake.org/gitweb?p=cmake.git;a=blob_plain;f=Modules/FindCygwin.cmake;hb=HEAD
+# and modified.
+#
+# Its toplevel COPYING file starts with:
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+if (WIN32)
+ find_path(CHOCOLATEY_INSTALL_PATH
+ choco.bat
+ PATH "C:/Chocolatey" ENV ChocolateyInstall
+ PATH_SUFFIXES bin
+ DOC "Chocolatey installation path"
+ NO_DEFAULT_PATH
+ )
+
+ mark_as_advanced(
+ CHOCOLATEY_INSTALL_PATH
+ )
+endif ()
diff --git a/cmake/modules/FindLEX.cmake b/cmake/modules/FindLEX.cmake
index 955ae3849a..6fce54e6aa 100644
--- a/cmake/modules/FindLEX.cmake
+++ b/cmake/modules/FindLEX.cmake
@@ -5,6 +5,12 @@
#
INCLUDE(FindCygwin)
+#INCLUDE(FindChocolatey)
+
+# Chocolatey's C:\Chocolatey\bin\win_flex and -\win_bison are
+# currently unusable without some manual adjustments to the
+# win_flex and win_bison wrapper scripts. Calling the executables
+# directly should work.
FIND_PROGRAM(LEX_EXECUTABLE
NAMES
@@ -12,6 +18,8 @@ FIND_PROGRAM(LEX_EXECUTABLE
lex
PATHS
${CYGWIN_INSTALL_PATH}/bin
+# ${CHOCOLATEY_INSTALL_PATH}/bin
+# ${CHOCOLATEY_INSTALL_PATH}/lib/winflexbison.2.4.1.20140103/tools
/bin
/usr/bin
/usr/local/bin
diff --git a/cmake/modules/FindYACC.cmake b/cmake/modules/FindYACC.cmake
index f71650b036..0bbd287484 100644
--- a/cmake/modules/FindYACC.cmake
+++ b/cmake/modules/FindYACC.cmake
@@ -6,6 +6,12 @@
#
INCLUDE(FindCygwin)
+#INCLUDE(FindChocolatey)
+
+# Chocolatey's C:\Chocolatey\bin\win_flex and -\win_bison are
+# currently unusable without some manual adjustments to the
+# win_flex and win_bison wrapper scripts. Calling the executables
+# directly should work.
FIND_PROGRAM(YACC_EXECUTABLE
NAMES
@@ -13,6 +19,8 @@ FIND_PROGRAM(YACC_EXECUTABLE
yacc
PATHS
${CYGWIN_INSTALL_PATH}/bin
+# ${CHOCOLATEY_INSTALL_PATH}/bin
+# ${CHOCOLATEY_INSTALL_PATH}/lib/winflexbison.2.4.1.20140103/tools
/bin
/usr/bin
/usr/local/bin
diff --git a/config.nmake b/config.nmake
index ee160c781a..46bc9c57ef 100644
--- a/config.nmake
+++ b/config.nmake
@@ -790,7 +790,7 @@ SED=sed
# Command for lex/flexx. Cygwin's flex or Chocolatey's win_flex
# recommended.
-# This is called by tools\runlex.sh and must be a UNIX-style path
+# Absolute or relative paths must be Windows-style
# Chocolatey's C:\Chocolatey\bin\win_flex and -\win_bison are
# currently unusable without some manual adjustments to the
@@ -798,12 +798,12 @@ SED=sed
# directly should work.
#LEX=win_flex
-#LEX=/cygdrive/c/Chocolatey/lib/winflexbison.2.4.1.20140103/tools/win_flex
+#LEX=C:\Chocolatey\lib\winflexbison.2.4.1.20140103\tools\win_flex
LEX=flex
# Command for yacc/bison. Cygwin's bison or Chocolatey's win_bison
# recommended.
-# This is called by nmake and must be a Windows-style path
+# Absolute or relative paths must be Windows-style
#YACC=win_bison
#YACC=C:\Chocolatey\lib\winflexbison.2.4.1.20140103\tools\win_bison
diff --git a/tools/runlex.sh b/tools/runlex.sh
index e2f3a877de..a564074f04 100755
--- a/tools/runlex.sh
+++ b/tools/runlex.sh
@@ -36,7 +36,14 @@ then
echo "Usage: runlex <lex/flex command to run> [ arguments ]" 1>&2
exit 1
fi
-LEX="$1"
+
+if [ -n "${OS#Windows}" ] ; then
+ LEX=`cygpath --unix $1`
+ echo "$1 -> $LEX"
+else
+ LEX="$1"
+fi
+
shift
#
# Check whether we have it.