ltrace-0.5.3-configure-fixes.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. Fix several issues with the configure script:
  2. * Allow option values to contains equal signs, like
  3. CC="/foo/arm-linux-gcc --sysroot=/foobar/usr"
  4. * Parse the option before doing the tests so that CC/CFLAGS can be
  5. used during the tests.
  6. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  7. ---
  8. configure | 72 +++++++++++++++++++++++++++++++-------------------------------
  9. 1 file changed, 37 insertions(+), 35 deletions(-)
  10. Index: ltrace-0.5.3/configure
  11. ===================================================================
  12. --- ltrace-0.5.3.orig/configure
  13. +++ ltrace-0.5.3/configure
  14. @@ -6,6 +6,38 @@
  15. exit 1
  16. fi
  17. +CC=gcc
  18. +CPPFLAGS=' -I /usr/include/libelf'
  19. +CFLAGS='-g -O2'
  20. +LIBS='-lelf '
  21. +INSTALL='/usr/bin/install -c'
  22. +iquote='-iquote '
  23. +iquoteend=''
  24. +
  25. +prefix=/usr/local
  26. +sysconfdir='${prefix}/etc'
  27. +bindir='${prefix}/bin'
  28. +mandir='${prefix}/share/man'
  29. +docdir='${prefix}/share/doc/ltrace'
  30. +for x_option
  31. +do
  32. + if test -n "$x_prev"; then
  33. + eval $x_prev=\$x_option
  34. + x_prev=
  35. + continue
  36. + fi
  37. + case $x_option in
  38. + --*=* | *=*)
  39. + x_var=`echo $x_option | sed 's/^--//' | sed 's/=.*//'`
  40. + x_val=`echo $x_option | sed 's/^[^=]*=//'`
  41. + eval $x_var=\"$x_val\"
  42. + ;;
  43. + --*)
  44. + x_prev=`echo $x_option | sed 's/^--//'`
  45. + ;;
  46. + esac
  47. +done
  48. +
  49. echo -n "checking package name... "
  50. PACKAGE_NAME='ltrace'
  51. echo $PACKAGE_NAME
  52. @@ -30,9 +62,10 @@
  53. return cplus_demangle();
  54. }
  55. EOF
  56. -if gcc conftest.c -liberty 2>/dev/null
  57. +if $CC $CFLAGS conftest.c -liberty 2>/dev/null
  58. then
  59. HAVE_LIBIBERTY=1
  60. + LIBS="$LIBS -liberty"
  61. echo "yes"
  62. else
  63. unset HAVE_LIBIBERTY
  64. @@ -48,9 +81,10 @@
  65. return __cxa_demangle();
  66. }
  67. EOF
  68. -if gcc conftest.c -lsupc++ 2>/dev/null
  69. +if $CC $CFLAGS conftest.c -lsupc++ 2>/dev/null
  70. then
  71. HAVE_LIBSUPC__=1
  72. + LIBS="$LIBS -lsupc++"
  73. echo "yes"
  74. else
  75. unset HAVE_LIBSUPC__
  76. @@ -67,7 +101,7 @@
  77. return 0;
  78. }
  79. EOF
  80. -if gcc conftest.c 2>/dev/null
  81. +if $CC $CFLAGS conftest.c 2>/dev/null
  82. then
  83. HAVE_ELF_C_READ_MMAP=1
  84. echo "yes"
  85. @@ -77,38 +111,6 @@
  86. fi
  87. rm -f conftest.c a.out
  88. -CC=gcc
  89. -CPPFLAGS=' -I /usr/include/libelf'
  90. -CFLAGS='-g -O2'
  91. -LIBS='-lelf -lsupc++ -liberty '
  92. -INSTALL='/usr/bin/install -c'
  93. -iquote='-iquote '
  94. -iquoteend=''
  95. -
  96. -prefix=/usr/local
  97. -sysconfdir='${prefix}/etc'
  98. -bindir='${prefix}/bin'
  99. -mandir='${prefix}/share/man'
  100. -docdir='${prefix}/share/doc/ltrace'
  101. -for x_option
  102. -do
  103. - if test -n "$x_prev"; then
  104. - eval $x_prev=\$x_option
  105. - x_prev=
  106. - continue
  107. - fi
  108. - case $x_option in
  109. - --*=* | *=*)
  110. - x_var=`echo $x_option | sed 's/^--//' | sed 's/=.*//'`
  111. - x_val=`echo $x_option | sed 's/^.*=//'`
  112. - eval $x_var=$x_val
  113. - ;;
  114. - --*)
  115. - x_prev=`echo $x_option | sed 's/^--//'`
  116. - ;;
  117. - esac
  118. -done
  119. -
  120. echo "configure: creating Makefile"
  121. #
  122. # Makefile.in -> Makefile