From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA12170; Mon, 10 May 2004 19:27:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA12121 for ; Mon, 10 May 2004 19:27:11 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from imsmq10.netvigator.com (n219076066007.netvigator.com [219.76.66.7]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4AHR8EV009604 for ; Mon, 10 May 2004 19:27:09 +0200 Received: from lophty.com (n219077018156.netvigator.com [219.77.18.156]) by imsmq10.netvigator.com (8.12.10/8.12.10) with ESMTP id i4AHR5BH027604; Tue, 11 May 2004 01:27:06 +0800 Message-ID: <409FBB69.3090107@lophty.com> Date: Tue, 11 May 2004 01:27:05 +0800 From: brian donovan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: ekot@narod.ru, caml-list@inria.fr Subject: Solved ! ... Re: [Caml-list] Building findlib/OCamlfind on Win32 system References: <409F1A40.8080407@lophty.com> <409F65EE.6000002@narod.ru> <409F825B.4050006@lophty.com> <409FA788.2000106@narod.ru> In-Reply-To: <409FA788.2000106@narod.ru> Content-Type: multipart/mixed; boundary="------------080802050704060500090003" X-Miltered: at nez-perce with ID 409FBB6C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 findlib:01 ocamlfind:01 ocamllib:01 ocamllib:01 findlib:01 afaict:01 ocamlfind:01 patched:01 gerd:01 stolpmann:01 gerd:01 mingw:01 installer:01 cygwin:01 X-Attachments: name="configure" name="configure" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is a multi-part message in MIME format. --------------080802050704060500090003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thank you ! I apologize - I had stupidly forgotten to start a new console window after changing the value of $OCAMLLIB (through Start>Settings>Control Panel> System>Advanced : Environment Variables; System Variables), so it was still using the path with the wrong-direction slashes. Following your advice (my OCaml install is in C:\ocaml3.0.7 and echoing $OCAMLLIB at a bash prompt now gives me C:/ocaml3.0.7/lib), findlib 1.0.7 works (afaict) perfectly - ocamlfind list gives output, ocamlfind query does as well, etc. Although it's now clear that your patch + advice worked, I'm including the patched configure script (attached) and my $PATH var value (below) just in case you can use the data. May I suggest that you share your patch and instructions with Gerd Stolpmann of (email )? I think he'd be grateful, as would any other poor souls who want to get findlib working on Win32*. * The MinGW installer, by default (at least on my system), tries to place OCaml under the Program Files hierarchy and uses \'s in the value for $OCAMLLIB. Because many, but not all, other Win32 ports of Unix tools advise users to avoid spaces in file paths, I went ahead and placed OCaml at a location with a space-free path, but I wouldn't have otherwise known to change the slashes in $OCAMLLIB's value. $PATH : C:\cygwin\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;c:\matlab6p5\bin\win32;C:\Program Files\cvsnt;C:\ocaml3.0.7\bin Thanks again Eugene Kotlyarov wrote: > brian donovan wrote: > >> Thanks for your help. The patch that you attached to your email >> works on the configure script for findlib 1.0.4 (current version), >> but not on the configure script for findlib 0.8.1 - is it intended as >> a patch for 1.0.4? If, so that's great. :) In your advice, I have #1 > > Yes this patch is only for 1.0.4 > >> and #2 covered, the patch, as I said, is applied to v1.0.4's >> configure script with no problems, but I hit a snag when I try to >> configure. ./configure and ./configure -mspath both generate an >> endless scroll of "dirname : too few arguments" error messages that >> only stops when I quit the console window. > > This is very strange. > Can you send me resulting configure script and output of the > echo $PATH > command > > Also one thing you may try is to find following functions in configure > script and change comments like shown below. This also requires you to > have 'which' command, there is package with such name in cygwin > > in_path () { > # # Does $1 exist in $PATH? > # IFS=":" > # for d in $PATH; do > # if test -x "$d/$1"; then > # IFS="$oldifs" > # return 0 > # fi > # done > # IFS="$oldifs" > # return 1 > #--- The following is not portable enough: > if test -x `type -p ls`; then > # type -p works! > type -p $1 >/dev/null > else > # use 'which' instead > p=`which $1` > test -x "$p" > fi > } > > get_path () { > # IFS=":" > # for d in $PATH; do > # if test -x "$d/$1"; then > # IFS="$oldifs" > # echo "$d/$1" > # return > # fi > # done > # IFS="$oldifs" > #--- The following is not portable enough: > if test -x `type -p ls`; then > # type -p works! > type -p $1 > else > # use 'which' instead > p=`which $1` > test -x "$p" && echo $p > fi > } > > > --------------080802050704060500090003 Content-Type: text/plain; name="configure" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="configure" #! /bin/sh # $Id: configure 70 2004-04-04 10:48:18Z gerd $ # ---------------------------------------------------------------------- # # Some functions #set -x version="1.0.4" # Remember the old IFS value: oldifs="$IFS" in_path () { # Does $1 exist in $PATH? IFS=":" for d in $PATH; do if test -x "$d/$1"; then IFS="$oldifs" return 0 fi done IFS="$oldifs" return 1 #--- The following is not portable enough: # if test -x `type -p ls`; then # # type -p works! # type -p $1 >/dev/null # else # # use 'which' instead # p=`which $1` # test -x "$p" # fi } get_path () { IFS=":" for d in $PATH; do if test -x "$d/$1"; then IFS="$oldifs" echo "$d/$1" return fi done IFS="$oldifs" #--- The following is not portable enough: # if test -x `type -p ls`; then # # type -p works! # type -p $1 # else # # use 'which' instead # p=`which $1` # test -x "$p" && echo $p # fi } get_stdlib () { # Older versions of ocamlc do not accept -where, so there is a fallback # method: ocamlc -where 2>/dev/null || { ocamlc -v | sed -n -e "/Standard library directory/s/.*: \(.*\)/\1/p"; } } get_lib () { # $1: name of a library to search for # $2...: places to test libname="$1" while [ "$#" != "0" ]; do if [ -f "$1/lib${libname}.so" -o -f "$1/lib${libname}.a" ]; then echo "$1" return 0 fi shift done return 1 } get_lib_file () { # $1: name of library without "lib" and suffix # $2: directory # returns full path of library if [ -f "$2/lib$1.so" ]; then echo "$2/lib$1.so" elif [ -f "$2/lib$1.a" ]; then echo "$2/lib$1.a" else echo "" fi } apply_cygpath () { v=$1 eval "p=\"\$$v\"" p="`cygpath -w -s \"$p\"`" p="`cygpath -u \"$p\"`" eval "$v=\"$p\"" } apply_mspath () { v=$1 eval "p=\"\$$v\"" p="`cygpath -m -l \"$p\"`" eval "$v=\"$p\"" } ###################################################################### # Here the main program begins: ###################################################################### # Interpret the command line ocamlfind_bin="" ocamlfind_man="" ocaml_sitelib="" ocamlfind_config="" use_cygpath=0 use_mspath=0 with_toolbox=0 with_topfind=1 while [ "$#" != "0" ]; do case "$1" in -bindir) ocamlfind_bin=$2 shift 2 ;; -mandir) ocamlfind_man=$2 shift 2 ;; -sitelib) ocaml_sitelib=$2 shift 2 ;; -config) ocamlfind_config=$2 shift 2 ;; -cygpath) use_cygpath=1 shift ;; -mspath) use_mspath=1 shift ;; -with-toolbox) with_toolbox=1 shift ;; -no-topfind) with_topfind=0 shift ;; -version) echo "$version" exit 0 ;; -h|-help|--help) echo "usage: configure [options]" 1>&2 echo " -bindir path where binaries are installed" 1>&2 echo " -mandir path where manual pages are installed" 1>&2 echo " -sitelib path set the location of the site-specific packages" 1>&2 echo " -config path set the location of the configuration file" 1>&2 echo " -cygpath fix paths for cygwin environment" 1>&2 echo " -mspath fix paths for MSVC environment" 1>&2 echo " -with-toolbox also build the toolbox" 1>&2 echo " -no-topfind don't install topfind script into stdlib directory" 1>&2 exit ;; *) echo "configure: run 'configure -h' to get help" 1>&2 exit 1 ;; esac done echo "Welcome to findlib version $version" echo "Configuring core..." ####################################################################### # inspect the system # Some standard Unix tools must be available: for tool in sed awk ocamlc uname rm make cat m4 dirname basename; do if in_path $tool; then true; else echo "configure: $tool not in PATH; this is required" 1>&2 exit 1 fi done # Find out standard library location ocaml_core_stdlib=`get_stdlib` if [ ! -d "$ocaml_core_stdlib" ]; then echo "configure: cannot determine ocaml's standard library directory" 1>&2 exit 1 fi if [ ${use_cygpath} -gt 0 ]; then echo "Applying cygpath..." apply_cygpath ocaml_core_stdlib fi # Set site-lib directory: if [ -z "$ocaml_sitelib" ]; then case "$ocaml_core_stdlib" in /opt/*) ocaml_sitelib=`dirname ${ocaml_core_stdlib}`/site-lib ;; *) ocaml_sitelib="${ocaml_core_stdlib}/site-lib" ;; esac fi # Find out the directory where ocamlc is: ocamlc=`get_path ocamlc` ocaml_core_bin=`dirname ${ocamlc}` # Set the directory of ocamlfind: test -n "$ocamlfind_bin" || ocamlfind_bin="$ocaml_core_bin" # Find the directory for the manual: # Fallback: ocaml_core_man=/usr/local/man d="$ocaml_core_bin" while [ "$d" != '/' ]; do f=0 if [ -d "$d/man/man1" ]; then if [ -f "$d/man/man1/ocamlc.1" -o \ -f "$d/man/man1/ocamlc.1.gz" -o \ -f "$d/man/man1/ocamlc.1.Z" ]; then f=1 fi else if [ -d "$d/man/mann" ]; then if [ -f "$d/man/mann/ocamlc.n" -o \ -f "$d/man/mann/ocamlc.n.gz" -o \ -f "$d/man/mann/ocamlc.n.Z" ]; then f=1 fi fi fi if [ "$f" = "1" ]; then ocaml_core_man="$d/man" d="/" else d=`dirname $d` fi done # Set the directory for ocamlfind's manuals: test -n "$ocamlfind_man" || ocamlfind_man="$ocaml_core_man" # Guess the right directory for the configuration file: if [ -z "${ocamlfind_config}" ]; then d="$ocaml_core_bin" case "$d" in */bin) ocamlfind_config=`dirname $d`/etc/findlib.conf ;; *) ocamlfind_config=/usr/local/etc/findlib.conf # Fallback value ;; esac fi ###################################################################### # Test the threading model echo "Testing threading model..." if ocamlc -vmthread >/dev/null 2>/dev/null; then : else echo "The -vmthread switch is not supported: Your ocaml version is too old!" exit 1 fi rm -f itest-aux/simple ocamlc -custom -thread -o itest-aux/simple unix.cma threads.cma itest-aux/simple_threads.ml \ >itest-aux/err.out 2>&1 output=`cat itest-aux/err.out` if [ -z "$output" ]; then ocaml_threads="posix" else ocaml_threads="vm" fi ###################################################################### # Does this version of OCaml support autolinking? # Works for O'Caml >= 3.00 on. Because findlib can only be compiled # with these O'Caml versions, we can safely assume that autolinking # is enabled. ocaml_autolink="true" ###################################################################### # Configure libraries echo "Configuring libraries..." # Check whether Bigarray is present. lbigarray=bigarray # always # Check whether labltk is present. if [ -f "${ocaml_core_stdlib}/labltk/labltk.cma" ]; then llabltk=labltk echo "labltk: found" else llabltk='' echo "labltk: not present" if [ $with_toolbox -gt 0 ]; then echo "Sorry, toolbox requires labltk - omitting toolbox." fi with_toolbox=0 fi # Check on camlp4: if in_path camlp4; then lcamlp4=camlp4 camlp4_dir=`camlp4 -where` camlp4_version=`camlp4 -v 2>&1` echo "camlp4: found" else lcamlp4='' echo "camlp4: not present" fi # Generate the META files now. l="dbm dynlink graphics num num-top str threads unix stdlib bigarray $llabltk $lcamlp4" for dir in site-lib-src/*; do # We do not really know if $dir is a directory. rm -f $dir/META done for lib in $l; do if="" if [ -f site-lib-src/$lib/interfaces.out ]; then if=`cat site-lib-src/$lib/interfaces.out` fi m4 -Dos=$os \ "-Dtype_of_threads=${ocaml_threads}" \ "-Dcamlp4_dir=${camlp4_dir}" \ "-Dcamlp4_version=${camlp4_version}" \ "-Dinterfaces=${if}" \ "-Dfindlib_version=${version}" \ site-lib-src/$lib/META.in >site-lib-src/$lib/META echo "Configuration for $lib written to site-lib-src/$lib/META" done for part in `cd src; echo *`; do if [ -f "src/$part/META.in" ]; then sed -e "s/@VERSION@/$version/g" src/$part/META.in >src/$part/META fi done # Finally a check for Cygwin: exec_suffix= case `uname` in CYGWIN*) exec_suffix=.exe echo "Cygwin found; using .exe as suffix for binaries" ;; *) true ;; esac ###################################################################### # Write Makefile.config parts="findlib" if [ $with_toolbox -gt 0 ]; then parts="$parts findlib-toolbox" fi if [ ${use_mspath} -gt 0 ]; then echo "Applying mspath..." apply_mspath ocaml_core_bin apply_mspath ocamlfind_bin apply_mspath ocamlfind_config fi echo "# Makefile.config written by configure" >Makefile.config echo "OCAML_CORE_STDLIB=${ocaml_core_stdlib}" >>Makefile.config echo "OCAML_CORE_BIN=${ocaml_core_bin}" >>Makefile.config echo "OCAML_CORE_MAN=${ocaml_core_man}" >>Makefile.config echo "OCAML_SITELIB=${ocaml_sitelib}" >>Makefile.config echo "OCAML_THREADS=${ocaml_threads}" >>Makefile.config echo "OCAMLFIND_BIN=${ocamlfind_bin}" >>Makefile.config echo "OCAMLFIND_MAN=${ocamlfind_man}" >>Makefile.config echo "OCAMLFIND_CONF=${ocamlfind_config}" >>Makefile.config echo "OCAML_AUTOLINK=${ocaml_autolink}" >>Makefile.config echo "EXEC_SUFFIX=${exec_suffix}" >>Makefile.config echo "PARTS=${parts}" >>Makefile.config echo "INSTALL_TOPFIND=${with_topfind}" >>Makefile.config # All OK echo echo "About the OCAML core installation:" echo " Standard library: ${ocaml_core_stdlib}" echo " Binaries: ${ocaml_core_bin}" echo " Manual pages: ${ocaml_core_man}" echo " Multi-threading type: ${ocaml_threads}" echo "The directory of site-specific packages will be" echo " site-lib: ${ocaml_sitelib}" echo "The configuration file is written to:" echo " findlib config file: ${ocamlfind_config}" echo "Software will be installed:" echo " Libraries: in /findlib" echo " Binaries: ${ocamlfind_bin}" echo " Manual pages: ${ocamlfind_man}" if [ $with_topfind -gt 0 ]; then echo " topfind script: ${ocaml_core_stdlib}" else echo " topfind script: omitted" fi if [ $with_toolbox -gt 0 ]; then echo "Toolbox: yes" else echo "Toolbox: no" fi echo echo "Configuration has been written to Makefile.config" echo echo "You can now do 'make all', and optionally 'make opt', to build ocamlfind." --------------080802050704060500090003-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners