Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Fixed some minor problems in the previous patch.
Browse files Browse the repository at this point in the history
Ignore-this: 6beae1b20cc4c22b2c6eec092b735853

darcs-hash:20090627050309-62b54-1fdd14b386f8a1509c7615962296b605798e170e.gz
  • Loading branch information
depressed-pho committed Jun 27, 2009
1 parent e91ca16 commit f40cdbc
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 60 deletions.
2 changes: 2 additions & 0 deletions 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>

5 changes: 5 additions & 0 deletions 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
30 changes: 12 additions & 18 deletions HsOpenSSL.cabal
Expand Up @@ -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>
Expand All @@ -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
Expand All @@ -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
Expand Down
37 changes: 0 additions & 37 deletions Makefile

This file was deleted.

16 changes: 16 additions & 0 deletions 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:
Expand All @@ -10,6 +25,7 @@ Changes from 0.6 to 0.6.1
# contextSetPrivateKey
# contextSetCertificate


Changes from 0.5.2 to 0.6
-------------------------
* INCOMPATIBLE CHANGES:
Expand Down
89 changes: 89 additions & 0 deletions 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
File renamed without changes.
7 changes: 2 additions & 5 deletions cbits/mutex.h
Expand Up @@ -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);
Expand Down

0 comments on commit f40cdbc

Please sign in to comment.