Search for exclude-libs support at configure time
authorSandro Santilli <strk@keybit.net>
Mon, 21 Sep 2015 16:16:15 +0000 (16:16 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 21 Sep 2015 16:16:15 +0000 (16:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14082 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac

index 87e1cc7ae2a3d516cc5d606d6630f556888bfea1..eaa748c8554902e0e494462abf2f0a90e1a4bfc9 100644 (file)
@@ -68,6 +68,14 @@ NUMERICFLAGS=""
 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ffloat-store], [dummy_cv_ffloat_store], [-ffloat-store], [], [NUMERICFLAGS="$NUMERICFLAGS -ffloat-store"], [])
 AC_SUBST([NUMERICFLAGS])
 
+dnl
+dnl Exporting used library symbols in the module is a source of issues,
+dnl see https://trac.osgeo.org/postgis/ticket/3281
+dnl
+EXCLUDELIBS_LDFLAGS=""
+AC_LIBTOOL_COMPILER_OPTION([if $compiler supports --exclude-libs], [_cv_exclude_libs], [--Wl,--exclude-libs,ALL], [], [EXCLUDELIBS_LDFLAGS="-Wl,--exclude-libs,ALL"], [])
+AC_SUBST([EXCLUDELIBS_LDFLAGS])
+
 dnl
 dnl Define executable suffix for use with the loader Makefiles
 dnl
@@ -997,7 +1005,7 @@ fi
 CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $JSON_CPPFLAGS $PCRE_CPPFLAGS $CPPFLAGS"
 dnl AC_MSG_RESULT([CPPFLAGS: $CPPFLAGS])
 
-SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $SFCGAL_LDFLAGS $PCRE_LDFLAGS"
+SHLIB_LINK="$PGSQL_LDFLAGS $GEOS_LDFLAGS $PROJ_LDFLAGS -lgeos_c -lproj $JSON_LDFLAGS $XML2_LDFLAGS $SFCGAL_LDFLAGS $PCRE_LDFLAGS $EXCLUDELIBS_LDFLAGS"
 AC_SUBST([SHLIB_LINK])
 dnl AC_MSG_RESULT([SHLIB_LINK: $SHLIB_LINK])