~ubuntu-branches/ubuntu/precise/amule-adunanza/precise

« back to all changes in this revision

Viewing changes to m4/cryptopp.m4

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-02-18 21:16:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100218211623-gptwe60zx1knfkmu
Tags: 2010.1+2.2.6-0ubuntu1
* New upstream release (LP: #524697)
  - Drop manpages_spelling_fixes.diff fixed by upstream
  - Drop cryptopp-reference.diff fixed by upstream
  - Bump Standards-Version no changes required
  - Update install files (amule -> amuleadunanza)
  - debian/rules: amule.xpm -> amuleadunanza.xpm
  - Add README.Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#                                                       -*- Autoconf -*-
2
2
# This file is part of the aMule Project.
3
3
#
4
 
# Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
 
4
# Copyright (c) 2003-2009 aMule Team ( admin@amule.org / http://www.amule.org )
5
5
#
6
6
# Any parts of this program derived from the xMule, lMule or eMule project,
7
7
# or contributed by third-party developers are copyrighted by their
60
60
dnl
61
61
AC_DEFUN([MULE_CHECK_CRYPTOPP],
62
62
[dnl
 
63
AC_REQUIRE([AC_PROG_EGREP])dnl
63
64
m4_define([MIN_CRYPTO_VERSION], [m4_ifval([$1], [$1], [5.1])])dnl
64
65
 
65
66
        AC_ARG_WITH([crypto-prefix],
75
76
        CRYPTOPP_INCLUDE_PREFIX="unknown"
76
77
        cryptopp_libdir="unknown"
77
78
 
78
 
        for CRYPTOPP_PREFIX in "$with_crypto_prefix" /usr /usr/local /opt /opt/local /usr/pkg /mingw ; do
79
 
                AS_IF([test -z "$CRYPTOPP_PREFIX"], [continue])
80
 
 
81
 
                # Find the Cryptopp header
82
 
                MULE_IF([test -f $CRYPTOPP_PREFIX/$cryptopp_file_with_version], [
 
79
        AS_IF([test -n "$with_crypto_prefix"], [
 
80
                # Find the Cryptopp header in the user-provided location
 
81
                MULE_IF([test -f $with_crypto_prefix/$cryptopp_file_with_version], [
83
82
                        CRYPTOPP_STYLE="sources"
84
83
                        CRYPTOPP_LIB_NAME="cryptopp"
85
84
                        cryptopp_includedir=
86
 
                        CRYPTOPP_INCLUDE_PREFIX="$CRYPTOPP_PREFIX"
 
85
                        CRYPTOPP_INCLUDE_PREFIX="$with_crypto_prefix"
87
86
                        cryptopp_libdir=
88
 
                        break
89
 
                ], [test -f $CRYPTOPP_PREFIX/include/cryptopp/$cryptopp_file_with_version], [
 
87
                ], [test -f $with_crypto_prefix/include/cryptopp/$cryptopp_file_with_version], [
90
88
                        CRYPTOPP_STYLE="installed"
91
89
                        CRYPTOPP_LIB_NAME="cryptopp"
92
 
                        cryptopp_includedir="$CRYPTOPP_PREFIX/include"
 
90
                        cryptopp_includedir="$with_crypto_prefix/include"
93
91
                        CRYPTOPP_INCLUDE_PREFIX="$CRYPTOPP_LIB_NAME"
94
 
                        cryptopp_libdir="$CRYPTOPP_PREFIX/lib"
95
 
                        break
96
 
                ], [test -f $CRYPTOPP_PREFIX/include/crypto++/$cryptopp_file_with_version], [
 
92
                        cryptopp_libdir="$with_crypto_prefix/lib"
 
93
                ], [test -f $with_crypto_prefix/include/crypto++/$cryptopp_file_with_version], [
97
94
                        # Debian uses libcrypto++5.1 - it's not my fault, please soda patch the package
98
95
                        CRYPTOPP_STYLE="gentoo_debian"
99
96
                        CRYPTOPP_LIB_NAME="crypto++"
100
 
                        cryptopp_includedir="$CRYPTOPP_PREFIX/include"
 
97
                        cryptopp_includedir="$with_crypto_prefix/include"
101
98
                        CRYPTOPP_INCLUDE_PREFIX="$CRYPTOPP_LIB_NAME"
102
 
                        cryptopp_libdir="$CRYPTOPP_PREFIX/lib"
103
 
                        break
 
99
                        cryptopp_libdir="$with_crypto_prefix/lib"
104
100
                ])
105
 
        done
 
101
        ], [
 
102
                for CRYPTOPP_PREFIX in /usr /usr/local /opt /opt/local /usr/pkg /mingw ; do
 
103
                        # Find the Cryptopp header in system locations
 
104
                        MULE_IF([test -f $CRYPTOPP_PREFIX/$cryptopp_file_with_version], [
 
105
                                CRYPTOPP_STYLE="sources"
 
106
                                CRYPTOPP_LIB_NAME="cryptopp"
 
107
                                cryptopp_includedir=
 
108
                                CRYPTOPP_INCLUDE_PREFIX="$CRYPTOPP_PREFIX"
 
109
                                cryptopp_libdir=
 
110
                                break
 
111
                        ], [test -f $CRYPTOPP_PREFIX/include/cryptopp/$cryptopp_file_with_version], [
 
112
                                CRYPTOPP_STYLE="installed"
 
113
                                CRYPTOPP_LIB_NAME="cryptopp"
 
114
                                cryptopp_includedir="$CRYPTOPP_PREFIX/include"
 
115
                                CRYPTOPP_INCLUDE_PREFIX="$CRYPTOPP_LIB_NAME"
 
116
                                cryptopp_libdir="$CRYPTOPP_PREFIX/lib"
 
117
                                break
 
118
                        ], [test -f $CRYPTOPP_PREFIX/include/crypto++/$cryptopp_file_with_version], [
 
119
                                # Debian uses libcrypto++5.1 - it's not my fault, please soda patch the package
 
120
                                CRYPTOPP_STYLE="gentoo_debian"
 
121
                                CRYPTOPP_LIB_NAME="crypto++"
 
122
                                cryptopp_includedir="$CRYPTOPP_PREFIX/include"
 
123
                                CRYPTOPP_INCLUDE_PREFIX="$CRYPTOPP_LIB_NAME"
 
124
                                cryptopp_libdir="$CRYPTOPP_PREFIX/lib"
 
125
                                break
 
126
                        ])
 
127
                done
 
128
        ])
106
129
 
107
130
        AS_IF([test $CRYPTOPP_STYLE = "unknown"], [result=no; resultstr=""], [
108
131
                # Find out the crypto++ version and check against the minimum required
109
132
                cryptopp_header_path="${cryptopp_includedir+$cryptopp_includedir/}$CRYPTOPP_INCLUDE_PREFIX/$cryptopp_file_with_version"
110
 
                CRYPTOPP_VERSION_STRING=`grep "Reference Manual" $cryptopp_header_path | sed -e ['s/[^0-9]*\([0-9.]*\).*/\1/']`
 
133
                CRYPTOPP_VERSION_STRING=`$EGREP "Reference Manual|API Reference" $cryptopp_header_path | sed -e ['s/[^0-9]*\([0-9.]*\).*/\1/']`
111
134
                CRYPTOPP_VERSION_NUMBER=`echo $CRYPTOPP_VERSION_STRING | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
112
135
                minvers=`echo MIN_CRYPTO_VERSION | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
113
136