echo 'Making directories:'
cd ${INPUT}
-if $LINKS; then
- files=`ls -LR | sed -n s/:$//p`
-else
- files=`find . -type d -print | sed '/^.$/d'`
-fi
+# Find all directories and all symlinks that point to directories.
+files=` find . -type d -print | sed '/^.$/d'
+ $LINKS && find . -type l -exec test -d '{}' \; -print`
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]
for file in $files; do
# This call to egrep is essential, since checking a file with egrep
# is much faster than actually trying to fix it.
+# It is also essential that most files *not* match!
+# Thus, matching every #endif is unacceptable.
# But the argument to egrep must be kept small, or many versions of egrep
# won't be able to handle it.
# rms: I removed `|#[el].*if.*[^/ ]' because it made egrep fail.
- if egrep '[ _]_IO|CTRL|#define.NULL|#[el]*if.*([0-9]|#e[nl]|sparc|vax|sun|pyr)' $file > /dev/null; then
+ if egrep '[ _]_IO|CTRL|#define.NULL|#[el]*if.*([0-9]|sparc|vax|sun|pyr)' $file > /dev/null; then
echo Fixing $file
if [ -r $file ]; then
cp $file $2/$file >/dev/null 2>&1 \
ex ${LIB}/$file <<EOF
/size_t.*;/
i
-#ifndef _SIZE_T
-#define _SIZE_T
+#ifndef _GCC_SIZE_T
+#define _GCC_SIZE_T
.
/size_t/+1
i
.
/ptrdiff_t.*;/
i
-#ifndef _PTRDIFF_T
-#define _PTRDIFF_T
+#ifndef _GCC_PTRDIFF_T
+#define _GCC_PTRDIFF_T
.
/ptrdiff_t/+1
i
.
/wchar_t.*;/
i
-#ifndef _WCHAR_T
-#define _WCHAR_T
+#ifndef _GCC_WCHAR_T
+#define _GCC_WCHAR_T
.
/wchar_t/+1
i
ex ${LIB}/$file <<EOF
/size_t.*;/
i
-#ifndef _SIZE_T
-#define _SIZE_T
+#ifndef _GCC_SIZE_T
+#define _GCC_SIZE_T
.
/size_t/+1
i
/* Signed type of difference of two pointers. */
#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
+#ifndef _T_PTRDIFF_
#ifndef _T_PTRDIFF
#ifndef __PTRDIFF_T
#ifndef _PTRDIFF_T_
#ifndef ___int_ptrdiff_t_h
+#ifndef _GCC_PTRDIFF_T
#define _PTRDIFF_T
+#define _T_PTRDIFF_
#define _T_PTRDIFF
#define __PTRDIFF_T
#define _PTRDIFF_T_
#define ___int_ptrdiff_t_h
+#define _GCC_PTRDIFF_T
#ifndef __PTRDIFF_TYPE__
#define __PTRDIFF_TYPE__ long int
#endif
typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#endif /* _GCC_PTRDIFF_T */
#endif /* ___int_ptrdiff_t_h */
#endif /* _PTRDIFF_T_ */
#endif /* __PTRDIFF_T */
#endif /* _T_PTRDIFF */
+#endif /* _T_PTRDIFF_ */
#endif /* _PTRDIFF_T */
/* Unsigned type of `sizeof' something. */
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
+#ifndef _T_SIZE_
#ifndef _T_SIZE
#ifndef __SIZE_T
#ifndef _SIZE_T_
#ifndef ___int_size_t_h
+#ifndef _GCC_SIZE_T
#define _SIZE_T
+#define _T_SIZE_
#define _T_SIZE
#define __SIZE_T
#define _SIZE_T_
#define ___int_size_t_h
+#define _GCC_SIZE_T
#ifndef __SIZE_TYPE__
#define __SIZE_TYPE__ long unsigned int
#endif
typedef __SIZE_TYPE__ size_t;
+#endif /* _GCC_SIZE_T */
#endif /* ___int_size_t_h */
#endif /* _SIZE_T_ */
#endif /* __SIZE_T */
#endif /* _T_SIZE */
+#endif /* _T_SIZE_ */
#endif /* _SIZE_T */
/* Data type for wide chars. */
#ifndef __WCHAR_T
#ifndef _WCHAR_T_
#ifndef ___int_wchar_t_h
+#ifndef _GCC_WCHAR_T
#define _WCHAR_T
#define _T_WCHAR_
#define _T_WCHAR
#define __WCHAR_T
#define _WCHAR_T_
#define ___int_wchar_t_h
+#define _GCC_WCHAR_T
#ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ int
#endif
#endif
#endif
#endif
+#endif
#endif /* __sys_stdtypes_h */