[Git][ghc/ghc][wip/freebsd-ci] Add support for libcxxrt

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Sun Aug 7 23:04:31 UTC 2022



Ben Gamari pushed to branch wip/freebsd-ci at Glasgow Haskell Compiler / GHC


Commits:
1f25e793 by Ben Gamari at 2022-08-07T19:04:06-04:00
Add support for libcxxrt

- - - - -


1 changed file:

- m4/fp_find_cxx_std_lib.m4


Changes:

=====================================
m4/fp_find_cxx_std_lib.m4
=====================================
@@ -19,31 +19,36 @@ unknown
 EOF
         AC_MSG_CHECKING([C++ standard library flavour])
         if "$CXX" -E actest.cpp -o actest.out; then
-            if grep "libc++" actest.out >/dev/null; then
-                CXX_STD_LIB_LIBS="c++ c++abi"
-                p="`"$CXX" --print-file-name libc++.so`"
-                d="`dirname "$p"`"
-                dnl On some platforms (e.g. Windows) the C++ standard library
-                dnl can be found in the system search path. In this case $CXX
-                dnl --print-file-name will simply print the filename without a
-                dnl directory part. Consequently, dirname will return `.`. However,
-                dnl we don't want to include such paths in the package database.
-                if test "$d" = "."; then d=""; fi
-                CXX_STD_LIB_LIB_DIRS="$d"
-                CXX_STD_LIB_DYN_LIB_DIRS="$d"
-                AC_MSG_RESULT([libc++])
-            elif grep "libstdc++" actest.out >/dev/null; then
-                CXX_STD_LIB_LIBS="stdc++"
-                p="`"$CXX" --print-file-name libstdc++.so`"
-                d="`dirname "$p"`"
-                if test "$d" = "."; then d=""; fi
-                CXX_STD_LIB_LIB_DIRS="$d"
-                CXX_STD_LIB_DYN_LIB_DIRS="$d"
-                AC_MSG_RESULT([libstdc++])
-            else
-                rm -f actest.cpp actest.out
-                AC_MSG_ERROR([Unknown C++ standard library implementation.])
+            check_lib() {
+                if grep "lib$1" actest.out >/dev/null; then
+                    CXX_STD_LIB_LIBS="$1"
+                    p="`"$CXX" --print-file-name lib$1.so`"
+                    d="`dirname "$p"`"
+                    dnl On some platforms (e.g. Windows) the C++ standard library
+                    dnl can be found in the system search path. In this case $CXX
+                    dnl --print-file-name will simply print the filename without a
+                    dnl directory part. Consequently, dirname will return `.`. However,
+                    dnl we don't want to include such paths in the package database.
+                    if test "$d" = "."; then d=""; fi
+                    CXX_STD_LIB_LIB_DIRS="$d"
+                    CXX_STD_LIB_DYN_LIB_DIRS="$d"
+                    AC_MSG_RESULT([lib$1])
+                fi
+            }
+
+            dnl C++ standard library (e.g. STL)
+            check_lib "c++"
+            check_lib "stdc++"
+            if [ -z "$CXX_STD_LIB_LIBS" ]; then
+                AC_MSG_ERROR([Unknown C++ standard library implementation. Please set CXX_STD_LIB_LIBS, CXX_STD_LIB_LIB_DIRS and CXX_STD_LIB_DYN_LIB_DIRS manually.])
             fi
+
+            dnl ABI library
+            AC_MSG_CHECKING([C++ ABI flavour])
+            check_lib "c++abi"
+            check_lib "cxxrt"
+            check_lib "supc++"
+
             rm -f actest.cpp actest.out
         else
             rm -f actest.cpp actest.out



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f25e793f15c4a43e08e8f01659539604c4455ce

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f25e793f15c4a43e08e8f01659539604c4455ce
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/20220807/bd19c04d/attachment-0001.html>


More information about the ghc-commits mailing list