summaryrefslogtreecommitdiff
path: root/m4/ghc_select_file_extensions.m4
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-04-02 11:52:47 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-05 05:42:38 -0400
commit7ffbdc3fa603c6411249ba9b758cf8f109c5fb30 (patch)
tree8a05d6e03ce2790e6e59651c824e569fee088d33 /m4/ghc_select_file_extensions.m4
parent6acadb79afe685c635fd255f90551a0fbfcbe3dc (diff)
downloadhaskell-7ffbdc3fa603c6411249ba9b758cf8f109c5fb30.tar.gz
Break up aclocal.m4
Diffstat (limited to 'm4/ghc_select_file_extensions.m4')
-rw-r--r--m4/ghc_select_file_extensions.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/m4/ghc_select_file_extensions.m4 b/m4/ghc_select_file_extensions.m4
new file mode 100644
index 0000000000..751298a7f3
--- /dev/null
+++ b/m4/ghc_select_file_extensions.m4
@@ -0,0 +1,22 @@
+AC_DEFUN([GHC_SELECT_FILE_EXTENSIONS],
+[
+ $2=''
+ $3='.so'
+ case $1 in
+ *-unknown-cygwin32)
+ AC_MSG_WARN([GHC does not support the Cygwin target at the moment])
+ AC_MSG_WARN([I'm assuming you wanted to build for i386-unknown-mingw32])
+ exit 1
+ ;;
+ # examples: i386-unknown-mingw32, i686-w64-mingw32, x86_64-w64-mingw32
+ *-mingw32)
+ windows=YES
+ $2='.exe'
+ $3='.dll'
+ ;;
+ # apple platform uses .dylib (macOS, iOS, ...)
+ *-apple-*)
+ $3='.dylib'
+ ;;
+ esac
+])