libspnav-0.2.2-custom-flags.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. diff -Npur libspnav-0.2.2.orig/Makefile.in libspnav-0.2.2/Makefile.in
  2. --- libspnav-0.2.2.orig/Makefile.in 2012-01-31 22:34:01.448356249 +0100
  3. +++ libspnav-0.2.2/Makefile.in 2012-01-31 22:39:20.229350669 +0100
  4. @@ -7,7 +7,8 @@ lib_so = $(soname).1
  5. CC = gcc
  6. AR = ar
  7. -CFLAGS = $(opt) $(dbg) -std=c89 -fpic -pedantic -Wall -fno-strict-aliasing -I.
  8. +CFLAGS = $(opt) -fpic -I.
  9. +LDFLAGS = $(ldopt) -shared -Wl,-soname,$(soname)
  10. .PHONY: all
  11. all: $(lib_a) $(lib_so)
  12. @@ -16,7 +17,7 @@ $(lib_a): $(obj)
  13. $(AR) rcs $@ $(obj)
  14. $(lib_so): $(obj)
  15. - $(CC) -shared -Wl,-soname,$(soname) -o $@ $(obj)
  16. + $(CC) $(LDFLAGS) -o $@ $(obj)
  17. %.o: $(srcdir)/%.c
  18. $(CC) $(CFLAGS) -c $< -o $@
  19. diff -Npur libspnav-0.2.2.orig/configure libspnav-0.2.2/configure
  20. --- libspnav-0.2.2.orig/configure 2012-01-31 22:34:01.448356249 +0100
  21. +++ libspnav-0.2.2/configure 2012-01-31 22:34:39.703355615 +0100
  22. @@ -4,6 +4,7 @@ echo 'configuring spacenav library...'
  23. PREFIX=/usr/local
  24. OPT=yes
  25. +LDOPT=yes
  26. DBG=yes
  27. X11=yes
  28. @@ -26,6 +27,11 @@ for arg; do
  29. --disable-opt)
  30. OPT=no;;
  31. + --enable-ldopt)
  32. + LDOPT=yes;;
  33. + --disable-ldopt)
  34. + LDOPT=no;;
  35. +
  36. --enable-debug)
  37. DBG=yes;;
  38. --disable-debug)
  39. @@ -44,6 +50,8 @@ for arg; do
  40. echo ' --disable-x11: disable X11 communication mode'
  41. echo ' --enable-opt: enable speed optimizations (default)'
  42. echo ' --disable-opt: disable speed optimizations'
  43. + echo ' --enable-ldopt: enable link optimizations (default)'
  44. + echo ' --disable-ldopt: disable link optimizations'
  45. echo ' --enable-debug: include debugging symbols (default)'
  46. echo ' --disable-debug: do not include debugging symbols'
  47. echo 'all invalid options are silently ignored'
  48. @@ -54,6 +62,7 @@ done
  49. echo " prefix: $PREFIX"
  50. echo " optimize for speed: $OPT"
  51. +echo " optimize link: $LDOPT"
  52. echo " include debugging symbols: $DBG"
  53. echo " x11 communication method: $X11"
  54. echo ""
  55. @@ -74,7 +83,11 @@ if [ "$DBG" = 'yes' ]; then
  56. fi
  57. if [ "$OPT" = 'yes' ]; then
  58. - echo 'opt = -O3' >>Makefile
  59. + echo "opt = ${CFLAGS:--O3}" >>Makefile
  60. +fi
  61. +
  62. +if [ "$LDOPT" = 'yes' ]; then
  63. + echo "ldopt = ${LDFLAGS}" >>Makefile
  64. fi
  65. if [ "$X11" = 'yes' ]; then