1
0

depend.m4 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # DO_DEPS
  2. # ------------------------------
  3. dnl EGG_CHECK_DEPMODE()
  4. dnl
  5. AC_DEFUN([EGG_CHECK_DEPMODE],
  6. [
  7. CCDEPMODE=gcc
  8. num=`$CXX -dumpversion | sed "s/^\\\(.\\\).*/\\\1/"`
  9. if test $num -ge "3"; then
  10. CCDEPMODE=gcc3
  11. # GCC3="-Wpadded -Wpacked -Wno-unused-parameter -Wmissing-format-attribute -Wdisabled-optimization"
  12. GCC3="-W -Wno-unused-parameter -Wdisabled-optimization -Wno-write-strings -Wno-format-security -fno-strict-aliasing -Woverloaded-virtual -Wno-format-y2k"
  13. GCC3DEB="-Wno-disabled-optimization -Wmissing-format-attribute"
  14. fi
  15. if test $num -ge "4"; then
  16. GCC4DEB="-fstack-protector-all"
  17. fi
  18. AC_SUBST(CCDEPMODE)dnl
  19. AC_SUBST(GCC3)dnl
  20. AC_SUBST(GCC3DEB)dnl
  21. AC_SUBST(GCC4DEB)dnl
  22. ])
  23. AC_DEFUN([DO_DEPS],
  24. [
  25. files="src/Makefile.in src/compat/Makefile.in src/crypto/Makefile.in src/mod/channels.mod/Makefile src/mod/compress.mod/Makefile src/mod/console.mod/Makefile src/mod/ctcp.mod/Makefile src/mod/irc.mod/Makefile src/mod/server.mod/Makefile src/mod/share.mod/Makefile src/mod/transfer.mod/Makefile src/mod/update.mod/Makefile"
  26. for mf in $files; do
  27. # Strip MF so we end up with the name of the file.
  28. # echo "MF: $mf"
  29. mf=`echo "$mf" | sed -e 's/:.*$//'`
  30. dirpart=`AS_DIRNAME("$mf")`
  31. # echo "dirpart: $dirpart mf: $mf"
  32. # rm -rf "$dirpart/.deps/"
  33. rm -f "$dirpart/.deps/includes"
  34. test -d "$dirpart/.deps" || mkdir "$dirpart/.deps"
  35. for file in `sed -n -e '
  36. /^OBJS = .*\\\\$/ {
  37. s/^OBJS = //
  38. :loop
  39. s/\\\\$//
  40. p
  41. n
  42. /\\\\$/ b loop
  43. p
  44. }
  45. /^OBJS = / s/^OBJS = //p' < "$mf"`;
  46. do
  47. base=`basename $file .o`
  48. test -f "$dirpart/$base.c" || continue
  49. if ! test -f "$dirpart/.deps/$base.Po"; then
  50. echo '# dummy' > "$dirpart/.deps/$base.Po"
  51. #Remove the .o file, because it needs to be recompiled for its dependancies.
  52. if test -f "$dirpart/$base.o"; then
  53. rm -f "$dirpart/$base.o"
  54. fi
  55. fi
  56. echo "include .deps/$base.Po" >> "$dirpart/.deps/includes"
  57. echo "_$base.c:" >> "$dirpart/.deps/includes"
  58. done
  59. done
  60. ])