Skip to content

Commit 612ff09

Browse files
authored
Merge pull request #22 from scemama/master
Accept both Python2 and Python3
2 parents aa7b8bc + 51e088d commit 612ff09

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ZeroMQ header file
22

3-
CC=gcc -fPIC
3+
CC=gcc -fPIC
44
CFLAGS=-O3 -Wall -pedantic -g
55
PREFIX=/usr/local/
66

@@ -9,22 +9,22 @@ PREFIX=/usr/local/
99
default: libf77zmq.so libf77zmq.a f77_zmq.h
1010

1111
install: libf77zmq.so libf77zmq.a f77_zmq.h
12-
install -D -m 644 libf77zmq.a $(PREFIX)/lib/
13-
install -D -m 644 libf77zmq.so $(PREFIX)/lib/
14-
install -D -m 644 f77_zmq.h $(PREFIX)/include/
15-
install -D -m 644 f77_zmq_free.h $(PREFIX)/include/
12+
install -D -m 644 libf77zmq.a $(PREFIX)/lib/
13+
install -D -m 644 libf77zmq.so $(PREFIX)/lib/
14+
install -D -m 644 f77_zmq.h $(PREFIX)/include/
15+
install -D -m 644 f77_zmq_free.h $(PREFIX)/include/
1616

1717
libf77zmq.so: f77_zmq.o
1818
$(CC) -shared $^ -o $@
1919

20-
libf77zmq.a: f77_zmq.o
20+
libf77zmq.a: f77_zmq.o
2121
$(AR) cr $@ $^
2222

2323
f77_zmq.o: f77_zmq.c f77_zmq.h
2424
$(CC) $(CFLAGS) -c f77_zmq.c -o $@
2525

2626
f77_zmq.h: create_f77_zmq_h.py f77_zmq.c
27-
python3 create_f77_zmq_h.py
27+
python create_f77_zmq_h.py
2828

2929
clean:
3030
$(RM) -f -- f77_zmq.o f77_zmq.h

create_f77_zmq_h.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22
#
33
# f77_zmq : Fortran 77 bindings for the ZeroMQ library
44
# Copyright (C) 2014 Anthony Scemama
@@ -24,12 +24,16 @@
2424
# Universite Paul Sabatier - Bat. 3R1b4, 118 route de Narbonne
2525
# 31062 Toulouse Cedex 09, France
2626

27+
from __future__ import absolute_import
28+
from __future__ import division
29+
from __future__ import print_function
2730

2831
import re
2932
import os
3033
import sys
3134
import ctypes
3235

36+
3337
def create_lines(f):
3438
result = f.read()
3539
result = result.replace('\\\n', '')
@@ -121,7 +125,7 @@ def find_ZMQ_H():
121125
v = os.environ.get("C_INCLUDE_PATH")
122126
if v is None:
123127
v = "/usr/include:/usr/local/include"
124-
128+
125129
for d in v.split(':'):
126130
if d and "zmq.h" in os.listdir(d):
127131
return ("{0}/zmq.h".format(d))

0 commit comments

Comments
 (0)