require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&OPENSSL_DOING_MAKEDEPEND)) {
    unless(defined(&OPENSSL_NO_CAMELLIA)) {
	eval 'sub OPENSSL_NO_CAMELLIA () {1;}' unless defined(&OPENSSL_NO_CAMELLIA);
    }
    unless(defined(&OPENSSL_NO_CMS)) {
	eval 'sub OPENSSL_NO_CMS () {1;}' unless defined(&OPENSSL_NO_CMS);
    }
    unless(defined(&OPENSSL_NO_GMP)) {
	eval 'sub OPENSSL_NO_GMP () {1;}' unless defined(&OPENSSL_NO_GMP);
    }
    unless(defined(&OPENSSL_NO_GOST)) {
	eval 'sub OPENSSL_NO_GOST () {1;}' unless defined(&OPENSSL_NO_GOST);
    }
    unless(defined(&OPENSSL_NO_JPAKE)) {
	eval 'sub OPENSSL_NO_JPAKE () {1;}' unless defined(&OPENSSL_NO_JPAKE);
    }
    unless(defined(&OPENSSL_NO_KRB5)) {
	eval 'sub OPENSSL_NO_KRB5 () {1;}' unless defined(&OPENSSL_NO_KRB5);
    }
    unless(defined(&OPENSSL_NO_MD2)) {
	eval 'sub OPENSSL_NO_MD2 () {1;}' unless defined(&OPENSSL_NO_MD2);
    }
    unless(defined(&OPENSSL_NO_MDC2)) {
	eval 'sub OPENSSL_NO_MDC2 () {1;}' unless defined(&OPENSSL_NO_MDC2);
    }
    unless(defined(&OPENSSL_NO_RC5)) {
	eval 'sub OPENSSL_NO_RC5 () {1;}' unless defined(&OPENSSL_NO_RC5);
    }
    unless(defined(&OPENSSL_NO_RFC3779)) {
	eval 'sub OPENSSL_NO_RFC3779 () {1;}' unless defined(&OPENSSL_NO_RFC3779);
    }
    unless(defined(&OPENSSL_NO_SEED)) {
	eval 'sub OPENSSL_NO_SEED () {1;}' unless defined(&OPENSSL_NO_SEED);
    }
    unless(defined(&OPENSSL_NO_SSL2)) {
	eval 'sub OPENSSL_NO_SSL2 () {1;}' unless defined(&OPENSSL_NO_SSL2);
    }
    unless(defined(&OPENSSL_NO_STORE)) {
	eval 'sub OPENSSL_NO_STORE () {1;}' unless defined(&OPENSSL_NO_STORE);
    }
}
unless(defined(&OPENSSL_THREADS)) {
    eval 'sub OPENSSL_THREADS () {1;}' unless defined(&OPENSSL_THREADS);
}
unless(defined(&OPENSSL_NO_DYNAMIC_ENGINE)) {
    eval 'sub OPENSSL_NO_DYNAMIC_ENGINE () {1;}' unless defined(&OPENSSL_NO_DYNAMIC_ENGINE);
}
if(defined(&OPENSSL_ALGORITHM_DEFINES)) {
    if(defined(&OPENSSL_NO_CAMELLIA)  && !defined(&NO_CAMELLIA)) {
	eval 'sub NO_CAMELLIA () {1;}' unless defined(&NO_CAMELLIA);
    }
    if(defined(&OPENSSL_NO_CMS)  && !defined(&NO_CMS)) {
	eval 'sub NO_CMS () {1;}' unless defined(&NO_CMS);
    }
    if(defined(&OPENSSL_NO_GMP)  && !defined(&NO_GMP)) {
	eval 'sub NO_GMP () {1;}' unless defined(&NO_GMP);
    }
    if(defined(&OPENSSL_NO_GOST)  && !defined(&NO_GOST)) {
	eval 'sub NO_GOST () {1;}' unless defined(&NO_GOST);
    }
    if(defined(&OPENSSL_NO_JPAKE)  && !defined(&NO_JPAKE)) {
	eval 'sub NO_JPAKE () {1;}' unless defined(&NO_JPAKE);
    }
    if(defined(&OPENSSL_NO_KRB5)  && !defined(&NO_KRB5)) {
	eval 'sub NO_KRB5 () {1;}' unless defined(&NO_KRB5);
    }
    if(defined(&OPENSSL_NO_MD2)  && !defined(&NO_MD2)) {
	eval 'sub NO_MD2 () {1;}' unless defined(&NO_MD2);
    }
    if(defined(&OPENSSL_NO_MDC2)  && !defined(&NO_MDC2)) {
	eval 'sub NO_MDC2 () {1;}' unless defined(&NO_MDC2);
    }
    if(defined(&OPENSSL_NO_RC5)  && !defined(&NO_RC5)) {
	eval 'sub NO_RC5 () {1;}' unless defined(&NO_RC5);
    }
    if(defined(&OPENSSL_NO_RFC3779)  && !defined(&NO_RFC3779)) {
	eval 'sub NO_RFC3779 () {1;}' unless defined(&NO_RFC3779);
    }
    if(defined(&OPENSSL_NO_SEED)  && !defined(&NO_SEED)) {
	eval 'sub NO_SEED () {1;}' unless defined(&NO_SEED);
    }
    if(defined(&OPENSSL_NO_SSL2)  && !defined(&NO_SSL2)) {
	eval 'sub NO_SSL2 () {1;}' unless defined(&NO_SSL2);
    }
    if(defined(&OPENSSL_NO_STORE)  && !defined(&NO_STORE)) {
	eval 'sub NO_STORE () {1;}' unless defined(&NO_STORE);
    }
}
undef(&I386_ONLY) if defined(&I386_ONLY);
if(!(defined(&VMS) || defined(&__VMS)) ) {
    if(defined(&HEADER_CRYPTLIB_H)  && !defined(&OPENSSLDIR)) {
	eval 'sub ENGINESDIR () {"/usr/lib/engines";}' unless defined(&ENGINESDIR);
	eval 'sub OPENSSLDIR () {"/etc/ssl";}' unless defined(&OPENSSLDIR);
    }
}
undef(&OPENSSL_UNISTD) if defined(&OPENSSL_UNISTD);
unless(defined(&OPENSSL_UNISTD)) {
    sub OPENSSL_UNISTD () {	< ($unistd->{h})>;}
}
undef(&OPENSSL_EXPORT_VAR_AS_FUNCTION) if defined(&OPENSSL_EXPORT_VAR_AS_FUNCTION);
if(defined(&HEADER_IDEA_H)  && !defined(&IDEA_INT)) {
    eval 'sub IDEA_INT () {\'unsigned int\';}' unless defined(&IDEA_INT);
}
if(defined(&HEADER_MD2_H)  && !defined(&MD2_INT)) {
    eval 'sub MD2_INT () {\'unsigned int\';}' unless defined(&MD2_INT);
}
if(defined(&HEADER_RC2_H)  && !defined(&RC2_INT)) {
    eval 'sub RC2_INT () {\'unsigned int\';}' unless defined(&RC2_INT);
}
if(defined(&HEADER_RC4_H)) {
    if(!defined(&RC4_INT)) {
	eval 'sub RC4_INT () {\'unsigned int\';}' unless defined(&RC4_INT);
    }
    if(!defined(&RC4_CHUNK)) {
	undef(&RC4_CHUNK) if defined(&RC4_CHUNK);
    }
}
if((defined(&HEADER_NEW_DES_H) || defined(&HEADER_DES_H))  && !defined(&DES_LONG)) {
    unless(defined(&DES_LONG)) {
	eval 'sub DES_LONG () {\'unsigned int\';}' unless defined(&DES_LONG);
    }
}
if(defined(&HEADER_BN_H)  && !defined(&CONFIG_HEADER_BN_H)) {
    eval 'sub CONFIG_HEADER_BN_H () {1;}' unless defined(&CONFIG_HEADER_BN_H);
    eval 'sub BN_LLONG () {1;}' unless defined(&BN_LLONG);
    undef(&SIXTY_FOUR_BIT_LONG) if defined(&SIXTY_FOUR_BIT_LONG);
    undef(&SIXTY_FOUR_BIT) if defined(&SIXTY_FOUR_BIT);
    eval 'sub THIRTY_TWO_BIT () {1;}' unless defined(&THIRTY_TWO_BIT);
    undef(&SIXTEEN_BIT) if defined(&SIXTEEN_BIT);
    undef(&EIGHT_BIT) if defined(&EIGHT_BIT);
}
if(defined(&HEADER_RC4_LOCL_H)  && !defined(&CONFIG_HEADER_RC4_LOCL_H)) {
    eval 'sub CONFIG_HEADER_RC4_LOCL_H () {1;}' unless defined(&CONFIG_HEADER_RC4_LOCL_H);
    eval 'sub RC4_INDEX () {1;}' unless defined(&RC4_INDEX);
}
if(defined(&HEADER_BF_LOCL_H)  && !defined(&CONFIG_HEADER_BF_LOCL_H)) {
    eval 'sub CONFIG_HEADER_BF_LOCL_H () {1;}' unless defined(&CONFIG_HEADER_BF_LOCL_H);
    undef(&BF_PTR) if defined(&BF_PTR);
}
if(defined(&HEADER_DES_LOCL_H)  && !defined(&CONFIG_HEADER_DES_LOCL_H)) {
    eval 'sub CONFIG_HEADER_DES_LOCL_H () {1;}' unless defined(&CONFIG_HEADER_DES_LOCL_H);
    unless(defined(&DES_DEFAULT_OPTIONS)) {
	unless(defined(&DES_PTR)) {
	    undef(&DES_PTR) if defined(&DES_PTR);
	}
	unless(defined(&DES_RISC1)) {
	    undef(&DES_RISC1) if defined(&DES_RISC1);
	}
	unless(defined(&DES_RISC2)) {
	    undef(&DES_RISC2) if defined(&DES_RISC2);
	}
	if(defined(&DES_RISC1)  && defined(&DES_RISC2)) {
	}
	unless(defined(&DES_UNROLL)) {
	    eval 'sub DES_UNROLL () {1;}' unless defined(&DES_UNROLL);
	}
	if(!defined(&DES_PTR)  && !defined(&DES_RISC1)  && !defined(&DES_RISC2)  && !defined(&DES_UNROLL)) {
	    if(defined( (defined(&sun) ? &sun : undef) ) ) {
		eval 'sub DES_PTR () {1;}' unless defined(&DES_PTR);
		eval 'sub DES_RISC1 () {1;}' unless defined(&DES_RISC1);
		eval 'sub DES_UNROLL () {1;}' unless defined(&DES_UNROLL);
	    }
 elsif(defined( (defined(&__ultrix) ? &__ultrix : undef) ) ) {
		eval 'sub DES_PTR () {1;}' unless defined(&DES_PTR);
		eval 'sub DES_RISC2 () {1;}' unless defined(&DES_RISC2);
		eval 'sub DES_UNROLL () {1;}' unless defined(&DES_UNROLL);
	    }
 elsif(defined( (defined(&__osf1__) ? &__osf1__ : undef) ) ) {
		eval 'sub DES_PTR () {1;}' unless defined(&DES_PTR);
		eval 'sub DES_RISC2 () {1;}' unless defined(&DES_RISC2);
	    }
 elsif(defined ( (defined(&_AIX) ? &_AIX : undef) ) ) {
	    }
 elsif(defined( (defined(&__hpux) ? &__hpux : undef) ) ) {
	    }
 elsif(defined( (defined(&__aux) ? &__aux : undef) ) ) {
	    }
 elsif(defined( (defined(&__dgux) ? &__dgux : undef) ) ) {
		eval 'sub DES_UNROLL () {1;}' unless defined(&DES_UNROLL);
	    }
 elsif(defined( (defined(&__sgi) ? &__sgi : undef) ) ) {
		eval 'sub DES_PTR () {1;}' unless defined(&DES_PTR);
		eval 'sub DES_RISC2 () {1;}' unless defined(&DES_RISC2);
		eval 'sub DES_UNROLL () {1;}' unless defined(&DES_UNROLL);
	    }
 elsif(defined(&i386) || defined(&__i386__) ) {
		eval 'sub DES_PTR () {1;}' unless defined(&DES_PTR);
		eval 'sub DES_RISC1 () {1;}' unless defined(&DES_RISC1);
		eval 'sub DES_UNROLL () {1;}' unless defined(&DES_UNROLL);
	    }
	}
    }
}
1;
