[Git][ghc/ghc][wip/js-staging] Configure: remove EMSDK hacks. Use emconfigure instead

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Wed Aug 17 07:56:56 UTC 2022



Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
9bbb6b10 by Sylvain Henry at 2022-08-17T09:58:52+02:00
Configure: remove EMSDK hacks. Use emconfigure instead

emconfigure ./configure --target=js-unknown-ghcjs

- - - - -


1 changed file:

- configure.ac


Changes:

=====================================
configure.ac
=====================================
@@ -346,80 +346,36 @@ AC_SUBST(TargetHasRTSLinker)
 # Requires FPTOOLS_SET_PLATFORMS_VARS to be run first.
 FP_FIND_ROOT
 
-if test "$TargetOS" = "ghcjs"
-then
-
-    AC_ARG_VAR(EMSDK,[Use as the full path to Emscripten. [default=autodetect]])
-    AC_ARG_VAR(EMSDK_LLVM,[Use as the full path to Emscripten LLVM. [default=autodetect]])
-    AC_ARG_VAR(EMSDK_BIN,[Use as the full path to Emscripten binary folder. [default=autodetect]])
-
-    if test "$EMSDK" != "" ; then
-        echo "Using emsdk: $EMSDK"
-    elif test "$EMSDK_LLVM" != "" && "$EMSDK_BIN" != "" ; then
-        echo "Using manually defined emsdk LLVM and bin."
-    else
-        echo -e "Error: Could not find Emscripten SDK.\nCheck the EMSDK environment variable."
-        exit 1
-    fi
-
-    if test "$EMSDK_LLVM" != "" ; then
-        echo "Using emsdk LLVM: $EMSDK_LLVM"
-    else
-        echo "No emsdk LLVM set: defaulting to $EMSDK/upstream"
-        EMSDK_LLVM="$EMSDK/upstream"
-    fi
-
-    if test "$EMSDK_BIN" != "" ; then
-        echo "Using emsdk bin: $EMSDK_BIN"
-    else
-        echo "No emsdk bin set: defaulting to $EMSDK/upstream/emscripten"
-    fi
-
-    dnl We need to use AC_CHECK_TARGET_TOOL instead of AC_PATH_PROG below that
-    dnl doesn't take into account the target triple...
-    dnl Why are we inflicting all this to ourselves?
-    AC_PATH_TOOL([CC],[emcc],[gcc],[$EMSDK$PATH_SEPERATOR$PATH])
-    AC_PATH_TOOL([CXX],[g++])
-    AC_PATH_TOOL([NM],[llvm-nm],[nm],[$EMSDK_BIN$PATH_SEPERATOR$PATH])
-    AC_PATH_TOOL([AR],[llvm-ar],[ar],[$EMSDK_BIN$PATH_SEPERATOR$PATH])
-    AC_PATH_TOOL([RANLIB],[llvm-ranlib],[ranlib],[$EMSDK_BINF$PATH_SEPERATOR$PATH])
-    AC_PATH_TOOL([OBJDUMP],[llvm-objdump],[objdump],[$EMSDK_BIN$PATH_SEPERATOR$PATH])
-
-
-
+# Extract and configure the Windows toolchain
+if test "$HostOS" = "mingw32" -a "$EnableDistroToolchain" = "NO"; then
+    FP_SETUP_WINDOWS_TOOLCHAIN
 else
-
-  # Extract and configure the Windows toolchain
-  if test "$HostOS" = "mingw32" -a "$EnableDistroToolchain" = "NO"; then
-      FP_SETUP_WINDOWS_TOOLCHAIN
-  else
-      # Ideally should use AC_CHECK_TARGET_TOOL but our triples
-      # are screwed up. Configure doesn't think they're ever equal and
-      # so never tried without the prefix.
-      AC_PATH_TOOL([CC],[gcc], [clang])
-      AC_PATH_TOOL([CXX],[g++], [clang++])
-      AC_PATH_TOOL([NM],[nm])
-      # N.B. we don't probe for LD here but instead
-      # do so in FIND_LD to avoid #21778.
-      AC_PATH_TOOL([AR],[ar])
-      AC_PATH_TOOL([RANLIB],[ranlib])
-      AC_PATH_TOOL([OBJDUMP],[objdump])
-      AC_PATH_TOOL([DllWrap],[dllwrap])
-      AC_PATH_TOOL([Windres],[windres])
-      AC_PATH_TOOL([Genlib],[genlib])
-
-      HAVE_GENLIB=False
-      if test "$HostOS" = "mingw32"; then
-          AC_CHECK_TARGET_TOOL([Windres],[windres])
-          AC_CHECK_TARGET_TOOL([DllWrap],[dllwrap])
-          AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump])
-
-          if test "$Genlib" != ""; then
-              GenlibCmd="$(cygpath -m $Genlib)"
-              HAVE_GENLIB=True
-          fi
-      fi
-  fi
+    # Ideally should use AC_CHECK_TARGET_TOOL but our triples
+    # are screwed up. Configure doesn't think they're ever equal and
+    # so never tried without the prefix.
+    AC_PATH_TOOL([CC],[gcc], [clang])
+    AC_PATH_TOOL([CXX],[g++], [clang++])
+    AC_PATH_TOOL([NM],[nm])
+    # N.B. we don't probe for LD here but instead
+    # do so in FIND_LD to avoid #21778.
+    AC_PATH_TOOL([AR],[ar])
+    AC_PATH_TOOL([RANLIB],[ranlib])
+    AC_PATH_TOOL([OBJDUMP],[objdump])
+    AC_PATH_TOOL([DllWrap],[dllwrap])
+    AC_PATH_TOOL([Windres],[windres])
+    AC_PATH_TOOL([Genlib],[genlib])
+
+    HAVE_GENLIB=False
+    if test "$HostOS" = "mingw32"; then
+        AC_CHECK_TARGET_TOOL([Windres],[windres])
+        AC_CHECK_TARGET_TOOL([DllWrap],[dllwrap])
+        AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump])
+
+        if test "$Genlib" != ""; then
+            GenlibCmd="$(cygpath -m $Genlib)"
+            HAVE_GENLIB=True
+        fi
+    fi
 fi
 
 if test "$HostOS" = "mingw32"; then



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9bbb6b10e7c51c4114f73f078935001106a18e1e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9bbb6b10e7c51c4114f73f078935001106a18e1e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20220817/212e05f4/attachment-0001.html>


More information about the ghc-commits mailing list