GitHub repository: wspr/ifplatform
Description: Detect the platform/shell pdfTeX is running on