Dominique Leuenberger, what about testing for the actual requirement which is whether or not e_Fatal e_ExecStackUnderflow e_NeedInput are defined in a Ghostscript header file? Something like: for error in e_Fatal e_ExecStackUnderflow e_NeedInput ; \ do grep -q "$error" /usr/include/ghostscript/*.h || need_patch="yes" ; \ done if test -n "need_patch" ; then ...