Use python realpath instead of relying on shell realpath (#3117)
authormakaimann <makaim@stanford.edu>
Fri, 2 Aug 2019 00:52:37 +0000 (17:52 -0700)
committerGitHub <noreply@github.com>
Fri, 2 Aug 2019 00:52:37 +0000 (17:52 -0700)
* Use a custom implementation instead of relying on realpath, because it doesn't exist on Mac

* Use local variables and move portable_realpath to its own file

* Replace portable_realpath with python realpath

* Consistent command substitution

Co-Authored-By: Andres Noetzli <andres.noetzli@gmail.com>
* Substitute pwd directly

contrib/get-antlr-3.4

index 670fc3b41406a33c2c772111c0ac1349cd30093b..6bfa18c4645fda5f5b0e9abbee51ca5550097405 100755 (executable)
@@ -46,7 +46,7 @@ cd libantlr3c-3.4
 
 # Use an absolute path for the installation directory to avoid spurious libtool
 # warnings about the ANTLR library having moved
-PREFIX=$(realpath `pwd`/../..)
+PREFIX=$(python -c "import os; print(os.path.realpath('$(pwd)/../..'))")
 
 # Make antlr3debughandlers.c empty to avoid unreferenced symbols
 rm -rf src/antlr3debughandlers.c && touch src/antlr3debughandlers.c