diff --git a/Make.bat b/Make.bat index 8bb7c4121..5cb9603e9 100644 --- a/Make.bat +++ b/Make.bat @@ -29,6 +29,7 @@ goto Loop REM Try to determine install location if "%dest%"=="" ( + REM TODO Separate paths with search path separator ; and pick first one set dest=%GF_LIB_PATH% ) if "%dest%"=="" ( diff --git a/Make.hs b/Make.hs index c491fe424..76c21b35b 100644 --- a/Make.hs +++ b/Make.hs @@ -9,7 +9,7 @@ import System.IO.Error (catchIOError) import System.Exit (ExitCode(..),exitFailure) import System.Environment (getArgs,lookupEnv) import System.Process (rawSystem) -import System.FilePath (()) -- ,takeFileName,addExtension,dropExtension) +import System.FilePath ((),splitSearchPath) -- ,takeFileName,addExtension,dropExtension) import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile) #if __GLASGOW_HASKELL__>=800 import System.Directory (getModificationTime,setModificationTime) @@ -119,7 +119,7 @@ mkInfo = do -- Look for install location in a few different places let mflag = getFlag destination_flag args mbuilt <- catchIOError (readFile "../gf-core/DATA_DIR" >>= \d -> return (Just (d "lib"))) (\e -> return Nothing) - menvar <- lookupEnv "GF_LIB_PATH" + menvar <- lookupEnv "GF_LIB_PATH" >>= return . fmap (head . splitSearchPath) let inst_dir = case catMaybes [mflag,menvar,mbuilt] of diff --git a/Make.sh b/Make.sh index bfc2d66f9..6e8c5e1f1 100755 --- a/Make.sh +++ b/Make.sh @@ -36,7 +36,7 @@ done # Try to determine install location if [ -z "$dest" ]; then - dest="$GF_LIB_PATH" + dest=$(echo "$GF_LIB_PATH" | sed 's/:.*$//') fi if [ -z "$dest" ] && [ -f "../gf-core/DATA_DIR" ]; then dest=$(cat ../gf-core/DATA_DIR)