diff options
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | src/Makefile.am | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index d0b3a78..868314e 100644 --- a/configure.ac +++ b/configure.ac @@ -44,18 +44,18 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +AC_PROG_LD AC_GNU_SOURCE AX_CXX_COMPILE_STDCXX([11]) -# Detect whether clang is being used -# clang has a gcc alias, so we can no tell from $CXX -using_clang=no -if `$CXX --version 2>&1 | grep 'clang' >/dev/null 2>&1` ; then - using_clang=yes +# Detect whether LLVM ld is being used +using_lld=no +if `$LD -v 2>&1 | grep 'LLVM' >/dev/null 2>&1` ; then + using_lld=yes fi -AM_CONDITIONAL([CLANG], [test "$using_clang" = "yes"]) +AM_CONDITIONAL([LLVMLD], [test "$using_lld" = "yes"]) # Init libtool AC_PROG_LIBTOOL diff --git a/src/Makefile.am b/src/Makefile.am index ef9a042..76ca0f9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -81,10 +81,10 @@ libpinyin_la_SOURCES = $(pinyin_SOURCES) pinyin.cpp libpinyin_la_LIBADD = @GLIB2_LIBS@ -if CLANG +if LLVMLD ## LLVM linker does not support --version-script, ## use -exported_symbols_list instead -libpinyin_la_LDFLAGS = -Wl -exported_symbols_list $(srcdir)/libpinyin.exp \ +libpinyin_la_LDFLAGS = -Wl,-exported_symbols_list,$(srcdir)/libpinyin.exp \ -version-info @LT_VERSION_INFO@ else libpinyin_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libpinyin.ver \ @@ -98,10 +98,10 @@ libzhuyin_la_SOURCES = $(pinyin_SOURCES) zhuyin.cpp libzhuyin_la_LIBADD = @GLIB2_LIBS@ -if CLANG +if LLVMLD ## LLVM linker does not support --version-script, ## use -exported_symbols_list instead -libzhuyin_la_LDFLAGS = -Wl -exported_symbols_list $(srcdir)/libzhuyin.exp \ +libzhuyin_la_LDFLAGS = -Wl,-exported_symbols_list=$(srcdir)/libzhuyin.exp \ -version-info @LT_VERSION_INFO@ else libzhuyin_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libzhuyin.ver \ |