--- demexp--dev--0.7/configure 2006-02-05 14:27:31.000000000 +0100 +++ demexp--dev--0.7.new/configure 2006-09-26 00:14:23.000000000 +0200 @@ -408,28 +408,26 @@ # find independent config_file echo -n "Looking for config_file library... " -ocamlstdlib=`ocamlc -v|sed -re '2!{d};2{s/^.*: (.*)/\1/}'` -ocamllocallib=`echo $ocamlstdlib|sed 's|/usr/lib|/usr/local/lib|'` -if test -f "$ocamlstdlib/config_file/config_file.cmx"; then - echo "$ocamlstdlib/config_file/config_file.cmx"; - external_include="$external_include -I $ocamlstdlib/config_file"; - external_cmxa="$external_cmxa config_file.cmx"; +configfileinc=`ocamlfind query -i-format -recursive -separator ' ' cameleon.config_file` +configfilecmxa=cameleon.config_file +if test -n "$configfileinc"; then + echo "$configfileinc"; + external_include="$external_include $configfileinc"; + external_package="$external_package $configfilecmxa"; else - if test -f "$ocamllocallib/config_file/config_file.cmx"; then - echo "$ocamllocallib/config_file/config_file.cmx"; - external_include="$external_include -I $ocamllocallib/config_file"; - external_cmxa="$external_cmxa config_file.cmx"; - else - echo "not found, not in $ocamlstdlib/config_file/" - echo " neither in $ocamllocallib/config_file/"; - echo "*** This tool is required to build demexp"; - echo "*** Please install the package or compile following instructions found"; - echo "*** in README. Source archive available at:"; - echo "*** http://download.gna.org/cameleon/"; - exit 2; - fi + echo "*** This tool is required to build demexp"; + echo "*** Please install the package or compile following instructions found"; + echo "*** in README. Source archive available at:"; + echo "*** http://download.gna.org/cameleon/"; + exit 2; fi +# find needed .cmxa for ocamlfind package name + +external_cmxa=`ocamlfind query -predicates native -a-format -recursive -separator ' ' $external_package` +# remove spurious '+' +external_cmxa=`echo $external_cmxa | sed -e "s|+||g"` + # remove -I /usr/lib/ocaml/VERSION otherwise ocamldep will introduce # unneeded dependencies on standard modules (e.g. thread.cmi) standard_include=`ocamlfind query -i-format stdlib`