macOS llvm/gcc does not support this flag; llvm checks unresolved symbols without it
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 4 Apr 2019 12:31:18 +0000 (14:31 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Thu, 4 Apr 2019 12:31:18 +0000 (14:31 +0200)
configure.ac

index f4ce605201b497ae82c1b4c1613e97c8d007148a..d9e6af74d273944b199393670f61137536e0294d 100644 (file)
@@ -50,7 +50,6 @@ AC_FUNC_FSEEKO
 
 
 CFLAGS="-Wall $CFLAGS"
-LDFLAGS="$LDFLAGS -Wl,--unresolved-symbols=report-all"
 # use '-fno-strict-aliasing', but only if the compiler can take it
 if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
 then
@@ -65,12 +64,16 @@ funcstocheck="getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo ge
 # Srcdir in a form that native compiler understands (i.e. DOS path on W32)
 native_srcdir=$srcdir
 
+OLD_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,--unresolved-symbols=report-all"
+
 # Check system type
 case "$host_os" in
 *darwin* | *rhapsody* | *macosx*)
      AC_DEFINE_UNQUOTED(DARWIN,1,[This is an Apple Darwin system])
      CPPFLAGS="-D_APPLE_C_SOURCE $CPPFLAGS"
      CFLAGS="-fno-common $CFLAGS"
+     LDFLAGS="$OLD_LDFLAGS"
      AC_MSG_WARN([WARNING: The VPN application cannot be compiled on your OS])
      AC_CHECK_LIB(intl, gettext)
      build_target="darwin"