]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Add --enable-symbolic-functions configure option
authorTakashi Iwai <tiwai@suse.de>
Tue, 10 Apr 2007 11:24:52 +0000 (13:24 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 10 Apr 2007 11:24:52 +0000 (13:24 +0200)
Added --enable-symbolic-functions configure option.  This will detect
and pass -Bsymbolic-functions linker option, which gives you better
performance and smaller binary size.  Only recent binutils supports
this option.

configure.in
src/Makefile.am

index 09b4ec00168766695c56e30298180b2c1188749b..a60de0462e89117e270a7a25e772a2d4c36b25bd 100644 (file)
@@ -107,6 +107,23 @@ else
 fi
 AM_CONDITIONAL(VERSIONED_SYMBOLS, test x$versioned = xyes)
 
+dnl Check for symbolic-functions
+AC_MSG_CHECKING(for symbolic-functions)
+AC_ARG_ENABLE(symbolic-functions,
+  AS_HELP_STRING([--enable-symbolic-functions],
+    [use -Bsymbolic-functions option if available (optmization for size and speed)]),
+  symfuncs="$enableval", symfuncs="no")
+if test "$symfuncs" = "yes"; then
+  if ld --help | grep -q -- '-Bsymbolic-functions'; then
+    AC_MSG_RESULT(yes)
+  else
+    AC_MSG_RESULT(not supported by ld)
+  fi
+else
+  AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(SYMBOLIC_FUNCTIONS, test x"$symfuncs" = xyes)
+
 dnl See if toolchain has a custom prefix for symbols ...
 AC_MSG_CHECKING(for custom symbol prefixes)
 SYMBOL_PREFIX=` \
index 32ac8ad21adb99420d98fd2eb736cfa925ff82c9..3be7049c4b9406025d72fb7e8727606decf203c7 100644 (file)
@@ -7,6 +7,12 @@ else
 VSYMS =
 endif
 
+if SYMBOLIC_FUNCTIONS
+SYMFUNCS = -Wl,-Bsymbolic-functions
+else
+SYMFUNCS =
+endif
+
 lib_LTLIBRARIES = libasound.la
 libasound_la_SOURCES = conf.c confmisc.c input.c output.c async.c error.c dlmisc.c socket.c shmarea.c userfile.c names.c
 
@@ -43,7 +49,7 @@ endif
 SUBDIRS += compat conf
 libasound_la_LIBADD += compat/libcompat.la @ALSA_DEPLIBS@
 
-libasound_la_LDFLAGS = -version-info $(COMPATNUM) $(VSYMS)
+libasound_la_LDFLAGS = -version-info $(COMPATNUM) $(VSYMS) $(SYMFUNCS)
 
 control/libcontrol.la:
        $(MAKE) -C control libcontrol.la