diff options
author | Andres Mejia <amejia004@gmail.com> | 2013-02-05 17:51:11 -0500 |
---|---|---|
committer | Andres Mejia <amejia004@gmail.com> | 2013-02-05 17:51:11 -0500 |
commit | a01cfe6ef968c606b4f52c6a67baa2a061979f42 (patch) | |
tree | f9ade8ebd5ec051fbfded0af2794833e6cfc73cb | |
parent | b6a0e7088eac5a03e0476efb168b281a82f27a4c (diff) | |
download | libarchive-a01cfe6ef968c606b4f52c6a67baa2a061979f42.tar.gz |
Add check for finding libgcc.
-rw-r--r-- | build/cmake/FindLibGCC.cmake | 22 | ||||
-rw-r--r-- | build/cmake/config.h.in | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/build/cmake/FindLibGCC.cmake b/build/cmake/FindLibGCC.cmake new file mode 100644 index 00000000..5883ff80 --- /dev/null +++ b/build/cmake/FindLibGCC.cmake @@ -0,0 +1,22 @@ +# - Find libgcc
+# Find the libgcc library.
+#
+# LIBGCC_LIBRARIES - List of libraries when using libgcc
+# LIBGCC_FOUND - True if libgcc found.
+
+IF (LIBGCC_LIBRARY)
+ # Already in cache, be silent
+ SET(LIBGCC_FIND_QUIETLY TRUE)
+ENDIF (LIBGCC_LIBRARY)
+
+FIND_LIBRARY(LIBGCC_LIBRARY NAMES gcc libgcc)
+
+# handle the QUIETLY and REQUIRED arguments and set LIBGCC_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGCC DEFAULT_MSG LIBGCC_LIBRARY)
+
+IF(LIBGCC_FOUND)
+ SET(LIBGCC_LIBRARIES ${LIBGCC_LIBRARY})
+ SET(HAVE_LIBGCC 1)
+ENDIF(LIBGCC_FOUND)
diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in index 50faae5c..c04314ee 100644 --- a/build/cmake/config.h.in +++ b/build/cmake/config.h.in @@ -579,6 +579,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `expat' library (-lexpat). */ #cmakedefine HAVE_LIBEXPAT 1 +/* Define to 1 if you have the `gcc' library (-lgcc). */ +#cmakedefine HAVE_LIBGCC 1 + /* Define to 1 if you have the `lzma' library (-llzma). */ #cmakedefine HAVE_LIBLZMA 1 |