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

Modern build #8

Open
wants to merge 9 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: 0 additions & 4 deletions Makefile.config

This file was deleted.

File renamed without changes.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,29 @@ See the file `dbm.mli` for documentation of the programming inteface.

This library used to be included in the standard OCaml distribution. This is the standalone distribution of this library, with the same functionalities.


## REQUIREMENTS

* OCaml
* Either the GDBM library or any NDBM-compatible library. Make sure to install the development files as well. For Debian or Ubuntu, install the package `libgdbm-dev`.


## INSTALLATION

* Run the "configure" script by typing
./configure

* Build the library:
make all
jbuilder build @install

* Test the library:
make test
jbuilder build testdbm.exe
./_build/default/testdbm.exe

* Install the library:
sudo make install
jbuilder install

* Uninstall the library:
jbuilder build @install # if not done previously
jbuilder uninstall

## USAGE

Expand All @@ -38,10 +40,6 @@ In bytecode:
In native code:
ocamlopt dbm.cmxa <other bytecode files>


## LICENSE

This Library is distributed under the terms of the GNU Library General Public License version 2, with a special exception allowing unconstrained static linking. See file LICENSE for details.



24 changes: 23 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,29 @@ echo
echo "Configuration successful"
echo

# jbuilder config file generation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this approach is the worst of all worlds however :-) Generating jbuild files at configuration time means that build composition doesn't work, and incremental builds also suffer. Using the configurator library gets around that by making the flag probing part of the build itself.

cat <<EOF > jbuild
(jbuild_version 1)

(library
((name dbm)
(public_name dbm)
(modules (dbm))
(c_names (cldbm))
(c_flags ($dbm_defines -I$dbm_include))
(c_library_flags ($dbm_link))))

(executables
((names (testdbm))
(modules (testdbm))
(libraries (dbm))))

(alias
((name runtest)
(deps (testdbm.exe))
(action (run \${<}))))
EOF

if test "$dbm_include" = "/usr/include"; then
dbm_include=""
else
Expand All @@ -102,4 +125,3 @@ echo "OCAML_STDLIB=$stdlib" > Makefile.config
echo "DBM_INCLUDES=$dbm_include" >> Makefile.config
echo "DBM_LINK=$dbm_link" >> Makefile.config
echo "DBM_DEFINES=$dbm_defines" >> Makefile.config

26 changes: 26 additions & 0 deletions dbm.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
opam-version: "1.2"
maintainer: "https://github.com/ocaml/opam-repository/issues"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Xavier should be marked as maintainer I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure he wants to be bothered

authors: "Francois Rouaix et. al."
license: "LGPL-v2 with OCaml linking exception"
homepage: "https://github.com/ocaml/dbm"
bug-reports: "https://github.com/ocaml/dbm/issues"
dev-repo: "https://github.com/ocaml/dbm.git"
build: [
["./configure"]
["jbuilder" "build" "-p" name "-j" jobs]
]
build-test: [
["jbuilder" "runtest" "-p" name "-j" jobs]
]
depends: ["jbuilder" {build}]
depexts: [
[["debian"] ["libgdbm-dev"]]
[["ubuntu"] ["libgdbm-dev"]]
[["nixos"] ["gdbm"]]
[["centos"] ["gdbm-devel"]]
[["rhel"] ["gdbm-devel"]]
[["fedora"] ["gdbm-devel"]]
[["alpine"] ["gdbm-dev"]]
[["homebrew"] ["gdbm"]]
[["archlinux"] ["gdbm"]]
]