diff options
author | David Lamparter <equinox@diac24.net> | 2010-03-27 15:07:47 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-03-27 15:07:47 +0100 |
commit | aa218e113700e6c1ca884eef7bbfe1c207abb063 (patch) | |
tree | e20af9b8cce7a051d9345c79e995f1fe51e1c3a1 | |
parent | 3274c89ef97e3c517617ae3d083d3306c0e1002c (diff) | |
download | quagga-aa218e113700e6c1ca884eef7bbfe1c207abb063.tar.bz2 quagga-aa218e113700e6c1ca884eef7bbfe1c207abb063.tar.xz |
build: add -g to LDFLAGS
quagga configure adds -g to CFLAGS, but not to LDFLAGS. annoying
inconsistency ensues. just add -g to LDFLAGS so we have debug info by
default. it doesn't slow down stuff, and if people want small binaries
they strip them anyway.
-rwxr-xr-x | configure.ac | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index d53c4c56..1563a622 100755 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,10 @@ elif test -n "$CFLAGS" ; then cflags_specified=yes ; fi +if test -n "$LDFLAGS"; then + ldflags_specified=yes; +fi + dnl -------------------- dnl Check CC and friends dnl -------------------- @@ -144,6 +148,25 @@ else fi dnl -------------- +dnl get debug info +dnl -------------- +if test -z "$ldflags_specified"; then + AC_CACHE_CHECK([whether $LD accepts -g], [ap_cv_ld_g], [ + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -g" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main () { return 0; }]])], + [ap_cv_ld_g=yes], [ap_cv_ld_g=no] + ) + LDFLAGS=$save_LDFLAGS + ]) + if test "$ap_cv_ld_g" = "yes"; then + LDFLAGS="$LDFLAGS -g" + fi +else + AC_MSG_NOTICE([user-supplied LDFLAGS, not appending -g]) +fi + +dnl -------------- dnl Check programs dnl -------------- AC_PROG_INSTALL |