Skip to content
Browse files

Fixed some minor problems in the previous patch.

Ignore-this: 6beae1b20cc4c22b2c6eec092b735853

darcs-hash:20090627050309-62b54-1fdd14b386f8a1509c7615962296b605798e170e.gz
  • Loading branch information...
1 parent e91ca16 commit f40cdbcf1c15b088c1600caf471f4ed7ada11f27 @phonohawk committed Jun 27, 2009
Showing with 126 additions and 60 deletions.
  1. +2 −0 AUTHORS
  2. +5 −0 GNUmakefile
  3. +12 −18 HsOpenSSL.cabal
  4. +0 −37 Makefile
  5. +16 −0 NEWS
  6. +89 −0 cabal-package.mk
  7. 0 cbits/{mutex-linux.c → mutex-pthread.c}
  8. +2 −5 cbits/mutex.h
View
2 AUTHORS
@@ -1,5 +1,7 @@
This is a list of contributors to the HsOpenSSL.
* Adam Langley <agl@imperialviolet.org>
+* John Van Enk <vanenkj@gmail.com> and his friend
* Taru Karttunen <taruti@taruti.net>
* PHO <pho@cielonegro.org>
+
View
5 GNUmakefile
@@ -0,0 +1,5 @@
+RUN_COMMAND = $(MAKE) -C examples run
+
+CONFIGURE_ARGS = --disable-optimization --extra-include-dirs=/usr/pkg/include --extra-lib-dirs=/usr/pkg/lib
+
+include cabal-package.mk
View
30 HsOpenSSL.cabal
@@ -5,7 +5,7 @@ Description:
can generate RSA and DSA keys, read and write PEM files,
generate message digests, sign and verify messages, encrypt
and decrypt messages.
-Version: 0.6.1
+Version: 0.6.2
License: PublicDomain
License-File: COPYING
Author: Adam Langley <agl at imperialviolet.org>, PHO <pho at cielonegro.org>
@@ -18,12 +18,9 @@ Cabal-Version: >= 1.6
Build-Type: Simple
Extra-Source-Files:
AUTHORS
- HsOpenSSL.buildinfo.in
NEWS
cbits/HsOpenSSL.h
cbits/mutex.h
- configure
- configure.ac
examples/Makefile
examples/GenRSAKey.hs
examples/HelloWorld.hs
@@ -38,22 +35,19 @@ Source-Repository head
Location: http://darcs.cielonegro.org/HsOpenSSL/
Library
- Build-Depends: base >= 4, bytestring, ghc-prim, integer, time >= 1.1.1, old-locale, network>=2.1.0.0
- --PkgConfig-Depends: openssl >= 0.9.7l
- -- We really should use this instead of the configure script but
- -- Cabal 1.6.0.1 can't handle this weird version scheme of OpenSSL.
+ Build-Depends: base >= 4 && < 5, bytestring, ghc-prim, integer, time >= 1.1.1, old-locale, network>=2.1.0.0
+
if os(mingw32)
Extra-Libraries: eay32
- c-sources: cbits/mutex-win.c
- cc-options: -D MINGW32
- cpp-options: -DCALLCONV=stdcall
-
- if os(linux)
- Extra-Libraries: ssl
- build-depends: unix >= 2.3.0.0
- c-sources: cbits/mutex-linux.c
- cc-options: -D LINUX
- cpp-options: -DCALLCONV=ccall
+ C-Sources: cbits/mutex-win.c
+ CC-Options: -D MINGW32
+ CPP-Options: -DCALLCONV=stdcall
+ else
+ Extra-Libraries: crypto ssl
+ build-depends: unix >= 2.3.0.0
+ C-Sources: cbits/mutex-pthread.c
+ CC-Options: -D PTHREAD
+ CPP-Options: -DCALLCONV=ccall
Exposed-Modules:
OpenSSL
View
37 Makefile
@@ -1,37 +0,0 @@
-CABAL_FILE = HsOpenSSL.cabal
-GHC = ghc
-
-build: dist/setup-config Setup
- ./Setup build
-
-run: build
- @echo ".:.:. Let's go .:.:."
- $(MAKE) -C examples run
-
-dist/setup-config: $(CABAL_FILE) configure Setup
- ./Setup configure -O
-
-configure: aclocal.m4 configure.ac
- autoconf
-
-aclocal.m4:
- aclocal
-
-Setup: Setup.hs
- $(GHC) --make Setup
-
-clean:
- rm -rf dist Setup Setup.o Setup.hi .setup-config *.buildinfo
- find . -name '*~' -exec rm -f {} \;
- $(MAKE) -C examples clean
-
-doc: dist/setup-config Setup
- ./Setup haddock
-
-install: build
- sudo ./Setup install
-
-sdist: Setup
- ./Setup sdist
-
-.PHONY: build run clean install doc sdist
View
16 NEWS
@@ -1,5 +1,20 @@
-*- Coding: utf-8 -*-
+Chanegs from 0.6.1 to 0.6.2
+---------------------------
+* Applied a patch by John Van Enk and his friend:
+
+ 1) Moved away from the Configure build type to the Simple build
+ type.
+
+ 2) Removed the direct dependency on pthreads. This involved an
+ indirection layer using the preprocessor. In linux/bsd, we use
+ pthreads. In windows, we call out to the OS mutexing
+ functions. This allows us to "cabal install" the HsOpenSSL
+ library from the cmd.exe terminal in windows *without* having to
+ use cygwin.
+
+
Changes from 0.6 to 0.6.1
-------------------------
* OpenSSL.Session:
@@ -10,6 +25,7 @@ Changes from 0.6 to 0.6.1
# contextSetPrivateKey
# contextSetCertificate
+
Changes from 0.5.2 to 0.6
-------------------------
* INCOMPATIBLE CHANGES:
View
89 cabal-package.mk
@@ -0,0 +1,89 @@
+# -*- makefile-gmake -*-
+#
+# Variables:
+#
+# CONFIGURE_ARGS :: arguments to be passed to ./Setup configure
+# default: --disable-optimization
+#
+# RUN_COMMAND :: command to be run for "make run"
+#
+
+GHC ?= ghc
+FIND ?= find
+RM_RF ?= rm -rf
+SUDO ?= sudo
+AUTOCONF ?= autoconf
+
+CONFIGURE_ARGS ?= --disable-optimization
+
+SETUP_FILE := $(wildcard Setup.*hs)
+CABAL_FILE := $(wildcard *.cabal)
+
+ifeq ($(shell ls configure.ac 2>/dev/null),configure.ac)
+ AUTOCONF_AC_FILE := configure.ac
+ AUTOCONF_FILE := configure
+else
+ ifeq ($(shell ls configure.in 2>/dev/null),configure.in)
+ AUTOCONF_AC_FILE := configure.in
+ AUTOCONF_FILE := configure
+ else
+ AUTOCONF_AC_FILE :=
+ AUTOCONF_FILE :=
+ endif
+endif
+
+BUILDINFO_IN_FILE := $(wildcard *.buildinfo.in)
+BUILDINFO_FILE := $(BUILDINFO_IN_FILE:.in=)
+
+all: build
+
+build: setup-config build-hook
+ ./Setup build
+
+build-hook:
+
+ifeq ($(RUN_COMMAND),)
+run:
+ @echo "cabal-package.mk: No command to run."
+ @echo "cabal-package.mk: If you want to run something, define RUN_COMMAND variable."
+else
+run: build
+ @echo ".:.:. Let's go .:.:."
+ $(RUN_COMMAND)
+endif
+
+setup-config: dist/setup-config setup-config-hook $(BUILDINFO_FILE)
+
+setup-config-hook:
+
+dist/setup-config: $(CABAL_FILE) Setup $(AUTOCONF_FILE)
+ ./Setup configure $(CONFIGURE_ARGS)
+
+$(AUTOCONF_FILE): $(AUTOCONF_AC_FILE)
+ $(AUTOCONF)
+
+$(BUILDINFO_FILE): $(BUILDINFO_IN_FILE) configure
+ ./Setup configure $(CONFIGURE_ARGS)
+
+Setup: $(SETUP_FILE)
+ $(GHC) --make Setup
+
+clean: clean-hook
+ $(RM_RF) dist Setup *.o *.hi .setup-config *.buildinfo
+ $(FIND) . -name '*~' -exec rm -f {} \;
+
+clean-hook:
+
+doc: setup-config
+ ./Setup haddock
+
+install: build
+ $(SUDO) ./Setup install
+
+sdist: setup-config
+ ./Setup sdist
+
+test: build
+ ./Setup test
+
+.PHONY: build build-hook setup-config setup-config-hook run clean clean-hook install doc sdist test
View
0 cbits/mutex-linux.c → cbits/mutex-pthread.c
File renamed without changes.
View
7 cbits/mutex.h
@@ -4,14 +4,11 @@
#if defined(MINGW32)
#include <windows.h>
typedef HANDLE mutex_t;
-#elif defined(LINUX)
- #include <pthread.h>
- typedef pthread_mutex_t mutex_t;
-#elif defined(BSD)
+#elif defined(PTHREAD)
#include <pthread.h>
typedef pthread_mutex_t mutex_t;
#else
- #error "ERROR: This platform not supported."
+ #error "ERROR: This platform is not supported."
#endif
void mutex_init(mutex_t* mutex);

0 comments on commit f40cdbc

Please sign in to comment.
Something went wrong with that request. Please try again.