configure.ac: Move link only flags out of CFLAGS and into LDFLAGS.
authorRandy Witt <rewitt@declaratino.com>
Fri, 16 Mar 2012 05:01:18 +0000 (01:01 -0400)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 17 Mar 2012 06:34:08 +0000 (03:34 -0300)
On the ARM gcc 4.2.2 I'm using I get many
"--as-needed: linker input file unused because linking not done"
style errors when libtool is using compile mode.

In order to silence these warnings and be "correct", the flags that
only make sense for linking were moved into LDFLAGS.

configure.ac

index 7c04a4a..d35141c 100644 (file)
@@ -126,9 +126,11 @@ CC_CHECK_CFLAGS_APPEND([ \
                        -fdiagnostics-show-option \
                        -fvisibility=hidden \
                        -ffunction-sections \
-                       -fdata-sections \
-                       -Wl,--as-needed \
-                       -Wl,--gc-sections])
+                       -fdata-sections])
+
+CC_CHECK_LDFLAGS_APPEND([ \
+                        -Wl,--as-needed \
+                        -Wl,--gc-sections])
 
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_FILES([