Resolve a conflict between gloss and hyperref

If hyperref is loaded, the gloss pacakage tryies to map its \glosslinkborder to \pdfborder. When the source TeX file is not compiled by PDFLaTeX, this will cause a problem when \gloss is used to cite the glossary item:

! Undefined control sequence.
\glosslinkborder ->\@pdfborder

The problem can be solved by redefine the command \glosslinkborder:

\renewcommand{\glosslinkborder}{}

Or it can be made somewhat intelligent:

\usepackage{gloss}
\usepackage{hyperref}

\newif\ifPDF%
\ifx\pdfoutput\undefined\PDFfalse%
\else\ifnum\pdfoutput > 0\PDFtrue%
     \else\PDFfalse%
     \fi%
\fi%

\ifPDF%
    \usepackage[pdftex]{graphicx,color}%
\else%
    \usepackage[dvips]{graphicx,color}
    \renewcommand{\glosslinkborder}{}
\fi%