configure: Create *.d files safely
The previous implementation (recursively calling function) was not
safe when there was some symbolic link to a directory
@@ -1798,25 +1798,13 @@ | ||
1798 | 1798 | |
1799 | 1799 | |
1800 | 1800 | # create dependency files if there are none |
1801 | -makedep() { | |
1802 | - for i in ${1}*.c | |
1803 | - do | |
1804 | - if [ -f "${i}" ] && [ ! -f "${i%.c}.d" ] | |
1805 | - then | |
1806 | - printf 'touching %s\n' "${i%.c}.d" | |
1807 | - >>"${i%.c}.d" | |
1808 | - printf 'Touched %s\n' "${i%.c}.d" >&5 | |
1809 | - fi | |
1810 | - done | |
1811 | - for i in ${1}*/ | |
1812 | - do | |
1813 | - if [ -d "${i}" ] | |
1814 | - then | |
1815 | - makedep "${i}" | |
1816 | - fi | |
1817 | - done | |
1818 | -} | |
1819 | -makedep '' | |
1801 | +find . -name '*.c' -exec sh -c ' | |
1802 | +dfile="${1%.c}.d" | |
1803 | +[ -f "$dfile" ] && exit | |
1804 | +printf "touching %s\n" "$dfile" | |
1805 | +>>"$dfile" | |
1806 | +printf "Touched %s\n" "$dfile" >&5 | |
1807 | +' x {} \; | |
1820 | 1808 | |
1821 | 1809 | # create config.status |
1822 | 1810 | printf 'creating %s... ' "${configstatus}" |