require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_EXEC_OLF_H_)) {
    eval 'sub _SYS_EXEC_OLF_H_ () {1;}' unless defined(&_SYS_EXEC_OLF_H_);
    require 'sys/exec_elf.ph';
    eval 'sub OI_MAG0 () { &EI_MAG0;}' unless defined(&OI_MAG0);
    eval 'sub OI_MAG1 () { &EI_MAG1;}' unless defined(&OI_MAG1);
    eval 'sub OI_MAG2 () { &EI_MAG2;}' unless defined(&OI_MAG2);
    eval 'sub OI_MAG3 () { &EI_MAG3;}' unless defined(&OI_MAG3);
    eval 'sub OI_CLASS () { &EI_CLASS;}' unless defined(&OI_CLASS);
    eval 'sub OI_DATA () { &EI_DATA;}' unless defined(&OI_DATA);
    eval 'sub OI_VERSION () { &EI_VERSION;}' unless defined(&OI_VERSION);
    eval 'sub OI_OS () {7;}' unless defined(&OI_OS);
    eval 'sub OI_DYNAMIC () {8;}' unless defined(&OI_DYNAMIC);
    eval 'sub OI_STRIP () {9;}' unless defined(&OI_STRIP);
    eval 'sub OI_PAD () {10;}' unless defined(&OI_PAD);
    eval 'sub OI_NIDENT () { &EI_NIDENT;}' unless defined(&OI_NIDENT);
    eval 'sub OLFMAG0 () { &ELFMAG0;}' unless defined(&OLFMAG0);
    eval 'sub OLFMAG1 () {ord(\'O\');}' unless defined(&OLFMAG1);
    eval 'sub OLFMAG2 () { &ELFMAG2;}' unless defined(&OLFMAG2);
    eval 'sub OLFMAG3 () { &ELFMAG3;}' unless defined(&OLFMAG3);
    eval 'sub OLFMAG () {"\\177OLF";}' unless defined(&OLFMAG);
    eval 'sub SOLFMAG () { &SELFMAG;}' unless defined(&SOLFMAG);
    eval 'sub OLFCLASSNONE () { &ELFCLASSNONE;}' unless defined(&OLFCLASSNONE);
    eval 'sub OLFCLASS32 () { &ELFCLASS32;}' unless defined(&OLFCLASS32);
    eval 'sub OLFCLASS64 () { &ELFCLASS64;}' unless defined(&OLFCLASS64);
    eval 'sub OLFCLASSNUM () { &ELFCLASSNUM;}' unless defined(&OLFCLASSNUM);
    eval 'sub OLFDATANONE () { &ELFDATANONE;}' unless defined(&OLFDATANONE);
    eval 'sub OLFDATA2LSB () { &ELFDATA2LSB;}' unless defined(&OLFDATA2LSB);
    eval 'sub OLFDATA2MSB () { &ELFDATA2MSB;}' unless defined(&OLFDATA2MSB);
    eval 'sub OLFDATANUM () { &ELFDATANUM;}' unless defined(&OLFDATANUM);
    eval 'sub OOS_NULL () {0;}' unless defined(&OOS_NULL);
    eval 'sub OOS_OPENBSD () {1;}' unless defined(&OOS_OPENBSD);
    eval 'sub OOS_NETBSD () {2;}' unless defined(&OOS_NETBSD);
    eval 'sub OOS_FREEBSD () {3;}' unless defined(&OOS_FREEBSD);
    eval 'sub OOS_44BSD () {4;}' unless defined(&OOS_44BSD);
    eval 'sub OOS_LINUX () {5;}' unless defined(&OOS_LINUX);
    eval 'sub OOS_SVR4 () {6;}' unless defined(&OOS_SVR4);
    eval 'sub OOS_ESIX () {7;}' unless defined(&OOS_ESIX);
    eval 'sub OOS_SOLARIS () {8;}' unless defined(&OOS_SOLARIS);
    eval 'sub OOS_IRIX () {9;}' unless defined(&OOS_IRIX);
    eval 'sub OOS_SCO () {10;}' unless defined(&OOS_SCO);
    eval 'sub OOS_DELL () {11;}' unless defined(&OOS_DELL);
    eval 'sub OOS_NCR () {12;}' unless defined(&OOS_NCR);
    eval 'sub OOS_NUM () {13;}' unless defined(&OOS_NUM);
    eval 'sub OOSN_NULL () {"invalid";}' unless defined(&OOSN_NULL);
    eval 'sub OOSN_OPENBSD () {"openbsd";}' unless defined(&OOSN_OPENBSD);
    eval 'sub OOSN_NETBSD () {"netbsd";}' unless defined(&OOSN_NETBSD);
    eval 'sub OOSN_FREEBSD () {"freebsd";}' unless defined(&OOSN_FREEBSD);
    eval 'sub OOSN_44BSD () {"44bsd";}' unless defined(&OOSN_44BSD);
    eval 'sub OOSN_LINUX () {"linux";}' unless defined(&OOSN_LINUX);
    eval 'sub OOSN_SVR4 () {"svr4";}' unless defined(&OOSN_SVR4);
    eval 'sub OOSN_ESIX () {"esix";}' unless defined(&OOSN_ESIX);
    eval 'sub OOSN_SOLARIS () {"solaris";}' unless defined(&OOSN_SOLARIS);
    eval 'sub OOSN_IRIX () {"irix";}' unless defined(&OOSN_IRIX);
    eval 'sub OOSN_SCO () {"sco";}' unless defined(&OOSN_SCO);
    eval 'sub OOSN_DELL () {"dell";}' unless defined(&OOSN_DELL);
    eval 'sub OOSN_NCR () {"ncr";}' unless defined(&OOSN_NCR);
    eval 'sub ONAMEV () {{  &OOSN_NULL,  &OOSN_OPENBSD,  &OOSN_NETBSD,  &OOSN_FREEBSD,  &OOSN_44BSD,  &OOSN_LINUX,  &OOSN_SVR4,  &OOSN_ESIX,  &OOSN_SOLARIS,  &OOSN_IRIX,  &OOSN_SCO,  &OOSN_DELL,  &OOSN_NCR, 0};}' unless defined(&ONAMEV);
    eval 'sub ODYNAMIC_N () {0;}' unless defined(&ODYNAMIC_N);
    eval 'sub ODYNAMIC () {1;}' unless defined(&ODYNAMIC);
    eval 'sub OSTRIP () {0;}' unless defined(&OSTRIP);
    eval 'sub OSTRIP_N () {1;}' unless defined(&OSTRIP_N);
    eval 'sub IS_OLF {
        my($ehdr) = @_;
	    eval q((($ehdr). $e_ident[ &OI_MAG0] ==  &OLFMAG0  && ($ehdr). $e_ident[ &OI_MAG1] ==  &OLFMAG1  && ($ehdr). $e_ident[ &OI_MAG2] ==  &OLFMAG2  && ($ehdr). $e_ident[ &OI_MAG3] ==  &OLFMAG3));
    }' unless defined(&IS_OLF);
}
1;
