title: compile libconfig++ with -static-libgcc and -static-libstdc++
body: <p>I'm trying to compile <a href="http://www.hyperrealm.com/libconfig/" rel="nofollow">libconfig++</a> version 1.4.8 with</p>
  
  <pre><code>make LDFLAGS='-static-libstdc++ -static-libgcc'
  </code></pre>
  
  <p>but this doesn't seem to work since I'm still getting:</p>
  
  <pre><code>$ readelf -d lib/.libs/libconfig++.so | grep NEEDED
   0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
   0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
   0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
   0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
  </code></pre>
  
  <p>I'm noticing that the second-to-last compile step for the so file contains my LDFLAGS:</p>
  
  <pre><code>/bin/bash ../libtool --tag=CXX   --mode=link g++  -g -O2 -Wall -Wshadow -Wextra -Wno-unused-parameter -version-info 10:3:1 -no-undefined -static-libgc
  c -o libconfig++.la -rpath /usr/local/lib libconfig___la-libconfig.lo libconfig___la-scanner.lo libconfig___la-grammar.lo libconfig___la-scanctx.lo li
  bconfig___la-strbuf.lo libconfig___la-libconfigcpp.lo
  </code></pre>
  
  <p>Whereas it appears like the very last one doesn't:</p>
  
  <pre><code>libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.7
  /crtbeginS.o  .libs/libconfig___la-libconfig.o .libs/libconfig___la-scanner.o .libs/libconfig___la-grammar.o .libs/libconfig___la-scanctx.o .libs/libc
  onfig___la-strbuf.o .libs/libconfig___la-libconfigcpp.o   -L/usr/lib/gcc/x86_64-linux-gnu/4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linu
  x-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/l
  ib/gcc/x86_64-linux-gnu/4.7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x
  86_64-linux-gnu/crtn.o  -O2   -Wl,-soname -Wl,libconfig++.so.9 -o .libs/libconfig++.so.9.1.3
  </code></pre>
  
  <p>Could this be the cause of it, and in that case, how would I go about fixing/working around it?</p>