Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default behaviour, for if core.autocrlf isn't set
* text=auto

configure text eol=lf
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Makefile.config

testdbm.byte
testdbm.opt

# general patterns

*.o
*.a
*.so
*.obj
*.lib
*.dll
*.cm[ioxat]
*.cmx[as]
*.cmti
*.annot
*.exe
*.sw[po]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# #
#########################################################################

include Makefile.config
-include Makefile.config

OCAMLC=ocamlc
OCAMLOPT=ocamlopt
Expand Down Expand Up @@ -66,7 +66,7 @@ install::
if test -f dbm.cmxs; then cp dbm.cmxs $(LIBDIR)/; fi

clean::
rm -f *.cm* *.$(O) *.$(A) *.$(SO)
rm -f *.cm* *.$(O) *.$(A) *.$(SO) Makefile.config

testdbm.byte: dbm.cma testdbm.ml
$(OCAMLC) -o $@ dbm.cma testdbm.ml
Expand Down
4 changes: 0 additions & 4 deletions Makefile.config

This file was deleted.

8 changes: 6 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ echo

stdlib=`ocamlc -where`

# This slightly strange looking command will prefer c_compiler for versions
# of OCaml which have it, but will fallback to bytecode_c_compiler otherwise
CC=${CC:-`ocamlc -config | tr -d '\r' | sed -ne 's/.*c_compiler: //p' | head -n 1`}

hasgot() {
rm -f hasgot.c
(echo "#include <$2>"
Expand All @@ -36,7 +40,7 @@ hasgot() {
fi
echo ' return 0;'
echo '}') > hasgot.c
${CC:-cc} -I$1 -o hasgot.exe hasgot.c $3 $4
$CC -I$1 -o hasgot.exe hasgot.c $3 $4 2>/dev/null
res=$?
rm -f hasgot.c hasgot.exe
return $res
Expand All @@ -46,7 +50,7 @@ dbm_include="not found"
dbm_link="not found"
dbm_defines=""

for dir in /usr/include /usr/include/db1 /usr/include/gdbm /usr/local/include; do
for dir in `$CC -xc -E -v /dev/null 2>&1 | sed -e '1,/#include <...>/d' -e '/End of search list./,$d'` /usr/include /usr/include/db1 /usr/include/gdbm /usr/local/include ; do
if test -f $dir/ndbm.h; then
dbm_include=$dir
dbm_defines="-DDBM_COMPAT"
Expand Down