depend.m4 1.8 KB

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