require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MACHINE_EXEC_H_)) {
    eval 'sub _MACHINE_EXEC_H_ () {1;}' unless defined(&_MACHINE_EXEC_H_);
    eval 'sub __LDPGSZ () {8192;}' unless defined(&__LDPGSZ);
    unless(defined(&__ELF__)) {
	eval("sub RELOC_8 () { 0; }") unless defined(&RELOC_8);
	eval("sub RELOC_16 () { 1; }") unless defined(&RELOC_16);
	eval("sub RELOC_32 () { 2; }") unless defined(&RELOC_32);
	eval("sub RELOC_DISP8 () { 3; }") unless defined(&RELOC_DISP8);
	eval("sub RELOC_DISP16 () { 4; }") unless defined(&RELOC_DISP16);
	eval("sub RELOC_DISP32 () { 5; }") unless defined(&RELOC_DISP32);
	eval("sub RELOC_WDISP30 () { 6; }") unless defined(&RELOC_WDISP30);
	eval("sub RELOC_WDISP22 () { 7; }") unless defined(&RELOC_WDISP22);
	eval("sub RELOC_HI22 () { 8; }") unless defined(&RELOC_HI22);
	eval("sub RELOC_22 () { 9; }") unless defined(&RELOC_22);
	eval("sub RELOC_13 () { 10; }") unless defined(&RELOC_13);
	eval("sub RELOC_LO10 () { 11; }") unless defined(&RELOC_LO10);
	eval("sub RELOC_UNUSED1 () { 12; }") unless defined(&RELOC_UNUSED1);
	eval("sub RELOC_UNUSED2 () { 13; }") unless defined(&RELOC_UNUSED2);
	eval("sub RELOC_BASE10 () { 14; }") unless defined(&RELOC_BASE10);
	eval("sub RELOC_BASE13 () { 15; }") unless defined(&RELOC_BASE13);
	eval("sub RELOC_BASE22 () { 16; }") unless defined(&RELOC_BASE22);
	eval("sub RELOC_PC10 () { 17; }") unless defined(&RELOC_PC10);
	eval("sub RELOC_PC22 () { 18; }") unless defined(&RELOC_PC22);
	eval("sub RELOC_JMP_TBL () { 19; }") unless defined(&RELOC_JMP_TBL);
	eval("sub RELOC_UNUSED3 () { 20; }") unless defined(&RELOC_UNUSED3);
	eval("sub RELOC_GLOB_DAT () { 21; }") unless defined(&RELOC_GLOB_DAT);
	eval("sub RELOC_JMP_SLOT () { 22; }") unless defined(&RELOC_JMP_SLOT);
	eval("sub RELOC_RELATIVE () { 23; }") unless defined(&RELOC_RELATIVE);
	eval 'sub relocation_info () { &relocation_info_sparc;}' unless defined(&relocation_info);
    } else {
	eval 'sub R_SPARC_NONE () {0;}' unless defined(&R_SPARC_NONE);
	eval 'sub R_SPARC_8 () {1;}' unless defined(&R_SPARC_8);
	eval 'sub R_SPARC_16 () {2;}' unless defined(&R_SPARC_16);
	eval 'sub R_SPARC_32 () {3;}' unless defined(&R_SPARC_32);
	eval 'sub R_SPARC_DISP8 () {4;}' unless defined(&R_SPARC_DISP8);
	eval 'sub R_SPARC_DISP16 () {5;}' unless defined(&R_SPARC_DISP16);
	eval 'sub R_SPARC_DISP32 () {6;}' unless defined(&R_SPARC_DISP32);
	eval 'sub R_SPARC_WDISP30 () {7;}' unless defined(&R_SPARC_WDISP30);
	eval 'sub R_SPARC_WDISP22 () {8;}' unless defined(&R_SPARC_WDISP22);
	eval 'sub R_SPARC_HI22 () {9;}' unless defined(&R_SPARC_HI22);
	eval 'sub R_SPARC_22 () {10;}' unless defined(&R_SPARC_22);
	eval 'sub R_SPARC_13 () {11;}' unless defined(&R_SPARC_13);
	eval 'sub R_SPARC_LO10 () {12;}' unless defined(&R_SPARC_LO10);
	eval 'sub R_SPARC_GOT10 () {13;}' unless defined(&R_SPARC_GOT10);
	eval 'sub R_SPARC_GOT13 () {14;}' unless defined(&R_SPARC_GOT13);
	eval 'sub R_SPARC_GOT22 () {15;}' unless defined(&R_SPARC_GOT22);
	eval 'sub R_SPARC_PC10 () {16;}' unless defined(&R_SPARC_PC10);
	eval 'sub R_SPARC_PC22 () {17;}' unless defined(&R_SPARC_PC22);
	eval 'sub R_SPARC_WPLT30 () {18;}' unless defined(&R_SPARC_WPLT30);
	eval 'sub R_SPARC_COPY () {19;}' unless defined(&R_SPARC_COPY);
	eval 'sub R_SPARC_GLOB_DAT () {20;}' unless defined(&R_SPARC_GLOB_DAT);
	eval 'sub R_SPARC_JMP_SLOT () {21;}' unless defined(&R_SPARC_JMP_SLOT);
	eval 'sub R_SPARC_RELATIVE () {22;}' unless defined(&R_SPARC_RELATIVE);
	eval 'sub R_SPARC_UA32 () {23;}' unless defined(&R_SPARC_UA32);
	eval 'sub R_SPARC_PLT32 () {24;}' unless defined(&R_SPARC_PLT32);
	eval 'sub R_SPARC_HIPLT22 () {25;}' unless defined(&R_SPARC_HIPLT22);
	eval 'sub R_SPARC_LOPLT10 () {26;}' unless defined(&R_SPARC_LOPLT10);
	eval 'sub R_SPARC_PCPLT32 () {27;}' unless defined(&R_SPARC_PCPLT32);
	eval 'sub R_SPARC_PCPLT22 () {28;}' unless defined(&R_SPARC_PCPLT22);
	eval 'sub R_SPARC_PCPLT10 () {29;}' unless defined(&R_SPARC_PCPLT10);
	eval 'sub R_SPARC_10 () {30;}' unless defined(&R_SPARC_10);
	eval 'sub R_SPARC_11 () {31;}' unless defined(&R_SPARC_11);
	eval 'sub R_SPARC_64 () {32;}' unless defined(&R_SPARC_64);
	eval 'sub R_SPARC_OLO10 () {33;}' unless defined(&R_SPARC_OLO10);
	eval 'sub R_SPARC_HH22 () {34;}' unless defined(&R_SPARC_HH22);
	eval 'sub R_SPARC_HM10 () {35;}' unless defined(&R_SPARC_HM10);
	eval 'sub R_SPARC_LM22 () {36;}' unless defined(&R_SPARC_LM22);
	eval 'sub R_SPARC_PC_HH22 () {37;}' unless defined(&R_SPARC_PC_HH22);
	eval 'sub R_SPARC_PC_HM10 () {38;}' unless defined(&R_SPARC_PC_HM10);
	eval 'sub R_SPARC_PC_LM22 () {39;}' unless defined(&R_SPARC_PC_LM22);
	eval 'sub R_SPARC_WDISP16 () {40;}' unless defined(&R_SPARC_WDISP16);
	eval 'sub R_SPARC_WDISP19 () {41;}' unless defined(&R_SPARC_WDISP19);
	eval 'sub R_SPARC_GLOB_JMP () {42;}' unless defined(&R_SPARC_GLOB_JMP);
	eval 'sub R_SPARC_7 () {43;}' unless defined(&R_SPARC_7);
	eval 'sub R_SPARC_5 () {44;}' unless defined(&R_SPARC_5);
	eval 'sub R_SPARC_6 () {45;}' unless defined(&R_SPARC_6);
	eval 'sub R_SPARC_TLS_DTPMOD32 () {74;}' unless defined(&R_SPARC_TLS_DTPMOD32);
	eval 'sub R_SPARC_TLS_DTPMOD64 () {75;}' unless defined(&R_SPARC_TLS_DTPMOD64);
	eval 'sub R_SPARC_TLS_DTPOFF32 () {76;}' unless defined(&R_SPARC_TLS_DTPOFF32);
	eval 'sub R_SPARC_TLS_DTPOFF64 () {77;}' unless defined(&R_SPARC_TLS_DTPOFF64);
	eval 'sub R_SPARC_TLS_TPOFF32 () {78;}' unless defined(&R_SPARC_TLS_TPOFF32);
	eval 'sub R_SPARC_TLS_TPOFF64 () {79;}' unless defined(&R_SPARC_TLS_TPOFF64);
	eval 'sub R_TYPE {
	    my($name) = @_;
    	    eval q( &__CONCAT( &R_SPARC_,$name));
	}' unless defined(&R_TYPE);
    }
    eval 'sub NATIVE_EXEC_ELF () {1;}' unless defined(&NATIVE_EXEC_ELF);
    eval 'sub ARCH_ELFSIZE () {32;}' unless defined(&ARCH_ELFSIZE);
    eval 'sub ELF_TARG_CLASS () { &ELFCLASS32;}' unless defined(&ELF_TARG_CLASS);
    eval 'sub ELF_TARG_DATA () { &ELFDATA2MSB;}' unless defined(&ELF_TARG_DATA);
    eval 'sub ELF_TARG_MACH () { &EM_SPARC;}' unless defined(&ELF_TARG_MACH);
    eval 'sub _NLIST_DO_AOUT () {1;}' unless defined(&_NLIST_DO_AOUT);
    eval 'sub _NLIST_DO_ELF () {1;}' unless defined(&_NLIST_DO_ELF);
    eval 'sub cpu_exec_aout_makecmds {
        my($p, $epp) = @_;
	    eval q(( &ENOEXEC));
    }' unless defined(&cpu_exec_aout_makecmds);
    eval 'sub _KERN_DO_ELF () {1;}' unless defined(&_KERN_DO_ELF);
}
1;
