summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-11-18 00:35:06 +0100
committerSimon Josefsson <simon@josefsson.org>2008-11-18 00:35:06 +0100
commit35d89293222a0e8930dc2752b0e5e85e4d088800 (patch)
tree0054123bf1ba0b0ee6ad8a568a5a1701040ae197 /m4
parent60859fa9e71f85af96ab0951a4d681813705b761 (diff)
downloadgnutls-35d89293222a0e8930dc2752b0e5e85e4d088800.tar.gz
Move C++ and -output-def detection.
Diffstat (limited to 'm4')
-rw-r--r--m4/output-def.m428
1 files changed, 28 insertions, 0 deletions
diff --git a/m4/output-def.m4 b/m4/output-def.m4
new file mode 100644
index 0000000000..3fb666282c
--- /dev/null
+++ b/m4/output-def.m4
@@ -0,0 +1,28 @@
+# output-def.m4 serial 1
+dnl Copyright (C) 2008 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# sj_OUTPUT_DEF()
+# -------------
+# Check if linker supports -Wl,--output-def and define automake
+# conditional HAVE_LD_OUTPUT_DEF if it is.
+AC_DEFUN([sj_OUTPUT_DEF],
+[
+ AC_MSG_CHECKING([if gcc/ld supports -Wl,--output-def])
+ if test "$enable_shared" = no; then
+ output_def=no
+ AC_MSG_RESULT([no need, since shared libraries are disabled])
+ else
+ _gcc_ldflags_save=$LDFLAGS
+ LDFLAGS="-Wl,--output-def,foo.def"
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([]),output_def=yes,output_def=no)
+ rm -f foo.def
+ AC_MSG_RESULT($output_def)
+ LDFLAGS="$_gcc_ldflags_save"
+ fi
+ AM_CONDITIONAL(HAVE_LD_OUTPUT_DEF, test "$output_def" = "yes")
+])