dnl Process this file with autoconf to produce a configure script.
AC_INIT(eel.C)

dnl ***********************************
dnl BFD path subsitutions.
dnl Change these paths for your system.
dnl ***********************************

dnl Path to directory containing BFD files.
AC_SUBST(bfd_path) dnl
bfd_path=/p/larus/Software/Other/binutils/bfd

dnl Path to binutils include directory.
AC_SUBST(bfd_include) dnl
bfd_include=/p/larus/Software/Other/binutils/include

dnl Path of application program being compiled with EEL.
AC_SUBST(application_path) dnl
application_path=QPT2

dnl ***********************************
dnl End of BFD path subsitutions.
dnl ***********************************



dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_AWK


dnl Determine system type.
AC_CANONICAL_HOST
case "$host" in
  sparc-sun-solaris2*)	machine=sparc executable=elf
			rm -f libbfd.a
			ln -s ${bfd_path}/elf_sparc_libbfd.a libbfd.a ;;

  sparc-sun-sunos4*)	machine=sparc executable=aout
			rm -f libbfd.a
			ln -s ${bfd_path}/aout_sparc_libbfd.a libbfd.a ;;
esac


dnl Create files.
AC_LINK_FILES(
	Tools/Machine_Specific/extract_asm-${machine}
	Tools/Machine_Specific/label2offset-${machine}
	Tools/Machine_Specific/tag2label-${machine}
	System_Specific/${machine}_api_abi.C
	System_Specific/${machine}_api_abi.H
	System_Specific/${machine}_architecture.C
	System_Specific/${machine}_architecture.H
	System_Specific/${executable}_executable.C
	System_Specific/${executable}_executable.H
	System_Specific/Assembler/Machine_Specific/eel_asm_${machine}.s
	QPT2/Machine_Specific/${machine}_instrumentation.C
	QPT2/Machine_Specific/Assembler/Machine_Specific/qpt_asm_${machine}.s,

	Tools/extract_asm
	Tools/label2offset
	Tools/tag2label
	system_api_abi.C
	system_api_abi.H
	system_architecture.C
	system_architecture.H
	system_executable.C
	system_executable.H
	System_Specific/Assembler/eel_asm.s
	QPT2/instrumentation.C
	QPT2/Machine_Specific/Assembler/qpt_asm.s)


AC_OUTPUT(Makefile QPT2/Makefile QPT2/Machine_Specific/Assembler/Makefile  System_Specific/Assembler/Makefile Test_Jigs/Makefile)
