Skip to content

Commit 8ec7fa0

Browse files
author
Cristy
committed
https://github.com/ImageMagick/PythonMagick/issues/7
#6
1 parent 6c4df28 commit 8ec7fa0

File tree

5 files changed

+1081
-462
lines changed

5 files changed

+1081
-462
lines changed

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ nodist_EXTRA__PythonMagick_la_SOURCES = dummy.cpp
2727
_PythonMagick_la_LDFLAGS = -avoid-version -module $(BOOST_LDFLAGS)
2828

2929
# And the libraries to include
30-
_PythonMagick_la_LIBADD = pythonmagick_src/libpymagick.la helpers_src/libhelper.la $(BOOST_LDFLAGS) -lboost_python $(MAGICKPP_LIBS) $(MAGICK_LIBS)
30+
_PythonMagick_la_LIBADD = pythonmagick_src/libpymagick.la helpers_src/libhelper.la $(BOOST_LDFLAGS) -l$(BOOST_PYTHON_LIB) $(MAGICKPP_LIBS) $(MAGICK_LIBS)
3131

3232
EXTRA_DIST = autogen.pl SConstruct pyste_src LICENSE
3333

Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ nodist_EXTRA__PythonMagick_la_SOURCES = dummy.cpp
457457
_PythonMagick_la_LDFLAGS = -avoid-version -module $(BOOST_LDFLAGS)
458458

459459
# And the libraries to include
460-
_PythonMagick_la_LIBADD = pythonmagick_src/libpymagick.la helpers_src/libhelper.la $(BOOST_LDFLAGS) -lboost_python $(MAGICKPP_LIBS) $(MAGICK_LIBS)
460+
_PythonMagick_la_LIBADD = pythonmagick_src/libpymagick.la helpers_src/libhelper.la $(BOOST_LDFLAGS) -l$(BOOST_PYTHON_LIB) $(MAGICKPP_LIBS) $(MAGICK_LIBS)
461461
EXTRA_DIST = autogen.pl SConstruct pyste_src LICENSE
462462

463463
# Automatically reconfigure libtool

aclocal.m4

+178
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,184 @@ You have another version of autoconf. It may work, but is not guaranteed to.
2020
If you have problems, you may need to regenerate the build system entirely.
2121
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2222

23+
# ===========================================================================
24+
# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
25+
# ===========================================================================
26+
#
27+
# SYNOPSIS
28+
#
29+
# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
30+
#
31+
# DESCRIPTION
32+
#
33+
# This macro compares two version strings. Due to the various number of
34+
# minor-version numbers that can exist, and the fact that string
35+
# comparisons are not compatible with numeric comparisons, this is not
36+
# necessarily trivial to do in a autoconf script. This macro makes doing
37+
# these comparisons easy.
38+
#
39+
# The six basic comparisons are available, as well as checking equality
40+
# limited to a certain number of minor-version levels.
41+
#
42+
# The operator OP determines what type of comparison to do, and can be one
43+
# of:
44+
#
45+
# eq - equal (test A == B)
46+
# ne - not equal (test A != B)
47+
# le - less than or equal (test A <= B)
48+
# ge - greater than or equal (test A >= B)
49+
# lt - less than (test A < B)
50+
# gt - greater than (test A > B)
51+
#
52+
# Additionally, the eq and ne operator can have a number after it to limit
53+
# the test to that number of minor versions.
54+
#
55+
# eq0 - equal up to the length of the shorter version
56+
# ne0 - not equal up to the length of the shorter version
57+
# eqN - equal up to N sub-version levels
58+
# neN - not equal up to N sub-version levels
59+
#
60+
# When the condition is true, shell commands ACTION-IF-TRUE are run,
61+
# otherwise shell commands ACTION-IF-FALSE are run. The environment
62+
# variable 'ax_compare_version' is always set to either 'true' or 'false'
63+
# as well.
64+
#
65+
# Examples:
66+
#
67+
# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
68+
# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
69+
#
70+
# would both be true.
71+
#
72+
# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
73+
# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
74+
#
75+
# would both be false.
76+
#
77+
# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
78+
#
79+
# would be true because it is only comparing two minor versions.
80+
#
81+
# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
82+
#
83+
# would be true because it is only comparing the lesser number of minor
84+
# versions of the two values.
85+
#
86+
# Note: The characters that separate the version numbers do not matter. An
87+
# empty string is the same as version 0. OP is evaluated by autoconf, not
88+
# configure, so must be a string, not a variable.
89+
#
90+
# The author would like to acknowledge Guido Draheim whose advice about
91+
# the m4_case and m4_ifvaln functions make this macro only include the
92+
# portions necessary to perform the specific comparison specified by the
93+
# OP argument in the final configure script.
94+
#
95+
# LICENSE
96+
#
97+
# Copyright (c) 2008 Tim Toolan <[email protected]>
98+
#
99+
# Copying and distribution of this file, with or without modification, are
100+
# permitted in any medium without royalty provided the copyright notice
101+
# and this notice are preserved. This file is offered as-is, without any
102+
# warranty.
103+
104+
#serial 11
105+
106+
dnl #########################################################################
107+
AC_DEFUN([AX_COMPARE_VERSION], [
108+
AC_REQUIRE([AC_PROG_AWK])
109+
110+
# Used to indicate true or false condition
111+
ax_compare_version=false
112+
113+
# Convert the two version strings to be compared into a format that
114+
# allows a simple string comparison. The end result is that a version
115+
# string of the form 1.12.5-r617 will be converted to the form
116+
# 0001001200050617. In other words, each number is zero padded to four
117+
# digits, and non digits are removed.
118+
AS_VAR_PUSHDEF([A],[ax_compare_version_A])
119+
A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
120+
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
121+
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
122+
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
123+
-e 's/[[^0-9]]//g'`
124+
125+
AS_VAR_PUSHDEF([B],[ax_compare_version_B])
126+
B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
127+
-e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
128+
-e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
129+
-e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
130+
-e 's/[[^0-9]]//g'`
131+
132+
dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
133+
dnl # then the first line is used to determine if the condition is true.
134+
dnl # The sed right after the echo is to remove any indented white space.
135+
m4_case(m4_tolower($2),
136+
[lt],[
137+
ax_compare_version=`echo "x$A
138+
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
139+
],
140+
[gt],[
141+
ax_compare_version=`echo "x$A
142+
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
143+
],
144+
[le],[
145+
ax_compare_version=`echo "x$A
146+
x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
147+
],
148+
[ge],[
149+
ax_compare_version=`echo "x$A
150+
x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
151+
],[
152+
dnl Split the operator from the subversion count if present.
153+
m4_bmatch(m4_substr($2,2),
154+
[0],[
155+
# A count of zero means use the length of the shorter version.
156+
# Determine the number of characters in A and B.
157+
ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
158+
ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
159+
160+
# Set A to no more than B's length and B to no more than A's length.
161+
A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
162+
B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
163+
],
164+
[[0-9]+],[
165+
# A count greater than zero means use only that many subversions
166+
A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
167+
B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
168+
],
169+
[.+],[
170+
AC_WARNING(
171+
[illegal OP numeric parameter: $2])
172+
],[])
173+
174+
# Pad zeros at end of numbers to make same length.
175+
ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
176+
B="$B`echo $A | sed 's/./0/g'`"
177+
A="$ax_compare_version_tmp_A"
178+
179+
# Check for equality or inequality as necessary.
180+
m4_case(m4_tolower(m4_substr($2,0,2)),
181+
[eq],[
182+
test "x$A" = "x$B" && ax_compare_version=true
183+
],
184+
[ne],[
185+
test "x$A" != "x$B" && ax_compare_version=true
186+
],[
187+
AC_WARNING([illegal OP parameter: $2])
188+
])
189+
])
190+
191+
AS_VAR_POPDEF([A])dnl
192+
AS_VAR_POPDEF([B])dnl
193+
194+
dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
195+
if test "$ax_compare_version" = "true" ; then
196+
m4_ifvaln([$4],[$4],[:])dnl
197+
m4_ifvaln([$5],[else $5])dnl
198+
fi
199+
]) dnl AX_COMPARE_VERSION
200+
23201
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24202
dnl serial 11 (pkg-config-0.29)
25203
dnl

0 commit comments

Comments
 (0)