1
0

depend.m4 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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"
  13. GCC3DEB="-Wno-disabled-optimization -Wmissing-format-attribute"
  14. fi
  15. AC_SUBST(CCDEPMODE)dnl
  16. AC_SUBST(GCC3)dnl
  17. AC_SUBST(GCC3DEB)dnl
  18. ])
  19. AC_DEFUN([DO_DEPS],
  20. [
  21. 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"
  22. for mf in $files; do
  23. # Strip MF so we end up with the name of the file.
  24. # echo "MF: $mf"
  25. mf=`echo "$mf" | sed -e 's/:.*$//'`
  26. dirpart=`AS_DIRNAME("$mf")`
  27. # echo "dirpart: $dirpart mf: $mf"
  28. # rm -rf "$dirpart/.deps/"
  29. rm -f "$dirpart/.deps/includes"
  30. test -d "$dirpart/.deps" || mkdir "$dirpart/.deps"
  31. for file in `sed -n -e '
  32. /^OBJS = .*\\\\$/ {
  33. s/^OBJS = //
  34. :loop
  35. s/\\\\$//
  36. p
  37. n
  38. /\\\\$/ b loop
  39. p
  40. }
  41. /^OBJS = / s/^OBJS = //p' < "$mf"`;
  42. do
  43. base=`basename $file .o`
  44. test -f "$dirpart/$base.c" || continue
  45. if ! test -f "$dirpart/.deps/$base.Po"; then
  46. echo '# dummy' > "$dirpart/.deps/$base.Po"
  47. #Remove the .o file, because it needs to be recompiled for its dependancies.
  48. if test -f "$dirpart/$base.o"; then
  49. rm -f "$dirpart/$base.o"
  50. fi
  51. fi
  52. echo "include .deps/$base.Po" >> "$dirpart/.deps/includes"
  53. echo "_$base.c:" >> "$dirpart/.deps/includes"
  54. done
  55. done
  56. ])