Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000466OCamlCamlIDLpublic2001-07-31 22:212002-04-23 09:21
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000466: camlidl: bulding native code DLLs with camlidldll script
DescriptionHere is the patch for camlidldll script which allows bulding both byte code
and native DLLs. Native mode is activated with "-opt" option:

camlidldll -opt ....

-linkobjs option is also introduced for native mode, specifing non-caml
.obj files which we need to link. .obj files without this option are passed
to ocamlopt when creating output-obj file.

[---cut---]
Index: camlidldll.tpl
===================================================================
RCS file: /caml/bazar-ocaml/camlidl/tools/camlidldll.tpl,v
retrieving revision 1.4
diff -u -r1.4 camlidldll.tpl
--- camlidldll.tpl 2000/08/21 12:55:02 1.4
+++ camlidldll.tpl 2001/07/31 18:07:12
@@ -28,37 +28,51 @@
 resfile=''
 tlbcounter=0
 
+camlobjs_mask="*.cm[oa]"
+linkobjs_mask="*.lib|*.obj"
+ocamlc="ocamlc -custom"
+com_lib="com.cma"
+camlruntime_lib="libcamlrun.lib"
+
 rm -f $resourcefile
 
 # Parse the command line
 
 while : ; do
- case "$1" in
- "") break;;
+ eval "case \"$1\" in
+ \"\") break;;
 # my options
+ -opt)
+ camlobjs_mask=\"*.obj|*.cmx|*.cmxa\"
+ linkobjs_mask=\"*.lib\"
+ ocamlc=\"ocamlopt\"
+ com_lib=\"com.cmxa\"
+ camlruntime_lib=\"libasmrun.lib\";;
     -o) output=$2; shift;;
     -linkopt)
- linkopts="$linkopts $2"; shift;;
+ linkopts=\"$linkopts $2\"; shift;;
+ -linkobjs)
+ linkobjs=\"$linkobjs $2\"; shift;;
 # ocamlc options
     -cc|-ccopt|-I|-w)
- camlopts="$camlopts $1 $2"; shift;;
+ camlopts=\"$camlopts $1 $2\"; shift;;
     -cclib) lib=`echo $2 | sed -e 's/^-l\(.*\)$/lib\1.lib/'`
- linkobjs="$linkobjs $lib"
+ linkobjs=\"$linkobjs $lib\"
         shift;;
     -linkall|-verbose)
- camlopts="$camlopts $1";;
+ camlopts=\"$camlopts $1\";;
 # other options
- -*) echo "Unknown option \"$1\", ignored" 1>&2;;
+ -*) echo \"Unknown option \\\"$1\\\", ignored\" 1>&2;;
 # files
- *.cm[oa])
- camlobjs="$camlobjs $1";;
- *.obj|*.lib)
- linkobjs="$linkobjs $1";;
+ $camlobjs_mask)
+ camlobjs=\"$camlobjs $1\";;
+ $linkobjs_mask)
+ linkobjs=\"$linkobjs $1\";;
     *.tlb)
         tlbcounter=`expr $tlbcounter + 1`
- echo "$tlbcounter typelib $1" >> $resourcefile;;
- *) echo "Don't know what to do with \"$1\", ignored" 1>&2;;
- esac
+ echo \"$tlbcounter typelib $1\" >> $resourcefile;;
+ *) echo \"Don't know what to do with \\\"$1\\\", ignored\" 1>&2;;
+ esac"
   shift
 done
 
@@ -69,7 +83,7 @@
   rm -f $resourcefile
 fi
 
-ocamlc -custom -output-obj -o $camlobjfile $camlopts com.cma $camlobjs && \
+$ocamlc -output-obj -o $camlobjfile $camlopts $com_lib $camlobjs && \
 link /nologo /incremental:no /dll /machine:ix86 \
   /out:${output} /libpath:$camllib \
   /export:DllGetClassObject,@2,PRIVATE \
@@ -79,7 +93,7 @@
   $resfile \
   $linkopts $camlobjfile $linkobjs \
   ${camllib}\\cfactory.obj libcamlidl.lib \
- libcamlrun.lib advapi32.lib ole32.lib oleaut32.lib
+ $camlruntime_lib advapi32.lib ole32.lib oleaut32.lib
 exitcode=$?
 rm -f $resfile $camlobjfile
 exit $exitcode
[---cut---]

Hope to hear from you soon,
Dmitry


TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000068)
administrator (administrator)
2002-04-23 09:21

Support for native compilation added 2002-04-22 by XL

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker