summaryrefslogtreecommitdiff
path: root/m4/ghc_select_file_extensions.m4
diff options
context:
space:
mode:
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
+])