mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
re-organized include files
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
#
|
#
|
||||||
|
|
||||||
SUBDIRS = libpcp src man tests
|
SUBDIRS = include libpcp src man tests
|
||||||
ACLOCAL_AMFLAGS = -I config
|
ACLOCAL_AMFLAGS = -I config
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Makefile.in generated by automake 1.12.4 from Makefile.am.
|
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||||
@@ -272,7 +272,7 @@ target_alias = @target_alias@
|
|||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
SUBDIRS = libpcp src man tests
|
SUBDIRS = include libpcp src man tests
|
||||||
ACLOCAL_AMFLAGS = -I config
|
ACLOCAL_AMFLAGS = -I config
|
||||||
all: all-recursive
|
all: all-recursive
|
||||||
|
|
||||||
|
|||||||
6
aclocal.m4
vendored
6
aclocal.m4
vendored
@@ -1,4 +1,4 @@
|
|||||||
# generated automatically by aclocal 1.12.4 -*- Autoconf -*-
|
# generated automatically by aclocal 1.12.6 -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
|
|||||||
[am__api_version='1.12'
|
[am__api_version='1.12'
|
||||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||||
dnl require some minimum version. Point them to the right macro.
|
dnl require some minimum version. Point them to the right macro.
|
||||||
m4_if([$1], [1.12.4], [],
|
m4_if([$1], [1.12.6], [],
|
||||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
|
|||||||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||||
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
||||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||||
[AM_AUTOMAKE_VERSION([1.12.4])dnl
|
[AM_AUTOMAKE_VERSION([1.12.6])dnl
|
||||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
||||||
|
|||||||
13
autogen.sh
13
autogen.sh
@@ -20,11 +20,8 @@ set +x
|
|||||||
(echo "#ifndef _HAVE_PCP"; echo "#define _HAVE_PCP"; echo) > include/pcp.h
|
(echo "#ifndef _HAVE_PCP"; echo "#define _HAVE_PCP"; echo) > include/pcp.h
|
||||||
(echo "#ifdef __cplusplus"; echo "extern \"C\" {"; echo "#endif"; echo) >> include/pcp.h
|
(echo "#ifdef __cplusplus"; echo "extern \"C\" {"; echo "#endif"; echo) >> include/pcp.h
|
||||||
|
|
||||||
egrep -h "^#include" libpcp/*.h | grep -v '"' | sort -u >> include/pcp.h
|
ls include/pcp/*.h | sed 's#include/##' | while read include; do
|
||||||
|
echo "#include \"$include\"" >> include/pcp.h
|
||||||
egrep -l _PCP libpcp/*.h | while read include; do
|
|
||||||
(echo; echo "// +++ from $include: +++"; echo) >> include/pcp.h
|
|
||||||
grep -h -v _HAVE $include | egrep -v "^#include" >> include/pcp.h
|
|
||||||
done
|
done
|
||||||
|
|
||||||
(echo "#ifdef __cplusplus"; echo "}"; echo "#endif"; echo) >> include/pcp.h
|
(echo "#ifdef __cplusplus"; echo "}"; echo "#endif"; echo) >> include/pcp.h
|
||||||
@@ -32,9 +29,9 @@ done
|
|||||||
|
|
||||||
|
|
||||||
# generate the version file
|
# generate the version file
|
||||||
maj=`egrep "#define PCP_VERSION_MAJOR" libpcp/version.h | awk '{print $3}'`
|
maj=`egrep "#define PCP_VERSION_MAJOR" include/pcp/version.h | awk '{print $3}'`
|
||||||
min=`egrep "#define PCP_VERSION_MINOR" libpcp/version.h | awk '{print $3}'`
|
min=`egrep "#define PCP_VERSION_MINOR" include/pcp/version.h | awk '{print $3}'`
|
||||||
pat=`egrep "#define PCP_VERSION_PATCH" libpcp/version.h | awk '{print $3}'`
|
pat=`egrep "#define PCP_VERSION_PATCH" include/pcp/version.h | awk '{print $3}'`
|
||||||
echo "$maj.$min.$pat" > VERSION
|
echo "$maj.$min.$pat" > VERSION
|
||||||
|
|
||||||
# generate the manpage
|
# generate the manpage
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Wrapper for compilers which do not understand '-c -o'.
|
# Wrapper for compilers which do not understand '-c -o'.
|
||||||
|
|
||||||
scriptversion=2012-03-05.13; # UTC
|
scriptversion=2012-10-14.11; # UTC
|
||||||
|
|
||||||
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||||
@@ -112,6 +112,11 @@ func_cl_dashl ()
|
|||||||
lib=$dir/$lib.lib
|
lib=$dir/$lib.lib
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
if test -f "$dir/lib$lib.a"; then
|
||||||
|
found=yes
|
||||||
|
lib=$dir/lib$lib.a
|
||||||
|
break
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
IFS=$save_IFS
|
IFS=$save_IFS
|
||||||
|
|
||||||
|
|||||||
964
config/config.guess
vendored
964
config/config.guess
vendored
File diff suppressed because it is too large
Load Diff
506
config/config.sub
vendored
506
config/config.sub
vendored
@@ -1,42 +1,40 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Configuration validation subroutine script.
|
# Configuration validation subroutine script.
|
||||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
# Copyright 1992-2013 Free Software Foundation, Inc.
|
||||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
timestamp='2003-07-04'
|
timestamp='2013-04-24'
|
||||||
|
|
||||||
# This file is (in principle) common to ALL GNU software.
|
# This file is free software; you can redistribute it and/or modify it
|
||||||
# The presence of a machine in this file suggests that SOME GNU software
|
# under the terms of the GNU General Public License as published by
|
||||||
# can handle that machine. It does not imply ALL GNU software can.
|
# the Free Software Foundation; either version 3 of the License, or
|
||||||
#
|
|
||||||
# This file is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful, but
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# GNU General Public License for more details.
|
# General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330,
|
#
|
||||||
# Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
# As a special exception to the GNU General Public License, if you
|
||||||
# distribute this file as part of a program that contains a
|
# distribute this file as part of a program that contains a
|
||||||
# configuration script generated by Autoconf, you may include it under
|
# configuration script generated by Autoconf, you may include it under
|
||||||
# the same distribution terms that you use for the rest of that program.
|
# the same distribution terms that you use for the rest of that
|
||||||
|
# program. This Exception is an additional permission under section 7
|
||||||
|
# of the GNU General Public License, version 3 ("GPLv3").
|
||||||
|
|
||||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
|
||||||
# diff and a properly formatted ChangeLog entry.
|
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||||
#
|
#
|
||||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||||
# Supply the specified configuration type as an argument.
|
# Supply the specified configuration type as an argument.
|
||||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||||
|
|
||||||
|
# You can get the latest version of this script from:
|
||||||
|
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||||
|
|
||||||
# This file is supposed to be the same for all GNU packages
|
# This file is supposed to be the same for all GNU packages
|
||||||
# and recognize all the CPU types, system types and aliases
|
# and recognize all the CPU types, system types and aliases
|
||||||
# that are meaningful with *any* GNU software.
|
# that are meaningful with *any* GNU software.
|
||||||
@@ -70,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||||||
version="\
|
version="\
|
||||||
GNU config.sub ($timestamp)
|
GNU config.sub ($timestamp)
|
||||||
|
|
||||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
Copyright 1992-2013 Free Software Foundation, Inc.
|
||||||
Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
@@ -83,11 +80,11 @@ Try \`$me --help' for more information."
|
|||||||
while test $# -gt 0 ; do
|
while test $# -gt 0 ; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--time-stamp | --time* | -t )
|
--time-stamp | --time* | -t )
|
||||||
echo "$timestamp" ; exit 0 ;;
|
echo "$timestamp" ; exit ;;
|
||||||
--version | -v )
|
--version | -v )
|
||||||
echo "$version" ; exit 0 ;;
|
echo "$version" ; exit ;;
|
||||||
--help | --h* | -h )
|
--help | --h* | -h )
|
||||||
echo "$usage"; exit 0 ;;
|
echo "$usage"; exit ;;
|
||||||
-- ) # Stop option processing
|
-- ) # Stop option processing
|
||||||
shift; break ;;
|
shift; break ;;
|
||||||
- ) # Use stdin as input.
|
- ) # Use stdin as input.
|
||||||
@@ -99,7 +96,7 @@ while test $# -gt 0 ; do
|
|||||||
*local*)
|
*local*)
|
||||||
# First pass through any local machine types.
|
# First pass through any local machine types.
|
||||||
echo $1
|
echo $1
|
||||||
exit 0;;
|
exit ;;
|
||||||
|
|
||||||
* )
|
* )
|
||||||
break ;;
|
break ;;
|
||||||
@@ -118,10 +115,18 @@ esac
|
|||||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||||
case $maybe_os in
|
case $maybe_os in
|
||||||
nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||||
|
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||||
|
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||||
|
kopensolaris*-gnu* | \
|
||||||
|
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||||
os=-$maybe_os
|
os=-$maybe_os
|
||||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||||
;;
|
;;
|
||||||
|
android-linux)
|
||||||
|
os=-linux-android
|
||||||
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||||
if [ $basic_machine != $1 ]
|
if [ $basic_machine != $1 ]
|
||||||
@@ -144,10 +149,13 @@ case $os in
|
|||||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||||
-apple | -axis)
|
-apple | -axis | -knuth | -cray | -microblaze*)
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
|
-bluegene*)
|
||||||
|
os=-cnk
|
||||||
|
;;
|
||||||
-sim | -cisco | -oki | -wec | -winbond)
|
-sim | -cisco | -oki | -wec | -winbond)
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
@@ -169,6 +177,10 @@ case $os in
|
|||||||
-hiux*)
|
-hiux*)
|
||||||
os=-hiuxwe2
|
os=-hiuxwe2
|
||||||
;;
|
;;
|
||||||
|
-sco6)
|
||||||
|
os=-sco5v6
|
||||||
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
|
;;
|
||||||
-sco5)
|
-sco5)
|
||||||
os=-sco3.2v5
|
os=-sco3.2v5
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
@@ -185,6 +197,10 @@ case $os in
|
|||||||
# Don't forget version if it is 3.2v4 or newer.
|
# Don't forget version if it is 3.2v4 or newer.
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
|
-sco5v6*)
|
||||||
|
# Don't forget version if it is 3.2v4 or newer.
|
||||||
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
|
;;
|
||||||
-sco*)
|
-sco*)
|
||||||
os=-sco3.2v2
|
os=-sco3.2v2
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
@@ -202,6 +218,12 @@ case $os in
|
|||||||
-isc*)
|
-isc*)
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
|
-lynx*178)
|
||||||
|
os=-lynxos178
|
||||||
|
;;
|
||||||
|
-lynx*5)
|
||||||
|
os=-lynxos5
|
||||||
|
;;
|
||||||
-lynx*)
|
-lynx*)
|
||||||
os=-lynxos
|
os=-lynxos
|
||||||
;;
|
;;
|
||||||
@@ -226,55 +248,106 @@ case $basic_machine in
|
|||||||
# Some are omitted here because they have special meanings below.
|
# Some are omitted here because they have special meanings below.
|
||||||
1750a | 580 \
|
1750a | 580 \
|
||||||
| a29k \
|
| a29k \
|
||||||
|
| aarch64 | aarch64_be \
|
||||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
| am33_2.0 \
|
||||||
|
| arc | arceb \
|
||||||
|
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||||
|
| avr | avr32 \
|
||||||
|
| be32 | be64 \
|
||||||
|
| bfin \
|
||||||
| c4x | clipper \
|
| c4x | clipper \
|
||||||
| d10v | d30v | dlx | dsp16xx \
|
| d10v | d30v | dlx | dsp16xx \
|
||||||
| fr30 | frv \
|
| epiphany \
|
||||||
|
| fido | fr30 | frv \
|
||||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||||
|
| hexagon \
|
||||||
| i370 | i860 | i960 | ia64 \
|
| i370 | i860 | i960 | ia64 \
|
||||||
| ip2k \
|
| ip2k | iq2000 \
|
||||||
| m32r | m68000 | m68k | m88k | mcore \
|
| le32 | le64 \
|
||||||
|
| lm32 \
|
||||||
|
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||||
|
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
||||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||||
| mips16 \
|
| mips16 \
|
||||||
| mips64 | mips64el \
|
| mips64 | mips64el \
|
||||||
| mips64vr | mips64vrel \
|
| mips64octeon | mips64octeonel \
|
||||||
| mips64orion | mips64orionel \
|
| mips64orion | mips64orionel \
|
||||||
|
| mips64r5900 | mips64r5900el \
|
||||||
|
| mips64vr | mips64vrel \
|
||||||
| mips64vr4100 | mips64vr4100el \
|
| mips64vr4100 | mips64vr4100el \
|
||||||
| mips64vr4300 | mips64vr4300el \
|
| mips64vr4300 | mips64vr4300el \
|
||||||
| mips64vr5000 | mips64vr5000el \
|
| mips64vr5000 | mips64vr5000el \
|
||||||
|
| mips64vr5900 | mips64vr5900el \
|
||||||
| mipsisa32 | mipsisa32el \
|
| mipsisa32 | mipsisa32el \
|
||||||
| mipsisa32r2 | mipsisa32r2el \
|
| mipsisa32r2 | mipsisa32r2el \
|
||||||
| mipsisa64 | mipsisa64el \
|
| mipsisa64 | mipsisa64el \
|
||||||
|
| mipsisa64r2 | mipsisa64r2el \
|
||||||
| mipsisa64sb1 | mipsisa64sb1el \
|
| mipsisa64sb1 | mipsisa64sb1el \
|
||||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||||
|
| mipsr5900 | mipsr5900el \
|
||||||
| mipstx39 | mipstx39el \
|
| mipstx39 | mipstx39el \
|
||||||
| mn10200 | mn10300 \
|
| mn10200 | mn10300 \
|
||||||
|
| moxie \
|
||||||
|
| mt \
|
||||||
| msp430 \
|
| msp430 \
|
||||||
|
| nds32 | nds32le | nds32be \
|
||||||
|
| nios | nios2 | nios2eb | nios2el \
|
||||||
| ns16k | ns32k \
|
| ns16k | ns32k \
|
||||||
| openrisc | or32 \
|
| open8 \
|
||||||
|
| or1k | or32 \
|
||||||
| pdp10 | pdp11 | pj | pjl \
|
| pdp10 | pdp11 | pj | pjl \
|
||||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||||
| pyramid \
|
| pyramid \
|
||||||
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
| rl78 | rx \
|
||||||
|
| score \
|
||||||
|
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||||
| sh64 | sh64le \
|
| sh64 | sh64le \
|
||||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||||
| strongarm \
|
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||||
| tahoe | thumb | tic4x | tic80 | tron \
|
| spu \
|
||||||
| v850 | v850e \
|
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||||
|
| ubicom32 \
|
||||||
|
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||||
| we32k \
|
| we32k \
|
||||||
| x86 | xscale | xstormy16 | xtensa \
|
| x86 | xc16x | xstormy16 | xtensa \
|
||||||
| z8k)
|
| z8k | z80)
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
;;
|
;;
|
||||||
m6811 | m68hc11 | m6812 | m68hc12)
|
c54x)
|
||||||
# Motorola 68HC11/12.
|
basic_machine=tic54x-unknown
|
||||||
|
;;
|
||||||
|
c55x)
|
||||||
|
basic_machine=tic55x-unknown
|
||||||
|
;;
|
||||||
|
c6x)
|
||||||
|
basic_machine=tic6x-unknown
|
||||||
|
;;
|
||||||
|
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
os=-none
|
os=-none
|
||||||
;;
|
;;
|
||||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
||||||
;;
|
;;
|
||||||
|
ms1)
|
||||||
|
basic_machine=mt-unknown
|
||||||
|
;;
|
||||||
|
|
||||||
|
strongarm | thumb | xscale)
|
||||||
|
basic_machine=arm-unknown
|
||||||
|
;;
|
||||||
|
xgate)
|
||||||
|
basic_machine=$basic_machine-unknown
|
||||||
|
os=-none
|
||||||
|
;;
|
||||||
|
xscaleeb)
|
||||||
|
basic_machine=armeb-unknown
|
||||||
|
;;
|
||||||
|
|
||||||
|
xscaleel)
|
||||||
|
basic_machine=armel-unknown
|
||||||
|
;;
|
||||||
|
|
||||||
# We use `pc' rather than `unknown'
|
# We use `pc' rather than `unknown'
|
||||||
# because (1) that's what they normally are, and
|
# because (1) that's what they normally are, and
|
||||||
@@ -290,58 +363,82 @@ case $basic_machine in
|
|||||||
# Recognize the basic CPU types with company name.
|
# Recognize the basic CPU types with company name.
|
||||||
580-* \
|
580-* \
|
||||||
| a29k-* \
|
| a29k-* \
|
||||||
|
| aarch64-* | aarch64_be-* \
|
||||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||||
| alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* \
|
| alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \
|
||||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||||
| avr-* \
|
| avr-* | avr32-* \
|
||||||
| bs2000-* \
|
| be32-* | be64-* \
|
||||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
| bfin-* | bs2000-* \
|
||||||
| clipper-* | cydra-* \
|
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||||
|
| clipper-* | craynv-* | cydra-* \
|
||||||
| d10v-* | d30v-* | dlx-* \
|
| d10v-* | d30v-* | dlx-* \
|
||||||
| elxsi-* \
|
| elxsi-* \
|
||||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||||
| h8300-* | h8500-* \
|
| h8300-* | h8500-* \
|
||||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||||
|
| hexagon-* \
|
||||||
| i*86-* | i860-* | i960-* | ia64-* \
|
| i*86-* | i860-* | i960-* | ia64-* \
|
||||||
| ip2k-* \
|
| ip2k-* | iq2000-* \
|
||||||
| m32r-* \
|
| le32-* | le64-* \
|
||||||
|
| lm32-* \
|
||||||
|
| m32c-* | m32r-* | m32rle-* \
|
||||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||||
| m88110-* | m88k-* | mcore-* \
|
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||||
|
| microblaze-* | microblazeel-* \
|
||||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||||
| mips16-* \
|
| mips16-* \
|
||||||
| mips64-* | mips64el-* \
|
| mips64-* | mips64el-* \
|
||||||
| mips64vr-* | mips64vrel-* \
|
| mips64octeon-* | mips64octeonel-* \
|
||||||
| mips64orion-* | mips64orionel-* \
|
| mips64orion-* | mips64orionel-* \
|
||||||
|
| mips64r5900-* | mips64r5900el-* \
|
||||||
|
| mips64vr-* | mips64vrel-* \
|
||||||
| mips64vr4100-* | mips64vr4100el-* \
|
| mips64vr4100-* | mips64vr4100el-* \
|
||||||
| mips64vr4300-* | mips64vr4300el-* \
|
| mips64vr4300-* | mips64vr4300el-* \
|
||||||
| mips64vr5000-* | mips64vr5000el-* \
|
| mips64vr5000-* | mips64vr5000el-* \
|
||||||
|
| mips64vr5900-* | mips64vr5900el-* \
|
||||||
| mipsisa32-* | mipsisa32el-* \
|
| mipsisa32-* | mipsisa32el-* \
|
||||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||||
| mipsisa64-* | mipsisa64el-* \
|
| mipsisa64-* | mipsisa64el-* \
|
||||||
|
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||||
|
| mipsr5900-* | mipsr5900el-* \
|
||||||
| mipstx39-* | mipstx39el-* \
|
| mipstx39-* | mipstx39el-* \
|
||||||
|
| mmix-* \
|
||||||
|
| mt-* \
|
||||||
| msp430-* \
|
| msp430-* \
|
||||||
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
|
| nds32-* | nds32le-* | nds32be-* \
|
||||||
|
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||||
|
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||||
|
| open8-* \
|
||||||
| orion-* \
|
| orion-* \
|
||||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||||
| pyramid-* \
|
| pyramid-* \
|
||||||
| romp-* | rs6000-* \
|
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||||
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
| sparclite-* \
|
||||||
| tahoe-* | thumb-* \
|
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
||||||
|
| tahoe-* \
|
||||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||||
|
| tile*-* \
|
||||||
| tron-* \
|
| tron-* \
|
||||||
| v850-* | v850e-* | vax-* \
|
| ubicom32-* \
|
||||||
|
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||||
|
| vax-* \
|
||||||
| we32k-* \
|
| we32k-* \
|
||||||
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
|
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||||
| xtensa-* \
|
| xstormy16-* | xtensa*-* \
|
||||||
| ymp-* \
|
| ymp-* \
|
||||||
| z8k-*)
|
| z8k-* | z80-*)
|
||||||
|
;;
|
||||||
|
# Recognize the basic CPU types without company name, with glob match.
|
||||||
|
xtensa*)
|
||||||
|
basic_machine=$basic_machine-unknown
|
||||||
;;
|
;;
|
||||||
# Recognize the various machine names and aliases which stand
|
# Recognize the various machine names and aliases which stand
|
||||||
# for a CPU type and a company and sometimes even an OS.
|
# for a CPU type and a company and sometimes even an OS.
|
||||||
@@ -359,6 +456,9 @@ case $basic_machine in
|
|||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-udi
|
os=-udi
|
||||||
;;
|
;;
|
||||||
|
abacus)
|
||||||
|
basic_machine=abacus-unknown
|
||||||
|
;;
|
||||||
adobe68k)
|
adobe68k)
|
||||||
basic_machine=m68010-adobe
|
basic_machine=m68010-adobe
|
||||||
os=-scout
|
os=-scout
|
||||||
@@ -373,9 +473,6 @@ case $basic_machine in
|
|||||||
basic_machine=a29k-none
|
basic_machine=a29k-none
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
amd64)
|
|
||||||
basic_machine=x86_64-pc
|
|
||||||
;;
|
|
||||||
amdahl)
|
amdahl)
|
||||||
basic_machine=580-amdahl
|
basic_machine=580-amdahl
|
||||||
os=-sysv
|
os=-sysv
|
||||||
@@ -399,6 +496,10 @@ case $basic_machine in
|
|||||||
basic_machine=m68k-apollo
|
basic_machine=m68k-apollo
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
|
aros)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-aros
|
||||||
|
;;
|
||||||
aux)
|
aux)
|
||||||
basic_machine=m68k-apple
|
basic_machine=m68k-apple
|
||||||
os=-aux
|
os=-aux
|
||||||
@@ -407,10 +508,35 @@ case $basic_machine in
|
|||||||
basic_machine=ns32k-sequent
|
basic_machine=ns32k-sequent
|
||||||
os=-dynix
|
os=-dynix
|
||||||
;;
|
;;
|
||||||
|
blackfin)
|
||||||
|
basic_machine=bfin-unknown
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
|
blackfin-*)
|
||||||
|
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
|
bluegene*)
|
||||||
|
basic_machine=powerpc-ibm
|
||||||
|
os=-cnk
|
||||||
|
;;
|
||||||
|
c54x-*)
|
||||||
|
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
;;
|
||||||
|
c55x-*)
|
||||||
|
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
;;
|
||||||
|
c6x-*)
|
||||||
|
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
;;
|
||||||
c90)
|
c90)
|
||||||
basic_machine=c90-cray
|
basic_machine=c90-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
|
cegcc)
|
||||||
|
basic_machine=arm-unknown
|
||||||
|
os=-cegcc
|
||||||
|
;;
|
||||||
convex-c1)
|
convex-c1)
|
||||||
basic_machine=c1-convex
|
basic_machine=c1-convex
|
||||||
os=-bsd
|
os=-bsd
|
||||||
@@ -435,12 +561,27 @@ case $basic_machine in
|
|||||||
basic_machine=j90-cray
|
basic_machine=j90-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
|
craynv)
|
||||||
|
basic_machine=craynv-cray
|
||||||
|
os=-unicosmp
|
||||||
|
;;
|
||||||
|
cr16 | cr16-*)
|
||||||
|
basic_machine=cr16-unknown
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
crds | unos)
|
crds | unos)
|
||||||
basic_machine=m68k-crds
|
basic_machine=m68k-crds
|
||||||
;;
|
;;
|
||||||
|
crisv32 | crisv32-* | etraxfs*)
|
||||||
|
basic_machine=crisv32-axis
|
||||||
|
;;
|
||||||
cris | cris-* | etrax*)
|
cris | cris-* | etrax*)
|
||||||
basic_machine=cris-axis
|
basic_machine=cris-axis
|
||||||
;;
|
;;
|
||||||
|
crx)
|
||||||
|
basic_machine=crx-unknown
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
da30 | da30-*)
|
da30 | da30-*)
|
||||||
basic_machine=m68k-da30
|
basic_machine=m68k-da30
|
||||||
;;
|
;;
|
||||||
@@ -463,6 +604,14 @@ case $basic_machine in
|
|||||||
basic_machine=m88k-motorola
|
basic_machine=m88k-motorola
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
|
dicos)
|
||||||
|
basic_machine=i686-pc
|
||||||
|
os=-dicos
|
||||||
|
;;
|
||||||
|
djgpp)
|
||||||
|
basic_machine=i586-pc
|
||||||
|
os=-msdosdjgpp
|
||||||
|
;;
|
||||||
dpx20 | dpx20-*)
|
dpx20 | dpx20-*)
|
||||||
basic_machine=rs6000-bull
|
basic_machine=rs6000-bull
|
||||||
os=-bosx
|
os=-bosx
|
||||||
@@ -574,7 +723,6 @@ case $basic_machine in
|
|||||||
i370-ibm* | ibm*)
|
i370-ibm* | ibm*)
|
||||||
basic_machine=i370-ibm
|
basic_machine=i370-ibm
|
||||||
;;
|
;;
|
||||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
|
||||||
i*86v32)
|
i*86v32)
|
||||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv32
|
os=-sysv32
|
||||||
@@ -613,6 +761,14 @@ case $basic_machine in
|
|||||||
basic_machine=m68k-isi
|
basic_machine=m68k-isi
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
|
m68knommu)
|
||||||
|
basic_machine=m68k-unknown
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
|
m68knommu-*)
|
||||||
|
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
m88k-omron*)
|
m88k-omron*)
|
||||||
basic_machine=m88k-omron
|
basic_machine=m88k-omron
|
||||||
;;
|
;;
|
||||||
@@ -624,10 +780,21 @@ case $basic_machine in
|
|||||||
basic_machine=ns32k-utek
|
basic_machine=ns32k-utek
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
|
microblaze*)
|
||||||
|
basic_machine=microblaze-xilinx
|
||||||
|
;;
|
||||||
|
mingw64)
|
||||||
|
basic_machine=x86_64-pc
|
||||||
|
os=-mingw64
|
||||||
|
;;
|
||||||
mingw32)
|
mingw32)
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-mingw32
|
os=-mingw32
|
||||||
;;
|
;;
|
||||||
|
mingw32ce)
|
||||||
|
basic_machine=arm-unknown
|
||||||
|
os=-mingw32ce
|
||||||
|
;;
|
||||||
miniframe)
|
miniframe)
|
||||||
basic_machine=m68000-convergent
|
basic_machine=m68000-convergent
|
||||||
;;
|
;;
|
||||||
@@ -641,10 +808,6 @@ case $basic_machine in
|
|||||||
mips3*)
|
mips3*)
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||||
;;
|
;;
|
||||||
mmix*)
|
|
||||||
basic_machine=mmix-knuth
|
|
||||||
os=-mmixware
|
|
||||||
;;
|
|
||||||
monitor)
|
monitor)
|
||||||
basic_machine=m68k-rom68k
|
basic_machine=m68k-rom68k
|
||||||
os=-coff
|
os=-coff
|
||||||
@@ -657,10 +820,21 @@ case $basic_machine in
|
|||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-msdos
|
os=-msdos
|
||||||
;;
|
;;
|
||||||
|
ms1-*)
|
||||||
|
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||||
|
;;
|
||||||
|
msys)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-msys
|
||||||
|
;;
|
||||||
mvs)
|
mvs)
|
||||||
basic_machine=i370-ibm
|
basic_machine=i370-ibm
|
||||||
os=-mvs
|
os=-mvs
|
||||||
;;
|
;;
|
||||||
|
nacl)
|
||||||
|
basic_machine=le32-unknown
|
||||||
|
os=-nacl
|
||||||
|
;;
|
||||||
ncr3000)
|
ncr3000)
|
||||||
basic_machine=i486-ncr
|
basic_machine=i486-ncr
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
@@ -725,9 +899,11 @@ case $basic_machine in
|
|||||||
np1)
|
np1)
|
||||||
basic_machine=np1-gould
|
basic_machine=np1-gould
|
||||||
;;
|
;;
|
||||||
nv1)
|
neo-tandem)
|
||||||
basic_machine=nv1-cray
|
basic_machine=neo-tandem
|
||||||
os=-unicosmp
|
;;
|
||||||
|
nse-tandem)
|
||||||
|
basic_machine=nse-tandem
|
||||||
;;
|
;;
|
||||||
nsr-tandem)
|
nsr-tandem)
|
||||||
basic_machine=nsr-tandem
|
basic_machine=nsr-tandem
|
||||||
@@ -736,9 +912,12 @@ case $basic_machine in
|
|||||||
basic_machine=hppa1.1-oki
|
basic_machine=hppa1.1-oki
|
||||||
os=-proelf
|
os=-proelf
|
||||||
;;
|
;;
|
||||||
or32 | or32-*)
|
openrisc | openrisc-*)
|
||||||
basic_machine=or32-unknown
|
basic_machine=or32-unknown
|
||||||
os=-coff
|
;;
|
||||||
|
os400)
|
||||||
|
basic_machine=powerpc-ibm
|
||||||
|
os=-os400
|
||||||
;;
|
;;
|
||||||
OSE68000 | ose68000)
|
OSE68000 | ose68000)
|
||||||
basic_machine=m68000-ericsson
|
basic_machine=m68000-ericsson
|
||||||
@@ -756,6 +935,14 @@ case $basic_machine in
|
|||||||
basic_machine=i860-intel
|
basic_machine=i860-intel
|
||||||
os=-osf
|
os=-osf
|
||||||
;;
|
;;
|
||||||
|
parisc)
|
||||||
|
basic_machine=hppa-unknown
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
|
parisc-*)
|
||||||
|
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
os=-linux
|
||||||
|
;;
|
||||||
pbd)
|
pbd)
|
||||||
basic_machine=sparc-tti
|
basic_machine=sparc-tti
|
||||||
;;
|
;;
|
||||||
@@ -765,6 +952,12 @@ case $basic_machine in
|
|||||||
pc532 | pc532-*)
|
pc532 | pc532-*)
|
||||||
basic_machine=ns32k-pc532
|
basic_machine=ns32k-pc532
|
||||||
;;
|
;;
|
||||||
|
pc98)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
;;
|
||||||
|
pc98-*)
|
||||||
|
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
;;
|
||||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||||
basic_machine=i586-pc
|
basic_machine=i586-pc
|
||||||
;;
|
;;
|
||||||
@@ -794,9 +987,10 @@ case $basic_machine in
|
|||||||
;;
|
;;
|
||||||
power) basic_machine=power-ibm
|
power) basic_machine=power-ibm
|
||||||
;;
|
;;
|
||||||
ppc) basic_machine=powerpc-unknown
|
ppc | ppcbe) basic_machine=powerpc-unknown
|
||||||
;;
|
;;
|
||||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
ppc-* | ppcbe-*)
|
||||||
|
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
;;
|
;;
|
||||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||||
basic_machine=powerpcle-unknown
|
basic_machine=powerpcle-unknown
|
||||||
@@ -821,6 +1015,14 @@ case $basic_machine in
|
|||||||
basic_machine=i586-unknown
|
basic_machine=i586-unknown
|
||||||
os=-pw32
|
os=-pw32
|
||||||
;;
|
;;
|
||||||
|
rdos | rdos64)
|
||||||
|
basic_machine=x86_64-pc
|
||||||
|
os=-rdos
|
||||||
|
;;
|
||||||
|
rdos32)
|
||||||
|
basic_machine=i386-pc
|
||||||
|
os=-rdos
|
||||||
|
;;
|
||||||
rom68k)
|
rom68k)
|
||||||
basic_machine=m68k-rom68k
|
basic_machine=m68k-rom68k
|
||||||
os=-coff
|
os=-coff
|
||||||
@@ -847,6 +1049,10 @@ case $basic_machine in
|
|||||||
sb1el)
|
sb1el)
|
||||||
basic_machine=mipsisa64sb1el-unknown
|
basic_machine=mipsisa64sb1el-unknown
|
||||||
;;
|
;;
|
||||||
|
sde)
|
||||||
|
basic_machine=mipsisa32-sde
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
sei)
|
sei)
|
||||||
basic_machine=mips-sei
|
basic_machine=mips-sei
|
||||||
os=-seiux
|
os=-seiux
|
||||||
@@ -858,6 +1064,9 @@ case $basic_machine in
|
|||||||
basic_machine=sh-hitachi
|
basic_machine=sh-hitachi
|
||||||
os=-hms
|
os=-hms
|
||||||
;;
|
;;
|
||||||
|
sh5el)
|
||||||
|
basic_machine=sh5le-unknown
|
||||||
|
;;
|
||||||
sh64)
|
sh64)
|
||||||
basic_machine=sh64-unknown
|
basic_machine=sh64-unknown
|
||||||
;;
|
;;
|
||||||
@@ -879,6 +1088,9 @@ case $basic_machine in
|
|||||||
basic_machine=i860-stratus
|
basic_machine=i860-stratus
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
|
strongarm-* | thumb-*)
|
||||||
|
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
|
;;
|
||||||
sun2)
|
sun2)
|
||||||
basic_machine=m68000-sun
|
basic_machine=m68000-sun
|
||||||
;;
|
;;
|
||||||
@@ -935,17 +1147,9 @@ case $basic_machine in
|
|||||||
basic_machine=t90-cray
|
basic_machine=t90-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
tic54x | c54x*)
|
tile*)
|
||||||
basic_machine=tic54x-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
os=-coff
|
os=-linux-gnu
|
||||||
;;
|
|
||||||
tic55x | c55x*)
|
|
||||||
basic_machine=tic55x-unknown
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
tic6x | c6x*)
|
|
||||||
basic_machine=tic6x-unknown
|
|
||||||
os=-coff
|
|
||||||
;;
|
;;
|
||||||
tx39)
|
tx39)
|
||||||
basic_machine=mipstx39-unknown
|
basic_machine=mipstx39-unknown
|
||||||
@@ -960,6 +1164,10 @@ case $basic_machine in
|
|||||||
tower | tower-32)
|
tower | tower-32)
|
||||||
basic_machine=m68k-ncr
|
basic_machine=m68k-ncr
|
||||||
;;
|
;;
|
||||||
|
tpf)
|
||||||
|
basic_machine=s390x-ibm
|
||||||
|
os=-tpf
|
||||||
|
;;
|
||||||
udi29k)
|
udi29k)
|
||||||
basic_machine=a29k-amd
|
basic_machine=a29k-amd
|
||||||
os=-udi
|
os=-udi
|
||||||
@@ -1003,9 +1211,16 @@ case $basic_machine in
|
|||||||
basic_machine=hppa1.1-winbond
|
basic_machine=hppa1.1-winbond
|
||||||
os=-proelf
|
os=-proelf
|
||||||
;;
|
;;
|
||||||
|
xbox)
|
||||||
|
basic_machine=i686-pc
|
||||||
|
os=-mingw32
|
||||||
|
;;
|
||||||
xps | xps100)
|
xps | xps100)
|
||||||
basic_machine=xps100-honeywell
|
basic_machine=xps100-honeywell
|
||||||
;;
|
;;
|
||||||
|
xscale-* | xscalee[bl]-*)
|
||||||
|
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
|
||||||
|
;;
|
||||||
ymp)
|
ymp)
|
||||||
basic_machine=ymp-cray
|
basic_machine=ymp-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
@@ -1014,6 +1229,10 @@ case $basic_machine in
|
|||||||
basic_machine=z8k-unknown
|
basic_machine=z8k-unknown
|
||||||
os=-sim
|
os=-sim
|
||||||
;;
|
;;
|
||||||
|
z80-*-coff)
|
||||||
|
basic_machine=z80-unknown
|
||||||
|
os=-sim
|
||||||
|
;;
|
||||||
none)
|
none)
|
||||||
basic_machine=none-none
|
basic_machine=none-none
|
||||||
os=-none
|
os=-none
|
||||||
@@ -1033,6 +1252,9 @@ case $basic_machine in
|
|||||||
romp)
|
romp)
|
||||||
basic_machine=romp-ibm
|
basic_machine=romp-ibm
|
||||||
;;
|
;;
|
||||||
|
mmix)
|
||||||
|
basic_machine=mmix-knuth
|
||||||
|
;;
|
||||||
rs6000)
|
rs6000)
|
||||||
basic_machine=rs6000-ibm
|
basic_machine=rs6000-ibm
|
||||||
;;
|
;;
|
||||||
@@ -1049,13 +1271,10 @@ case $basic_machine in
|
|||||||
we32k)
|
we32k)
|
||||||
basic_machine=we32k-att
|
basic_machine=we32k-att
|
||||||
;;
|
;;
|
||||||
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
|
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||||
basic_machine=sh-unknown
|
basic_machine=sh-unknown
|
||||||
;;
|
;;
|
||||||
sh64)
|
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||||
basic_machine=sh64-unknown
|
|
||||||
;;
|
|
||||||
sparc | sparcv9 | sparcv9b)
|
|
||||||
basic_machine=sparc-sun
|
basic_machine=sparc-sun
|
||||||
;;
|
;;
|
||||||
cydra)
|
cydra)
|
||||||
@@ -1102,6 +1321,9 @@ case $os in
|
|||||||
# First match some system type aliases
|
# First match some system type aliases
|
||||||
# that might get confused with valid system types.
|
# that might get confused with valid system types.
|
||||||
# -solaris* is a basic system type, with this one exception.
|
# -solaris* is a basic system type, with this one exception.
|
||||||
|
-auroraux)
|
||||||
|
os=-auroraux
|
||||||
|
;;
|
||||||
-solaris1 | -solaris1.*)
|
-solaris1 | -solaris1.*)
|
||||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||||
;;
|
;;
|
||||||
@@ -1122,25 +1344,31 @@ case $os in
|
|||||||
# Each alternative MUST END IN A *, to match a version number.
|
# Each alternative MUST END IN A *, to match a version number.
|
||||||
# -sysv* is not here because it comes later, after sysvr4.
|
# -sysv* is not here because it comes later, after sysvr4.
|
||||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||||
|
| -sym* | -kopensolaris* | -plan9* \
|
||||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||||
| -aos* \
|
| -aos* | -aros* \
|
||||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
|
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
| -bitrig* | -openbsd* | -solidbsd* \
|
||||||
|
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||||
|
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||||
| -chorusos* | -chorusrdb* \
|
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
||||||
|
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
||||||
|
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
|
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||||
|
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||||
# Remember, each alternative MUST END IN *, to match a version number.
|
# Remember, each alternative MUST END IN *, to match a version number.
|
||||||
;;
|
;;
|
||||||
-qnx*)
|
-qnx*)
|
||||||
@@ -1158,12 +1386,15 @@ case $os in
|
|||||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
||||||
;;
|
;;
|
||||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
|
||||||
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
||||||
;;
|
;;
|
||||||
-mac*)
|
-mac*)
|
||||||
os=`echo $os | sed -e 's|mac|macos|'`
|
os=`echo $os | sed -e 's|mac|macos|'`
|
||||||
;;
|
;;
|
||||||
|
-linux-dietlibc)
|
||||||
|
os=-linux-dietlibc
|
||||||
|
;;
|
||||||
-linux*)
|
-linux*)
|
||||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||||
;;
|
;;
|
||||||
@@ -1176,6 +1407,9 @@ case $os in
|
|||||||
-opened*)
|
-opened*)
|
||||||
os=-openedition
|
os=-openedition
|
||||||
;;
|
;;
|
||||||
|
-os400*)
|
||||||
|
os=-os400
|
||||||
|
;;
|
||||||
-wince*)
|
-wince*)
|
||||||
os=-wince
|
os=-wince
|
||||||
;;
|
;;
|
||||||
@@ -1197,6 +1431,9 @@ case $os in
|
|||||||
-atheos*)
|
-atheos*)
|
||||||
os=-atheos
|
os=-atheos
|
||||||
;;
|
;;
|
||||||
|
-syllable*)
|
||||||
|
os=-syllable
|
||||||
|
;;
|
||||||
-386bsd)
|
-386bsd)
|
||||||
os=-bsd
|
os=-bsd
|
||||||
;;
|
;;
|
||||||
@@ -1219,6 +1456,9 @@ case $os in
|
|||||||
-sinix*)
|
-sinix*)
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
|
-tpf*)
|
||||||
|
os=-tpf
|
||||||
|
;;
|
||||||
-triton*)
|
-triton*)
|
||||||
os=-sysv3
|
os=-sysv3
|
||||||
;;
|
;;
|
||||||
@@ -1252,8 +1492,13 @@ case $os in
|
|||||||
-aros*)
|
-aros*)
|
||||||
os=-aros
|
os=-aros
|
||||||
;;
|
;;
|
||||||
-kaos*)
|
-zvmoe)
|
||||||
os=-kaos
|
os=-zvmoe
|
||||||
|
;;
|
||||||
|
-dicos*)
|
||||||
|
os=-dicos
|
||||||
|
;;
|
||||||
|
-nacl*)
|
||||||
;;
|
;;
|
||||||
-none)
|
-none)
|
||||||
;;
|
;;
|
||||||
@@ -1277,6 +1522,12 @@ else
|
|||||||
# system, and we'll never get to this point.
|
# system, and we'll never get to this point.
|
||||||
|
|
||||||
case $basic_machine in
|
case $basic_machine in
|
||||||
|
score-*)
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
|
spu-*)
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
*-acorn)
|
*-acorn)
|
||||||
os=-riscix1.2
|
os=-riscix1.2
|
||||||
;;
|
;;
|
||||||
@@ -1289,6 +1540,18 @@ case $basic_machine in
|
|||||||
c4x-* | tic4x-*)
|
c4x-* | tic4x-*)
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
|
hexagon-*)
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
|
tic54x-*)
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
|
tic55x-*)
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
|
tic6x-*)
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
# This must come before the *-dec entry.
|
# This must come before the *-dec entry.
|
||||||
pdp10-*)
|
pdp10-*)
|
||||||
os=-tops20
|
os=-tops20
|
||||||
@@ -1307,19 +1570,22 @@ case $basic_machine in
|
|||||||
;;
|
;;
|
||||||
m68000-sun)
|
m68000-sun)
|
||||||
os=-sunos3
|
os=-sunos3
|
||||||
# This also exists in the configure program, but was not the
|
|
||||||
# default.
|
|
||||||
# os=-sunos4
|
|
||||||
;;
|
;;
|
||||||
m68*-cisco)
|
m68*-cisco)
|
||||||
os=-aout
|
os=-aout
|
||||||
;;
|
;;
|
||||||
|
mep-*)
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
mips*-cisco)
|
mips*-cisco)
|
||||||
os=-elf
|
os=-elf
|
||||||
;;
|
;;
|
||||||
mips*-*)
|
mips*-*)
|
||||||
os=-elf
|
os=-elf
|
||||||
;;
|
;;
|
||||||
|
or1k-*)
|
||||||
|
os=-elf
|
||||||
|
;;
|
||||||
or32-*)
|
or32-*)
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
@@ -1332,9 +1598,15 @@ case $basic_machine in
|
|||||||
*-be)
|
*-be)
|
||||||
os=-beos
|
os=-beos
|
||||||
;;
|
;;
|
||||||
|
*-haiku)
|
||||||
|
os=-haiku
|
||||||
|
;;
|
||||||
*-ibm)
|
*-ibm)
|
||||||
os=-aix
|
os=-aix
|
||||||
;;
|
;;
|
||||||
|
*-knuth)
|
||||||
|
os=-mmixware
|
||||||
|
;;
|
||||||
*-wec)
|
*-wec)
|
||||||
os=-proelf
|
os=-proelf
|
||||||
;;
|
;;
|
||||||
@@ -1437,7 +1709,7 @@ case $basic_machine in
|
|||||||
-sunos*)
|
-sunos*)
|
||||||
vendor=sun
|
vendor=sun
|
||||||
;;
|
;;
|
||||||
-aix*)
|
-cnk*|-aix*)
|
||||||
vendor=ibm
|
vendor=ibm
|
||||||
;;
|
;;
|
||||||
-beos*)
|
-beos*)
|
||||||
@@ -1467,9 +1739,15 @@ case $basic_machine in
|
|||||||
-mvs* | -opened*)
|
-mvs* | -opened*)
|
||||||
vendor=ibm
|
vendor=ibm
|
||||||
;;
|
;;
|
||||||
|
-os400*)
|
||||||
|
vendor=ibm
|
||||||
|
;;
|
||||||
-ptx*)
|
-ptx*)
|
||||||
vendor=sequent
|
vendor=sequent
|
||||||
;;
|
;;
|
||||||
|
-tpf*)
|
||||||
|
vendor=ibm
|
||||||
|
;;
|
||||||
-vxsim* | -vxworks* | -windiss*)
|
-vxsim* | -vxworks* | -windiss*)
|
||||||
vendor=wrs
|
vendor=wrs
|
||||||
;;
|
;;
|
||||||
@@ -1494,7 +1772,7 @@ case $basic_machine in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
echo $basic_machine$os
|
echo $basic_machine$os
|
||||||
exit 0
|
exit
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
|||||||
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
|
|
||||||
|
# Avoid interferences from the environment.
|
||||||
|
gccflag= dashmflag=
|
||||||
|
|
||||||
# Some modes work just like other modes, but use different flags. We
|
# Some modes work just like other modes, but use different flags. We
|
||||||
# parameterize here, but still list the modes in the big case below,
|
# parameterize here, but still list the modes in the big case below,
|
||||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||||
@@ -108,7 +111,7 @@ if test "$depmode" = msvc7msys; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$depmode" = xlc; then
|
if test "$depmode" = xlc; then
|
||||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
|
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||||
gccflag=-qmakedep=gcc,-MF
|
gccflag=-qmakedep=gcc,-MF
|
||||||
depmode=gcc
|
depmode=gcc
|
||||||
fi
|
fi
|
||||||
@@ -142,13 +145,17 @@ gcc3)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
gcc)
|
gcc)
|
||||||
|
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||||
|
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||||
|
## (see the conditional assignment to $gccflag above).
|
||||||
## There are various ways to get dependency output from gcc. Here's
|
## There are various ways to get dependency output from gcc. Here's
|
||||||
## why we pick this rather obscure method:
|
## why we pick this rather obscure method:
|
||||||
## - Don't want to use -MD because we'd like the dependencies to end
|
## - Don't want to use -MD because we'd like the dependencies to end
|
||||||
## up in a subdir. Having to rename by hand is ugly.
|
## up in a subdir. Having to rename by hand is ugly.
|
||||||
## (We might end up doing this anyway to support other compilers.)
|
## (We might end up doing this anyway to support other compilers.)
|
||||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||||
## -MM, not -M (despite what the docs say).
|
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||||
|
## supported by the other compilers which use the 'gcc' depmode.
|
||||||
## - Using -M directly means running the compiler twice (even worse
|
## - Using -M directly means running the compiler twice (even worse
|
||||||
## than renaming).
|
## than renaming).
|
||||||
if test -z "$gccflag"; then
|
if test -z "$gccflag"; then
|
||||||
|
|||||||
249
config/libtool.m4
vendored
249
config/libtool.m4
vendored
@@ -1,8 +1,8 @@
|
|||||||
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||||
# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
|
# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
# Inc.
|
# Foundation, Inc.
|
||||||
# Written by Gordon Matzigkeit, 1996
|
# Written by Gordon Matzigkeit, 1996
|
||||||
#
|
#
|
||||||
# This file is free software; the Free Software Foundation gives
|
# This file is free software; the Free Software Foundation gives
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
m4_define([_LT_COPYING], [dnl
|
m4_define([_LT_COPYING], [dnl
|
||||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||||
# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
|
# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
# Inc.
|
# Foundation, Inc.
|
||||||
# Written by Gordon Matzigkeit, 1996
|
# Written by Gordon Matzigkeit, 1996
|
||||||
#
|
#
|
||||||
# This file is part of GNU Libtool.
|
# This file is part of GNU Libtool.
|
||||||
@@ -146,6 +146,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|||||||
AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
|
AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
|
||||||
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
|
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
|
||||||
|
|
||||||
|
_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
|
||||||
|
dnl
|
||||||
_LT_DECL([], [host_alias], [0], [The host system])dnl
|
_LT_DECL([], [host_alias], [0], [The host system])dnl
|
||||||
_LT_DECL([], [host], [0])dnl
|
_LT_DECL([], [host], [0])dnl
|
||||||
_LT_DECL([], [host_os], [0])dnl
|
_LT_DECL([], [host_os], [0])dnl
|
||||||
@@ -637,7 +639,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
|
|||||||
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
|
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
|
||||||
configured by $[0], generated by m4_PACKAGE_STRING.
|
configured by $[0], generated by m4_PACKAGE_STRING.
|
||||||
|
|
||||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||||
This config.lt script is free software; the Free Software Foundation
|
This config.lt script is free software; the Free Software Foundation
|
||||||
gives unlimited permision to copy, distribute and modify it."
|
gives unlimited permision to copy, distribute and modify it."
|
||||||
|
|
||||||
@@ -801,6 +803,7 @@ AC_DEFUN([LT_LANG],
|
|||||||
m4_case([$1],
|
m4_case([$1],
|
||||||
[C], [_LT_LANG(C)],
|
[C], [_LT_LANG(C)],
|
||||||
[C++], [_LT_LANG(CXX)],
|
[C++], [_LT_LANG(CXX)],
|
||||||
|
[Go], [_LT_LANG(GO)],
|
||||||
[Java], [_LT_LANG(GCJ)],
|
[Java], [_LT_LANG(GCJ)],
|
||||||
[Fortran 77], [_LT_LANG(F77)],
|
[Fortran 77], [_LT_LANG(F77)],
|
||||||
[Fortran], [_LT_LANG(FC)],
|
[Fortran], [_LT_LANG(FC)],
|
||||||
@@ -822,6 +825,31 @@ m4_defun([_LT_LANG],
|
|||||||
])# _LT_LANG
|
])# _LT_LANG
|
||||||
|
|
||||||
|
|
||||||
|
m4_ifndef([AC_PROG_GO], [
|
||||||
|
############################################################
|
||||||
|
# NOTE: This macro has been submitted for inclusion into #
|
||||||
|
# GNU Autoconf as AC_PROG_GO. When it is available in #
|
||||||
|
# a released version of Autoconf we should remove this #
|
||||||
|
# macro and use it instead. #
|
||||||
|
############################################################
|
||||||
|
m4_defun([AC_PROG_GO],
|
||||||
|
[AC_LANG_PUSH(Go)dnl
|
||||||
|
AC_ARG_VAR([GOC], [Go compiler command])dnl
|
||||||
|
AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
|
||||||
|
_AC_ARG_VAR_LDFLAGS()dnl
|
||||||
|
AC_CHECK_TOOL(GOC, gccgo)
|
||||||
|
if test -z "$GOC"; then
|
||||||
|
if test -n "$ac_tool_prefix"; then
|
||||||
|
AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test -z "$GOC"; then
|
||||||
|
AC_CHECK_PROG(GOC, gccgo, gccgo, false)
|
||||||
|
fi
|
||||||
|
])#m4_defun
|
||||||
|
])#m4_ifndef
|
||||||
|
|
||||||
|
|
||||||
# _LT_LANG_DEFAULT_CONFIG
|
# _LT_LANG_DEFAULT_CONFIG
|
||||||
# -----------------------
|
# -----------------------
|
||||||
m4_defun([_LT_LANG_DEFAULT_CONFIG],
|
m4_defun([_LT_LANG_DEFAULT_CONFIG],
|
||||||
@@ -852,6 +880,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
|
|||||||
m4_ifdef([LT_PROG_GCJ],
|
m4_ifdef([LT_PROG_GCJ],
|
||||||
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
|
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
|
||||||
|
|
||||||
|
AC_PROVIDE_IFELSE([AC_PROG_GO],
|
||||||
|
[LT_LANG(GO)],
|
||||||
|
[m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
|
||||||
|
|
||||||
AC_PROVIDE_IFELSE([LT_PROG_RC],
|
AC_PROVIDE_IFELSE([LT_PROG_RC],
|
||||||
[LT_LANG(RC)],
|
[LT_LANG(RC)],
|
||||||
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
|
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
|
||||||
@@ -954,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
|
|||||||
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
|
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
|
||||||
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
|
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
|
||||||
_lt_result=$?
|
_lt_result=$?
|
||||||
if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
|
# If there is a non-empty error log, and "single_module"
|
||||||
|
# appears in it, assume the flag caused a linker warning
|
||||||
|
if test -s conftest.err && $GREP single_module conftest.err; then
|
||||||
|
cat conftest.err >&AS_MESSAGE_LOG_FD
|
||||||
|
# Otherwise, if the output was created with a 0 exit code from
|
||||||
|
# the compiler, it worked.
|
||||||
|
elif test -f libconftest.dylib && test $_lt_result -eq 0; then
|
||||||
lt_cv_apple_cc_single_mod=yes
|
lt_cv_apple_cc_single_mod=yes
|
||||||
else
|
else
|
||||||
cat conftest.err >&AS_MESSAGE_LOG_FD
|
cat conftest.err >&AS_MESSAGE_LOG_FD
|
||||||
@@ -962,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
|
|||||||
rm -rf libconftest.dylib*
|
rm -rf libconftest.dylib*
|
||||||
rm -f conftest.*
|
rm -f conftest.*
|
||||||
fi])
|
fi])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
|
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
|
||||||
[lt_cv_ld_exported_symbols_list],
|
[lt_cv_ld_exported_symbols_list],
|
||||||
[lt_cv_ld_exported_symbols_list=no
|
[lt_cv_ld_exported_symbols_list=no
|
||||||
@@ -973,6 +1012,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
|
|||||||
[lt_cv_ld_exported_symbols_list=no])
|
[lt_cv_ld_exported_symbols_list=no])
|
||||||
LDFLAGS="$save_LDFLAGS"
|
LDFLAGS="$save_LDFLAGS"
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
|
AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
|
||||||
[lt_cv_ld_force_load=no
|
[lt_cv_ld_force_load=no
|
||||||
cat > conftest.c << _LT_EOF
|
cat > conftest.c << _LT_EOF
|
||||||
@@ -990,7 +1030,9 @@ _LT_EOF
|
|||||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
|
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
|
||||||
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
||||||
_lt_result=$?
|
_lt_result=$?
|
||||||
if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
|
if test -s conftest.err && $GREP force_load conftest.err; then
|
||||||
|
cat conftest.err >&AS_MESSAGE_LOG_FD
|
||||||
|
elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
|
||||||
lt_cv_ld_force_load=yes
|
lt_cv_ld_force_load=yes
|
||||||
else
|
else
|
||||||
cat conftest.err >&AS_MESSAGE_LOG_FD
|
cat conftest.err >&AS_MESSAGE_LOG_FD
|
||||||
@@ -1035,8 +1077,8 @@ _LT_EOF
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# _LT_DARWIN_LINKER_FEATURES
|
# _LT_DARWIN_LINKER_FEATURES([TAG])
|
||||||
# --------------------------
|
# ---------------------------------
|
||||||
# Checks for linker and compiler features on darwin
|
# Checks for linker and compiler features on darwin
|
||||||
m4_defun([_LT_DARWIN_LINKER_FEATURES],
|
m4_defun([_LT_DARWIN_LINKER_FEATURES],
|
||||||
[
|
[
|
||||||
@@ -1047,6 +1089,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
|
|||||||
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
|
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
|
||||||
if test "$lt_cv_ld_force_load" = "yes"; then
|
if test "$lt_cv_ld_force_load" = "yes"; then
|
||||||
_LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
|
_LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
|
||||||
|
m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
|
||||||
|
[FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
|
||||||
else
|
else
|
||||||
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
|
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
|
||||||
fi
|
fi
|
||||||
@@ -1330,14 +1374,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
|||||||
CFLAGS="$SAVE_CFLAGS"
|
CFLAGS="$SAVE_CFLAGS"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
sparc*-*solaris*)
|
*-*solaris*)
|
||||||
# Find out which ABI we are using.
|
# Find out which ABI we are using.
|
||||||
echo 'int i;' > conftest.$ac_ext
|
echo 'int i;' > conftest.$ac_ext
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
if AC_TRY_EVAL(ac_compile); then
|
||||||
case `/usr/bin/file conftest.o` in
|
case `/usr/bin/file conftest.o` in
|
||||||
*64-bit*)
|
*64-bit*)
|
||||||
case $lt_cv_prog_gnu_ld in
|
case $lt_cv_prog_gnu_ld in
|
||||||
yes*) LD="${LD-ld} -m elf64_sparc" ;;
|
yes*)
|
||||||
|
case $host in
|
||||||
|
i?86-*-solaris*)
|
||||||
|
LD="${LD-ld} -m elf_x86_64"
|
||||||
|
;;
|
||||||
|
sparc*-*-solaris*)
|
||||||
|
LD="${LD-ld} -m elf64_sparc"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# GNU ld 2.21 introduced _sol2 emulations. Use them if available.
|
||||||
|
if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
|
||||||
|
LD="${LD-ld}_sol2"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
|
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
|
||||||
LD="${LD-ld} -64"
|
LD="${LD-ld} -64"
|
||||||
@@ -1414,13 +1471,13 @@ old_postuninstall_cmds=
|
|||||||
if test -n "$RANLIB"; then
|
if test -n "$RANLIB"; then
|
||||||
case $host_os in
|
case $host_os in
|
||||||
openbsd*)
|
openbsd*)
|
||||||
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
|
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
|
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
|
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $host_os in
|
case $host_os in
|
||||||
@@ -1600,6 +1657,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
|
|||||||
lt_cv_sys_max_cmd_len=196608
|
lt_cv_sys_max_cmd_len=196608
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
os2*)
|
||||||
|
# The test takes a long time on OS/2.
|
||||||
|
lt_cv_sys_max_cmd_len=8192
|
||||||
|
;;
|
||||||
|
|
||||||
osf*)
|
osf*)
|
||||||
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
|
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
|
||||||
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
|
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
|
||||||
@@ -1639,7 +1701,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
|
|||||||
# If test is not a shell built-in, we'll probably end up computing a
|
# If test is not a shell built-in, we'll probably end up computing a
|
||||||
# maximum length that is only half of the actual maximum length, but
|
# maximum length that is only half of the actual maximum length, but
|
||||||
# we can't tell.
|
# we can't tell.
|
||||||
while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
|
while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
|
||||||
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
|
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
|
||||||
test $i != 17 # 1/2 MB should be enough
|
test $i != 17 # 1/2 MB should be enough
|
||||||
do
|
do
|
||||||
@@ -2185,7 +2247,7 @@ need_version=unknown
|
|||||||
|
|
||||||
case $host_os in
|
case $host_os in
|
||||||
aix3*)
|
aix3*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
|
||||||
shlibpath_var=LIBPATH
|
shlibpath_var=LIBPATH
|
||||||
|
|
||||||
@@ -2194,7 +2256,7 @@ aix3*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
aix[[4-9]]*)
|
aix[[4-9]]*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
hardcode_into_libs=yes
|
hardcode_into_libs=yes
|
||||||
@@ -2259,7 +2321,7 @@ beos*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
bsdi[[45]]*)
|
bsdi[[45]]*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
@@ -2398,7 +2460,7 @@ m4_if([$1], [],[
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
dgux*)
|
dgux*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
|
||||||
@@ -2451,17 +2513,18 @@ freebsd* | dragonfly*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
gnu*)
|
gnu*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
|
shlibpath_overrides_runpath=no
|
||||||
hardcode_into_libs=yes
|
hardcode_into_libs=yes
|
||||||
;;
|
;;
|
||||||
|
|
||||||
haiku*)
|
haiku*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
dynamic_linker="$host_os runtime_loader"
|
dynamic_linker="$host_os runtime_loader"
|
||||||
@@ -2522,7 +2585,7 @@ hpux9* | hpux10* | hpux11*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
interix[[3-9]]*)
|
interix[[3-9]]*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
|
||||||
@@ -2538,7 +2601,7 @@ irix5* | irix6* | nonstopux*)
|
|||||||
nonstopux*) version_type=nonstopux ;;
|
nonstopux*) version_type=nonstopux ;;
|
||||||
*)
|
*)
|
||||||
if test "$lt_cv_prog_gnu_ld" = yes; then
|
if test "$lt_cv_prog_gnu_ld" = yes; then
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
else
|
else
|
||||||
version_type=irix
|
version_type=irix
|
||||||
fi ;;
|
fi ;;
|
||||||
@@ -2575,9 +2638,9 @@ linux*oldld* | linux*aout* | linux*coff*)
|
|||||||
dynamic_linker=no
|
dynamic_linker=no
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# This must be Linux ELF.
|
# This must be glibc/ELF.
|
||||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
@@ -2640,7 +2703,7 @@ netbsd*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
newsos6)
|
newsos6)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
shlibpath_overrides_runpath=yes
|
shlibpath_overrides_runpath=yes
|
||||||
@@ -2709,7 +2772,7 @@ rdos*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
solaris*)
|
solaris*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
@@ -2734,7 +2797,7 @@ sunos4*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
sysv4 | sysv4.3*)
|
sysv4 | sysv4.3*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
@@ -2758,7 +2821,7 @@ sysv4 | sysv4.3*)
|
|||||||
|
|
||||||
sysv4*MP*)
|
sysv4*MP*)
|
||||||
if test -d /usr/nec ;then
|
if test -d /usr/nec ;then
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
|
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
|
||||||
soname_spec='$libname${shared_ext}.$major'
|
soname_spec='$libname${shared_ext}.$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
@@ -2789,7 +2852,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
|||||||
|
|
||||||
tpf*)
|
tpf*)
|
||||||
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
|
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
@@ -2799,7 +2862,7 @@ tpf*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
uts4*)
|
uts4*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
@@ -3221,7 +3284,7 @@ irix5* | irix6* | nonstopux*)
|
|||||||
lt_cv_deplibs_check_method=pass_all
|
lt_cv_deplibs_check_method=pass_all
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# This must be Linux ELF.
|
# This must be glibc/ELF.
|
||||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||||
lt_cv_deplibs_check_method=pass_all
|
lt_cv_deplibs_check_method=pass_all
|
||||||
;;
|
;;
|
||||||
@@ -3641,6 +3704,7 @@ for ac_symprfx in "" "_"; do
|
|||||||
# which start with @ or ?.
|
# which start with @ or ?.
|
||||||
lt_cv_sys_global_symbol_pipe="$AWK ['"\
|
lt_cv_sys_global_symbol_pipe="$AWK ['"\
|
||||||
" {last_section=section; section=\$ 3};"\
|
" {last_section=section; section=\$ 3};"\
|
||||||
|
" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
|
||||||
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
|
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
|
||||||
" \$ 0!~/External *\|/{next};"\
|
" \$ 0!~/External *\|/{next};"\
|
||||||
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
|
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
|
||||||
@@ -4225,7 +4289,9 @@ m4_if([$1], [CXX], [
|
|||||||
case $cc_basename in
|
case $cc_basename in
|
||||||
nvcc*) # Cuda Compiler Driver 2.2
|
nvcc*) # Cuda Compiler Driver 2.2
|
||||||
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
|
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
|
||||||
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
|
if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
@@ -4317,18 +4383,33 @@ m4_if([$1], [CXX], [
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case `$CC -V 2>&1 | sed 5q` in
|
case `$CC -V 2>&1 | sed 5q` in
|
||||||
*Sun\ F* | *Sun*Fortran*)
|
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
|
||||||
# Sun Fortran 8.3 passes all unrecognized flags to the linker
|
# Sun Fortran 8.3 passes all unrecognized flags to the linker
|
||||||
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
||||||
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
|
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
|
||||||
_LT_TAGVAR(lt_prog_compiler_wl, $1)=''
|
_LT_TAGVAR(lt_prog_compiler_wl, $1)=''
|
||||||
;;
|
;;
|
||||||
|
*Sun\ F* | *Sun*Fortran*)
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
|
||||||
|
;;
|
||||||
*Sun\ C*)
|
*Sun\ C*)
|
||||||
# Sun C 5.9
|
# Sun C 5.9
|
||||||
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
|
||||||
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
|
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
|
||||||
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
|
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
|
||||||
;;
|
;;
|
||||||
|
*Intel*\ [[CF]]*Compiler*)
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
|
||||||
|
;;
|
||||||
|
*Portland\ Group*)
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
|
||||||
|
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -4488,7 +4569,9 @@ m4_if([$1], [CXX], [
|
|||||||
;;
|
;;
|
||||||
cygwin* | mingw* | cegcc*)
|
cygwin* | mingw* | cegcc*)
|
||||||
case $cc_basename in
|
case $cc_basename in
|
||||||
cl*) ;;
|
cl*)
|
||||||
|
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
|
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
|
||||||
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
|
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
|
||||||
@@ -4513,7 +4596,6 @@ m4_if([$1], [CXX], [
|
|||||||
_LT_TAGVAR(hardcode_direct, $1)=no
|
_LT_TAGVAR(hardcode_direct, $1)=no
|
||||||
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
|
|
||||||
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
||||||
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
||||||
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
|
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
|
||||||
@@ -4764,8 +4846,7 @@ _LT_EOF
|
|||||||
xlf* | bgf* | bgxlf* | mpixlf*)
|
xlf* | bgf* | bgxlf* | mpixlf*)
|
||||||
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
|
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
|
||||||
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
|
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
|
|
||||||
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
|
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
|
||||||
if test "x$supports_anon_versioning" = xyes; then
|
if test "x$supports_anon_versioning" = xyes; then
|
||||||
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
|
||||||
@@ -5060,6 +5141,7 @@ _LT_EOF
|
|||||||
# The linker will not automatically build a static lib if we build a DLL.
|
# The linker will not automatically build a static lib if we build a DLL.
|
||||||
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
|
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
|
||||||
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
|
||||||
|
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
|
||||||
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
|
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
|
||||||
# Don't use ranlib
|
# Don't use ranlib
|
||||||
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
|
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
|
||||||
@@ -5157,7 +5239,6 @@ _LT_EOF
|
|||||||
fi
|
fi
|
||||||
if test "$with_gnu_ld" = no; then
|
if test "$with_gnu_ld" = no; then
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
|
|
||||||
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
|
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
|
||||||
_LT_TAGVAR(hardcode_direct, $1)=yes
|
_LT_TAGVAR(hardcode_direct, $1)=yes
|
||||||
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
|
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
|
||||||
@@ -5599,9 +5680,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
|
|||||||
_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
|
_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
|
||||||
[Flag to hardcode $libdir into a binary during linking.
|
[Flag to hardcode $libdir into a binary during linking.
|
||||||
This must work even if $libdir does not exist])
|
This must work even if $libdir does not exist])
|
||||||
_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
|
|
||||||
[[If ld is used when linking, flag to hardcode $libdir into a binary
|
|
||||||
during linking. This must work even if $libdir does not exist]])
|
|
||||||
_LT_TAGDECL([], [hardcode_libdir_separator], [1],
|
_LT_TAGDECL([], [hardcode_libdir_separator], [1],
|
||||||
[Whether we need a single "-rpath" flag with a separated argument])
|
[Whether we need a single "-rpath" flag with a separated argument])
|
||||||
_LT_TAGDECL([], [hardcode_direct], [0],
|
_LT_TAGDECL([], [hardcode_direct], [0],
|
||||||
@@ -5759,7 +5837,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
|
|||||||
_LT_TAGVAR(hardcode_direct, $1)=no
|
_LT_TAGVAR(hardcode_direct, $1)=no
|
||||||
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
|
|
||||||
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
||||||
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
||||||
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
|
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
|
||||||
@@ -6890,12 +6967,18 @@ public class foo {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
_LT_EOF
|
_LT_EOF
|
||||||
|
], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
|
||||||
|
package foo
|
||||||
|
func foo() {
|
||||||
|
}
|
||||||
|
_LT_EOF
|
||||||
])
|
])
|
||||||
|
|
||||||
_lt_libdeps_save_CFLAGS=$CFLAGS
|
_lt_libdeps_save_CFLAGS=$CFLAGS
|
||||||
case "$CC $CFLAGS " in #(
|
case "$CC $CFLAGS " in #(
|
||||||
*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
|
*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
|
||||||
*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
|
*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
|
||||||
|
*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
dnl Parse the compiler output and extract the necessary
|
dnl Parse the compiler output and extract the necessary
|
||||||
@@ -7092,7 +7175,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
|
|||||||
_LT_TAGVAR(hardcode_direct, $1)=no
|
_LT_TAGVAR(hardcode_direct, $1)=no
|
||||||
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
|
|
||||||
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
||||||
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
||||||
_LT_TAGVAR(hardcode_automatic, $1)=no
|
_LT_TAGVAR(hardcode_automatic, $1)=no
|
||||||
@@ -7225,7 +7307,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
|
|||||||
_LT_TAGVAR(hardcode_direct, $1)=no
|
_LT_TAGVAR(hardcode_direct, $1)=no
|
||||||
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
|
||||||
_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
|
|
||||||
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
_LT_TAGVAR(hardcode_libdir_separator, $1)=
|
||||||
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
_LT_TAGVAR(hardcode_minus_L, $1)=no
|
||||||
_LT_TAGVAR(hardcode_automatic, $1)=no
|
_LT_TAGVAR(hardcode_automatic, $1)=no
|
||||||
@@ -7412,6 +7493,77 @@ CFLAGS=$lt_save_CFLAGS
|
|||||||
])# _LT_LANG_GCJ_CONFIG
|
])# _LT_LANG_GCJ_CONFIG
|
||||||
|
|
||||||
|
|
||||||
|
# _LT_LANG_GO_CONFIG([TAG])
|
||||||
|
# --------------------------
|
||||||
|
# Ensure that the configuration variables for the GNU Go compiler
|
||||||
|
# are suitably defined. These variables are subsequently used by _LT_CONFIG
|
||||||
|
# to write the compiler configuration to `libtool'.
|
||||||
|
m4_defun([_LT_LANG_GO_CONFIG],
|
||||||
|
[AC_REQUIRE([LT_PROG_GO])dnl
|
||||||
|
AC_LANG_SAVE
|
||||||
|
|
||||||
|
# Source file extension for Go test sources.
|
||||||
|
ac_ext=go
|
||||||
|
|
||||||
|
# Object file extension for compiled Go test sources.
|
||||||
|
objext=o
|
||||||
|
_LT_TAGVAR(objext, $1)=$objext
|
||||||
|
|
||||||
|
# Code to be used in simple compile tests
|
||||||
|
lt_simple_compile_test_code="package main; func main() { }"
|
||||||
|
|
||||||
|
# Code to be used in simple link tests
|
||||||
|
lt_simple_link_test_code='package main; func main() { }'
|
||||||
|
|
||||||
|
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
|
||||||
|
_LT_TAG_COMPILER
|
||||||
|
|
||||||
|
# save warnings/boilerplate of simple test code
|
||||||
|
_LT_COMPILER_BOILERPLATE
|
||||||
|
_LT_LINKER_BOILERPLATE
|
||||||
|
|
||||||
|
# Allow CC to be a program name with arguments.
|
||||||
|
lt_save_CC=$CC
|
||||||
|
lt_save_CFLAGS=$CFLAGS
|
||||||
|
lt_save_GCC=$GCC
|
||||||
|
GCC=yes
|
||||||
|
CC=${GOC-"gccgo"}
|
||||||
|
CFLAGS=$GOFLAGS
|
||||||
|
compiler=$CC
|
||||||
|
_LT_TAGVAR(compiler, $1)=$CC
|
||||||
|
_LT_TAGVAR(LD, $1)="$LD"
|
||||||
|
_LT_CC_BASENAME([$compiler])
|
||||||
|
|
||||||
|
# Go did not exist at the time GCC didn't implicitly link libc in.
|
||||||
|
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
|
||||||
|
|
||||||
|
_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
|
||||||
|
_LT_TAGVAR(reload_flag, $1)=$reload_flag
|
||||||
|
_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
|
||||||
|
|
||||||
|
## CAVEAT EMPTOR:
|
||||||
|
## There is no encapsulation within the following macros, do not change
|
||||||
|
## the running order or otherwise move them around unless you know exactly
|
||||||
|
## what you are doing...
|
||||||
|
if test -n "$compiler"; then
|
||||||
|
_LT_COMPILER_NO_RTTI($1)
|
||||||
|
_LT_COMPILER_PIC($1)
|
||||||
|
_LT_COMPILER_C_O($1)
|
||||||
|
_LT_COMPILER_FILE_LOCKS($1)
|
||||||
|
_LT_LINKER_SHLIBS($1)
|
||||||
|
_LT_LINKER_HARDCODE_LIBPATH($1)
|
||||||
|
|
||||||
|
_LT_CONFIG($1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
|
||||||
|
GCC=$lt_save_GCC
|
||||||
|
CC=$lt_save_CC
|
||||||
|
CFLAGS=$lt_save_CFLAGS
|
||||||
|
])# _LT_LANG_GO_CONFIG
|
||||||
|
|
||||||
|
|
||||||
# _LT_LANG_RC_CONFIG([TAG])
|
# _LT_LANG_RC_CONFIG([TAG])
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Ensure that the configuration variables for the Windows resource compiler
|
# Ensure that the configuration variables for the Windows resource compiler
|
||||||
@@ -7481,6 +7633,13 @@ dnl aclocal-1.4 backwards compatibility:
|
|||||||
dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
|
dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
|
||||||
|
|
||||||
|
|
||||||
|
# LT_PROG_GO
|
||||||
|
# ----------
|
||||||
|
AC_DEFUN([LT_PROG_GO],
|
||||||
|
[AC_CHECK_TOOL(GOC, gccgo,)
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
# LT_PROG_RC
|
# LT_PROG_RC
|
||||||
# ----------
|
# ----------
|
||||||
AC_DEFUN([LT_PROG_RC],
|
AC_DEFUN([LT_PROG_RC],
|
||||||
|
|||||||
81
config/ltmain.sh
Executable file → Normal file
81
config/ltmain.sh
Executable file → Normal file
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
# libtool (GNU libtool) 2.4
|
# libtool (GNU libtool) 2.4.2
|
||||||
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||||
|
|
||||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
|
||||||
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||||
# This is free software; see the source for copying conditions. There is NO
|
# This is free software; see the source for copying conditions. There is NO
|
||||||
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
# --quiet, --silent don't print informational messages
|
# --quiet, --silent don't print informational messages
|
||||||
# --no-quiet, --no-silent
|
# --no-quiet, --no-silent
|
||||||
# print informational messages (default)
|
# print informational messages (default)
|
||||||
|
# --no-warn don't display warning messages
|
||||||
# --tag=TAG use configuration variables from tag TAG
|
# --tag=TAG use configuration variables from tag TAG
|
||||||
# -v, --verbose print more informational messages than default
|
# -v, --verbose print more informational messages than default
|
||||||
# --no-verbose don't print the extra informational messages
|
# --no-verbose don't print the extra informational messages
|
||||||
@@ -69,7 +70,7 @@
|
|||||||
# compiler: $LTCC
|
# compiler: $LTCC
|
||||||
# compiler flags: $LTCFLAGS
|
# compiler flags: $LTCFLAGS
|
||||||
# linker: $LD (gnu? $with_gnu_ld)
|
# linker: $LD (gnu? $with_gnu_ld)
|
||||||
# $progname: (GNU libtool) 2.4
|
# $progname: (GNU libtool) 2.4.2
|
||||||
# automake: $automake_version
|
# automake: $automake_version
|
||||||
# autoconf: $autoconf_version
|
# autoconf: $autoconf_version
|
||||||
#
|
#
|
||||||
@@ -79,9 +80,9 @@
|
|||||||
|
|
||||||
PROGRAM=libtool
|
PROGRAM=libtool
|
||||||
PACKAGE=libtool
|
PACKAGE=libtool
|
||||||
VERSION=2.4
|
VERSION=2.4.2
|
||||||
TIMESTAMP=""
|
TIMESTAMP=""
|
||||||
package_revision=1.3293
|
package_revision=1.3337
|
||||||
|
|
||||||
# Be Bourne compatible
|
# Be Bourne compatible
|
||||||
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
||||||
@@ -136,15 +137,10 @@ progpath="$0"
|
|||||||
|
|
||||||
: ${CP="cp -f"}
|
: ${CP="cp -f"}
|
||||||
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
|
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
|
||||||
: ${EGREP="grep -E"}
|
|
||||||
: ${FGREP="grep -F"}
|
|
||||||
: ${GREP="grep"}
|
|
||||||
: ${LN_S="ln -s"}
|
|
||||||
: ${MAKE="make"}
|
: ${MAKE="make"}
|
||||||
: ${MKDIR="mkdir"}
|
: ${MKDIR="mkdir"}
|
||||||
: ${MV="mv -f"}
|
: ${MV="mv -f"}
|
||||||
: ${RM="rm -f"}
|
: ${RM="rm -f"}
|
||||||
: ${SED="sed"}
|
|
||||||
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
|
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
|
||||||
: ${Xsed="$SED -e 1s/^X//"}
|
: ${Xsed="$SED -e 1s/^X//"}
|
||||||
|
|
||||||
@@ -387,7 +383,7 @@ case $progpath in
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
save_IFS="$IFS"
|
save_IFS="$IFS"
|
||||||
IFS=:
|
IFS=${PATH_SEPARATOR-:}
|
||||||
for progdir in $PATH; do
|
for progdir in $PATH; do
|
||||||
IFS="$save_IFS"
|
IFS="$save_IFS"
|
||||||
test -x "$progdir/$progname" && break
|
test -x "$progdir/$progname" && break
|
||||||
@@ -771,8 +767,8 @@ func_help ()
|
|||||||
s*\$LTCFLAGS*'"$LTCFLAGS"'*
|
s*\$LTCFLAGS*'"$LTCFLAGS"'*
|
||||||
s*\$LD*'"$LD"'*
|
s*\$LD*'"$LD"'*
|
||||||
s/\$with_gnu_ld/'"$with_gnu_ld"'/
|
s/\$with_gnu_ld/'"$with_gnu_ld"'/
|
||||||
s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
|
s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
|
||||||
s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
|
s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
|
||||||
p
|
p
|
||||||
d
|
d
|
||||||
}
|
}
|
||||||
@@ -1052,6 +1048,7 @@ opt_finish=false
|
|||||||
opt_help=false
|
opt_help=false
|
||||||
opt_help_all=false
|
opt_help_all=false
|
||||||
opt_silent=:
|
opt_silent=:
|
||||||
|
opt_warning=:
|
||||||
opt_verbose=:
|
opt_verbose=:
|
||||||
opt_silent=false
|
opt_silent=false
|
||||||
opt_verbose=false
|
opt_verbose=false
|
||||||
@@ -1118,6 +1115,10 @@ esac
|
|||||||
;;
|
;;
|
||||||
--no-silent|--no-quiet)
|
--no-silent|--no-quiet)
|
||||||
opt_silent=false
|
opt_silent=false
|
||||||
|
func_append preserve_args " $opt"
|
||||||
|
;;
|
||||||
|
--no-warning|--no-warn)
|
||||||
|
opt_warning=false
|
||||||
func_append preserve_args " $opt"
|
func_append preserve_args " $opt"
|
||||||
;;
|
;;
|
||||||
--no-verbose)
|
--no-verbose)
|
||||||
@@ -2089,7 +2090,7 @@ func_mode_compile ()
|
|||||||
*.[cCFSifmso] | \
|
*.[cCFSifmso] | \
|
||||||
*.ada | *.adb | *.ads | *.asm | \
|
*.ada | *.adb | *.ads | *.asm | \
|
||||||
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
|
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
|
||||||
*.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
|
*.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
|
||||||
func_xform "$libobj"
|
func_xform "$libobj"
|
||||||
libobj=$func_xform_result
|
libobj=$func_xform_result
|
||||||
;;
|
;;
|
||||||
@@ -3231,11 +3232,13 @@ func_mode_install ()
|
|||||||
|
|
||||||
# Set up the ranlib parameters.
|
# Set up the ranlib parameters.
|
||||||
oldlib="$destdir/$name"
|
oldlib="$destdir/$name"
|
||||||
|
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
|
||||||
|
tool_oldlib=$func_to_tool_file_result
|
||||||
|
|
||||||
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
|
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
|
||||||
|
|
||||||
if test -n "$stripme" && test -n "$old_striplib"; then
|
if test -n "$stripme" && test -n "$old_striplib"; then
|
||||||
func_show_eval "$old_striplib $oldlib" 'exit $?'
|
func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Do each command in the postinstall commands.
|
# Do each command in the postinstall commands.
|
||||||
@@ -3500,7 +3503,7 @@ static const void *lt_preloaded_setup() {
|
|||||||
# linked before any other PIC object. But we must not use
|
# linked before any other PIC object. But we must not use
|
||||||
# pic_flag when linking with -static. The problem exists in
|
# pic_flag when linking with -static. The problem exists in
|
||||||
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
|
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
|
||||||
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
|
*-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
|
||||||
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
|
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
|
||||||
*-*-hpux*)
|
*-*-hpux*)
|
||||||
pic_flag_for_symtable=" $pic_flag" ;;
|
pic_flag_for_symtable=" $pic_flag" ;;
|
||||||
@@ -4015,6 +4018,8 @@ func_exec_program_core ()
|
|||||||
# launches target application with the remaining arguments.
|
# launches target application with the remaining arguments.
|
||||||
func_exec_program ()
|
func_exec_program ()
|
||||||
{
|
{
|
||||||
|
case \" \$* \" in
|
||||||
|
*\\ --lt-*)
|
||||||
for lt_wr_arg
|
for lt_wr_arg
|
||||||
do
|
do
|
||||||
case \$lt_wr_arg in
|
case \$lt_wr_arg in
|
||||||
@@ -4022,7 +4027,8 @@ func_exec_program ()
|
|||||||
*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
|
*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done ;;
|
||||||
|
esac
|
||||||
func_exec_program_core \${1+\"\$@\"}
|
func_exec_program_core \${1+\"\$@\"}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5090,9 +5096,15 @@ void lt_dump_script (FILE* f)
|
|||||||
{
|
{
|
||||||
EOF
|
EOF
|
||||||
func_emit_wrapper yes |
|
func_emit_wrapper yes |
|
||||||
$SED -e 's/\([\\"]\)/\\\1/g' \
|
$SED -n -e '
|
||||||
-e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
|
s/^\(.\{79\}\)\(..*\)/\1\
|
||||||
|
\2/
|
||||||
|
h
|
||||||
|
s/\([\\"]\)/\\\1/g
|
||||||
|
s/$/\\n/
|
||||||
|
s/\([^\n]*\).*/ fputs ("\1", f);/p
|
||||||
|
g
|
||||||
|
D'
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
@@ -5677,7 +5689,8 @@ func_mode_link ()
|
|||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
|
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|
||||||
|
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||||
func_append compiler_flags " $arg"
|
func_append compiler_flags " $arg"
|
||||||
func_append compile_command " $arg"
|
func_append compile_command " $arg"
|
||||||
func_append finalize_command " $arg"
|
func_append finalize_command " $arg"
|
||||||
@@ -6181,7 +6194,8 @@ func_mode_link ()
|
|||||||
lib=
|
lib=
|
||||||
found=no
|
found=no
|
||||||
case $deplib in
|
case $deplib in
|
||||||
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
|
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|
||||||
|
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
||||||
if test "$linkmode,$pass" = "prog,link"; then
|
if test "$linkmode,$pass" = "prog,link"; then
|
||||||
compile_deplibs="$deplib $compile_deplibs"
|
compile_deplibs="$deplib $compile_deplibs"
|
||||||
finalize_deplibs="$deplib $finalize_deplibs"
|
finalize_deplibs="$deplib $finalize_deplibs"
|
||||||
@@ -6882,7 +6896,7 @@ func_mode_link ()
|
|||||||
test "$hardcode_direct_absolute" = no; then
|
test "$hardcode_direct_absolute" = no; then
|
||||||
add="$dir/$linklib"
|
add="$dir/$linklib"
|
||||||
elif test "$hardcode_minus_L" = yes; then
|
elif test "$hardcode_minus_L" = yes; then
|
||||||
add_dir="-L$dir"
|
add_dir="-L$absdir"
|
||||||
# Try looking first in the location we're being installed to.
|
# Try looking first in the location we're being installed to.
|
||||||
if test -n "$inst_prefix_dir"; then
|
if test -n "$inst_prefix_dir"; then
|
||||||
case $libdir in
|
case $libdir in
|
||||||
@@ -7367,6 +7381,7 @@ func_mode_link ()
|
|||||||
# which has an extra 1 added just for fun
|
# which has an extra 1 added just for fun
|
||||||
#
|
#
|
||||||
case $version_type in
|
case $version_type in
|
||||||
|
# correct linux to gnu/linux during the next big refactor
|
||||||
darwin|linux|osf|windows|none)
|
darwin|linux|osf|windows|none)
|
||||||
func_arith $number_major + $number_minor
|
func_arith $number_major + $number_minor
|
||||||
current=$func_arith_result
|
current=$func_arith_result
|
||||||
@@ -7483,7 +7498,7 @@ func_mode_link ()
|
|||||||
versuffix="$major.$revision"
|
versuffix="$major.$revision"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
linux)
|
linux) # correct to gnu/linux during the next big refactor
|
||||||
func_arith $current - $age
|
func_arith $current - $age
|
||||||
major=.$func_arith_result
|
major=.$func_arith_result
|
||||||
versuffix="$major.$age.$revision"
|
versuffix="$major.$age.$revision"
|
||||||
@@ -8071,6 +8086,11 @@ EOF
|
|||||||
|
|
||||||
# Test again, we may have decided not to build it any more
|
# Test again, we may have decided not to build it any more
|
||||||
if test "$build_libtool_libs" = yes; then
|
if test "$build_libtool_libs" = yes; then
|
||||||
|
# Remove ${wl} instances when linking with ld.
|
||||||
|
# FIXME: should test the right _cmds variable.
|
||||||
|
case $archive_cmds in
|
||||||
|
*\$LD\ *) wl= ;;
|
||||||
|
esac
|
||||||
if test "$hardcode_into_libs" = yes; then
|
if test "$hardcode_into_libs" = yes; then
|
||||||
# Hardcode the library paths
|
# Hardcode the library paths
|
||||||
hardcode_libdirs=
|
hardcode_libdirs=
|
||||||
@@ -8101,7 +8121,7 @@ EOF
|
|||||||
elif test -n "$runpath_var"; then
|
elif test -n "$runpath_var"; then
|
||||||
case "$perm_rpath " in
|
case "$perm_rpath " in
|
||||||
*" $libdir "*) ;;
|
*" $libdir "*) ;;
|
||||||
*) func_apped perm_rpath " $libdir" ;;
|
*) func_append perm_rpath " $libdir" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -8109,11 +8129,7 @@ EOF
|
|||||||
if test -n "$hardcode_libdir_separator" &&
|
if test -n "$hardcode_libdir_separator" &&
|
||||||
test -n "$hardcode_libdirs"; then
|
test -n "$hardcode_libdirs"; then
|
||||||
libdir="$hardcode_libdirs"
|
libdir="$hardcode_libdirs"
|
||||||
if test -n "$hardcode_libdir_flag_spec_ld"; then
|
eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
|
||||||
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
|
|
||||||
else
|
|
||||||
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if test -n "$runpath_var" && test -n "$perm_rpath"; then
|
if test -n "$runpath_var" && test -n "$perm_rpath"; then
|
||||||
# We should set the runpath_var.
|
# We should set the runpath_var.
|
||||||
@@ -9203,6 +9219,8 @@ EOF
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
|
||||||
|
tool_oldlib=$func_to_tool_file_result
|
||||||
eval cmds=\"$old_archive_cmds\"
|
eval cmds=\"$old_archive_cmds\"
|
||||||
|
|
||||||
func_len " $cmds"
|
func_len " $cmds"
|
||||||
@@ -9312,7 +9330,8 @@ EOF
|
|||||||
*.la)
|
*.la)
|
||||||
func_basename "$deplib"
|
func_basename "$deplib"
|
||||||
name="$func_basename_result"
|
name="$func_basename_result"
|
||||||
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
|
func_resolve_sysroot "$deplib"
|
||||||
|
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
|
||||||
test -z "$libdir" && \
|
test -z "$libdir" && \
|
||||||
func_fatal_error "\`$deplib' is not a valid libtool archive"
|
func_fatal_error "\`$deplib' is not a valid libtool archive"
|
||||||
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
|
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
|
||||||
|
|||||||
19
config/ltoptions.m4
vendored
19
config/ltoptions.m4
vendored
@@ -326,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
|||||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||||
m4_define([_LT_WITH_PIC],
|
m4_define([_LT_WITH_PIC],
|
||||||
[AC_ARG_WITH([pic],
|
[AC_ARG_WITH([pic],
|
||||||
[AS_HELP_STRING([--with-pic],
|
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||||
[pic_mode="$withval"],
|
[lt_p=${PACKAGE-default}
|
||||||
|
case $withval in
|
||||||
|
yes|no) pic_mode=$withval ;;
|
||||||
|
*)
|
||||||
|
pic_mode=default
|
||||||
|
# Look at the argument we got. We use all the common list separators.
|
||||||
|
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||||
|
for lt_pkg in $withval; do
|
||||||
|
IFS="$lt_save_ifs"
|
||||||
|
if test "X$lt_pkg" = "X$lt_p"; then
|
||||||
|
pic_mode=yes
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
IFS="$lt_save_ifs"
|
||||||
|
;;
|
||||||
|
esac],
|
||||||
[pic_mode=default])
|
[pic_mode=default])
|
||||||
|
|
||||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||||
|
|||||||
10
config/ltversion.m4
vendored
10
config/ltversion.m4
vendored
@@ -9,15 +9,15 @@
|
|||||||
|
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# serial 3293 ltversion.m4
|
# serial 3337 ltversion.m4
|
||||||
# This file is part of GNU Libtool
|
# This file is part of GNU Libtool
|
||||||
|
|
||||||
m4_define([LT_PACKAGE_VERSION], [2.4])
|
m4_define([LT_PACKAGE_VERSION], [2.4.2])
|
||||||
m4_define([LT_PACKAGE_REVISION], [1.3293])
|
m4_define([LT_PACKAGE_REVISION], [1.3337])
|
||||||
|
|
||||||
AC_DEFUN([LTVERSION_VERSION],
|
AC_DEFUN([LTVERSION_VERSION],
|
||||||
[macro_version='2.4'
|
[macro_version='2.4.2'
|
||||||
macro_revision='1.3293'
|
macro_revision='1.3337'
|
||||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||||
_LT_DECL(, macro_revision, 0)
|
_LT_DECL(, macro_revision, 0)
|
||||||
])
|
])
|
||||||
|
|||||||
160
configure
vendored
160
configure
vendored
@@ -1395,7 +1395,7 @@ Optional Features:
|
|||||||
Optional Packages:
|
Optional Packages:
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
||||||
--with-pic try to use only PIC/non-PIC objects [default=use
|
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
|
||||||
both]
|
both]
|
||||||
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
|
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
|
||||||
--with-sysroot=DIR Search for dependent libraries within DIR
|
--with-sysroot=DIR Search for dependent libraries within DIR
|
||||||
@@ -2783,8 +2783,8 @@ esac
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
macro_version='2.4'
|
macro_version='2.4.2'
|
||||||
macro_revision='1.3293'
|
macro_revision='1.3337'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -4609,6 +4609,11 @@ else
|
|||||||
lt_cv_sys_max_cmd_len=196608
|
lt_cv_sys_max_cmd_len=196608
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
os2*)
|
||||||
|
# The test takes a long time on OS/2.
|
||||||
|
lt_cv_sys_max_cmd_len=8192
|
||||||
|
;;
|
||||||
|
|
||||||
osf*)
|
osf*)
|
||||||
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
|
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
|
||||||
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
|
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
|
||||||
@@ -4648,7 +4653,7 @@ else
|
|||||||
# If test is not a shell built-in, we'll probably end up computing a
|
# If test is not a shell built-in, we'll probably end up computing a
|
||||||
# maximum length that is only half of the actual maximum length, but
|
# maximum length that is only half of the actual maximum length, but
|
||||||
# we can't tell.
|
# we can't tell.
|
||||||
while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
|
while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
|
||||||
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
|
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
|
||||||
test $i != 17 # 1/2 MB should be enough
|
test $i != 17 # 1/2 MB should be enough
|
||||||
do
|
do
|
||||||
@@ -5077,7 +5082,7 @@ irix5* | irix6* | nonstopux*)
|
|||||||
lt_cv_deplibs_check_method=pass_all
|
lt_cv_deplibs_check_method=pass_all
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# This must be Linux ELF.
|
# This must be glibc/ELF.
|
||||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||||
lt_cv_deplibs_check_method=pass_all
|
lt_cv_deplibs_check_method=pass_all
|
||||||
;;
|
;;
|
||||||
@@ -5718,13 +5723,13 @@ old_postuninstall_cmds=
|
|||||||
if test -n "$RANLIB"; then
|
if test -n "$RANLIB"; then
|
||||||
case $host_os in
|
case $host_os in
|
||||||
openbsd*)
|
openbsd*)
|
||||||
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
|
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
|
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
|
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $host_os in
|
case $host_os in
|
||||||
@@ -5871,6 +5876,7 @@ for ac_symprfx in "" "_"; do
|
|||||||
# which start with @ or ?.
|
# which start with @ or ?.
|
||||||
lt_cv_sys_global_symbol_pipe="$AWK '"\
|
lt_cv_sys_global_symbol_pipe="$AWK '"\
|
||||||
" {last_section=section; section=\$ 3};"\
|
" {last_section=section; section=\$ 3};"\
|
||||||
|
" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
|
||||||
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
|
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
|
||||||
" \$ 0!~/External *\|/{next};"\
|
" \$ 0!~/External *\|/{next};"\
|
||||||
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
|
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
|
||||||
@@ -6259,7 +6265,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
|
|||||||
CFLAGS="$SAVE_CFLAGS"
|
CFLAGS="$SAVE_CFLAGS"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
sparc*-*solaris*)
|
*-*solaris*)
|
||||||
# Find out which ABI we are using.
|
# Find out which ABI we are using.
|
||||||
echo 'int i;' > conftest.$ac_ext
|
echo 'int i;' > conftest.$ac_ext
|
||||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
||||||
@@ -6270,7 +6276,20 @@ sparc*-*solaris*)
|
|||||||
case `/usr/bin/file conftest.o` in
|
case `/usr/bin/file conftest.o` in
|
||||||
*64-bit*)
|
*64-bit*)
|
||||||
case $lt_cv_prog_gnu_ld in
|
case $lt_cv_prog_gnu_ld in
|
||||||
yes*) LD="${LD-ld} -m elf64_sparc" ;;
|
yes*)
|
||||||
|
case $host in
|
||||||
|
i?86-*-solaris*)
|
||||||
|
LD="${LD-ld} -m elf_x86_64"
|
||||||
|
;;
|
||||||
|
sparc*-*-solaris*)
|
||||||
|
LD="${LD-ld} -m elf64_sparc"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# GNU ld 2.21 introduced _sol2 emulations. Use them if available.
|
||||||
|
if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
|
||||||
|
LD="${LD-ld}_sol2"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
|
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
|
||||||
LD="${LD-ld} -64"
|
LD="${LD-ld} -64"
|
||||||
@@ -6910,7 +6929,13 @@ else
|
|||||||
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
|
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
|
||||||
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
|
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
|
||||||
_lt_result=$?
|
_lt_result=$?
|
||||||
if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
|
# If there is a non-empty error log, and "single_module"
|
||||||
|
# appears in it, assume the flag caused a linker warning
|
||||||
|
if test -s conftest.err && $GREP single_module conftest.err; then
|
||||||
|
cat conftest.err >&5
|
||||||
|
# Otherwise, if the output was created with a 0 exit code from
|
||||||
|
# the compiler, it worked.
|
||||||
|
elif test -f libconftest.dylib && test $_lt_result -eq 0; then
|
||||||
lt_cv_apple_cc_single_mod=yes
|
lt_cv_apple_cc_single_mod=yes
|
||||||
else
|
else
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
@@ -6921,6 +6946,7 @@ else
|
|||||||
fi
|
fi
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
|
||||||
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
|
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
|
||||||
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
|
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
|
||||||
if ${lt_cv_ld_exported_symbols_list+:} false; then :
|
if ${lt_cv_ld_exported_symbols_list+:} false; then :
|
||||||
@@ -6953,6 +6979,7 @@ rm -f core conftest.err conftest.$ac_objext \
|
|||||||
fi
|
fi
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
|
||||||
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
|
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
|
||||||
$as_echo_n "checking for -force_load linker flag... " >&6; }
|
$as_echo_n "checking for -force_load linker flag... " >&6; }
|
||||||
if ${lt_cv_ld_force_load+:} false; then :
|
if ${lt_cv_ld_force_load+:} false; then :
|
||||||
@@ -6974,7 +7001,9 @@ _LT_EOF
|
|||||||
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
|
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
|
||||||
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
|
||||||
_lt_result=$?
|
_lt_result=$?
|
||||||
if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
|
if test -s conftest.err && $GREP force_load conftest.err; then
|
||||||
|
cat conftest.err >&5
|
||||||
|
elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
|
||||||
lt_cv_ld_force_load=yes
|
lt_cv_ld_force_load=yes
|
||||||
else
|
else
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
@@ -7379,7 +7408,22 @@ fi
|
|||||||
|
|
||||||
# Check whether --with-pic was given.
|
# Check whether --with-pic was given.
|
||||||
if test "${with_pic+set}" = set; then :
|
if test "${with_pic+set}" = set; then :
|
||||||
withval=$with_pic; pic_mode="$withval"
|
withval=$with_pic; lt_p=${PACKAGE-default}
|
||||||
|
case $withval in
|
||||||
|
yes|no) pic_mode=$withval ;;
|
||||||
|
*)
|
||||||
|
pic_mode=default
|
||||||
|
# Look at the argument we got. We use all the common list separators.
|
||||||
|
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||||
|
for lt_pkg in $withval; do
|
||||||
|
IFS="$lt_save_ifs"
|
||||||
|
if test "X$lt_pkg" = "X$lt_p"; then
|
||||||
|
pic_mode=yes
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
IFS="$lt_save_ifs"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
pic_mode=default
|
pic_mode=default
|
||||||
fi
|
fi
|
||||||
@@ -7452,6 +7496,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -7916,7 +7964,9 @@ lt_prog_compiler_static=
|
|||||||
case $cc_basename in
|
case $cc_basename in
|
||||||
nvcc*) # Cuda Compiler Driver 2.2
|
nvcc*) # Cuda Compiler Driver 2.2
|
||||||
lt_prog_compiler_wl='-Xlinker '
|
lt_prog_compiler_wl='-Xlinker '
|
||||||
lt_prog_compiler_pic='-Xcompiler -fPIC'
|
if test -n "$lt_prog_compiler_pic"; then
|
||||||
|
lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
@@ -8007,18 +8057,33 @@ lt_prog_compiler_static=
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case `$CC -V 2>&1 | sed 5q` in
|
case `$CC -V 2>&1 | sed 5q` in
|
||||||
*Sun\ F* | *Sun*Fortran*)
|
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
|
||||||
# Sun Fortran 8.3 passes all unrecognized flags to the linker
|
# Sun Fortran 8.3 passes all unrecognized flags to the linker
|
||||||
lt_prog_compiler_pic='-KPIC'
|
lt_prog_compiler_pic='-KPIC'
|
||||||
lt_prog_compiler_static='-Bstatic'
|
lt_prog_compiler_static='-Bstatic'
|
||||||
lt_prog_compiler_wl=''
|
lt_prog_compiler_wl=''
|
||||||
;;
|
;;
|
||||||
|
*Sun\ F* | *Sun*Fortran*)
|
||||||
|
lt_prog_compiler_pic='-KPIC'
|
||||||
|
lt_prog_compiler_static='-Bstatic'
|
||||||
|
lt_prog_compiler_wl='-Qoption ld '
|
||||||
|
;;
|
||||||
*Sun\ C*)
|
*Sun\ C*)
|
||||||
# Sun C 5.9
|
# Sun C 5.9
|
||||||
lt_prog_compiler_pic='-KPIC'
|
lt_prog_compiler_pic='-KPIC'
|
||||||
lt_prog_compiler_static='-Bstatic'
|
lt_prog_compiler_static='-Bstatic'
|
||||||
lt_prog_compiler_wl='-Wl,'
|
lt_prog_compiler_wl='-Wl,'
|
||||||
;;
|
;;
|
||||||
|
*Intel*\ [CF]*Compiler*)
|
||||||
|
lt_prog_compiler_wl='-Wl,'
|
||||||
|
lt_prog_compiler_pic='-fPIC'
|
||||||
|
lt_prog_compiler_static='-static'
|
||||||
|
;;
|
||||||
|
*Portland\ Group*)
|
||||||
|
lt_prog_compiler_wl='-Wl,'
|
||||||
|
lt_prog_compiler_pic='-fpic'
|
||||||
|
lt_prog_compiler_static='-Bstatic'
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -8380,7 +8445,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
|
|||||||
hardcode_direct=no
|
hardcode_direct=no
|
||||||
hardcode_direct_absolute=no
|
hardcode_direct_absolute=no
|
||||||
hardcode_libdir_flag_spec=
|
hardcode_libdir_flag_spec=
|
||||||
hardcode_libdir_flag_spec_ld=
|
|
||||||
hardcode_libdir_separator=
|
hardcode_libdir_separator=
|
||||||
hardcode_minus_L=no
|
hardcode_minus_L=no
|
||||||
hardcode_shlibpath_var=unsupported
|
hardcode_shlibpath_var=unsupported
|
||||||
@@ -8630,8 +8694,7 @@ _LT_EOF
|
|||||||
xlf* | bgf* | bgxlf* | mpixlf*)
|
xlf* | bgf* | bgxlf* | mpixlf*)
|
||||||
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
|
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
|
||||||
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
|
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
|
||||||
hardcode_libdir_flag_spec=
|
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||||
hardcode_libdir_flag_spec_ld='-rpath $libdir'
|
|
||||||
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
|
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
|
||||||
if test "x$supports_anon_versioning" = xyes; then
|
if test "x$supports_anon_versioning" = xyes; then
|
||||||
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
|
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
|
||||||
@@ -9010,6 +9073,7 @@ fi
|
|||||||
# The linker will not automatically build a static lib if we build a DLL.
|
# The linker will not automatically build a static lib if we build a DLL.
|
||||||
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
|
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
|
||||||
enable_shared_with_static_runtimes=yes
|
enable_shared_with_static_runtimes=yes
|
||||||
|
exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
|
||||||
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
|
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
|
||||||
# Don't use ranlib
|
# Don't use ranlib
|
||||||
old_postinstall_cmds='chmod 644 $oldlib'
|
old_postinstall_cmds='chmod 644 $oldlib'
|
||||||
@@ -9055,6 +9119,7 @@ fi
|
|||||||
hardcode_shlibpath_var=unsupported
|
hardcode_shlibpath_var=unsupported
|
||||||
if test "$lt_cv_ld_force_load" = "yes"; then
|
if test "$lt_cv_ld_force_load" = "yes"; then
|
||||||
whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
|
whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
|
||||||
|
|
||||||
else
|
else
|
||||||
whole_archive_flag_spec=''
|
whole_archive_flag_spec=''
|
||||||
fi
|
fi
|
||||||
@@ -9134,7 +9199,6 @@ fi
|
|||||||
fi
|
fi
|
||||||
if test "$with_gnu_ld" = no; then
|
if test "$with_gnu_ld" = no; then
|
||||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||||
hardcode_libdir_flag_spec_ld='+b $libdir'
|
|
||||||
hardcode_libdir_separator=:
|
hardcode_libdir_separator=:
|
||||||
hardcode_direct=yes
|
hardcode_direct=yes
|
||||||
hardcode_direct_absolute=yes
|
hardcode_direct_absolute=yes
|
||||||
@@ -9752,11 +9816,6 @@ esac
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -9852,7 +9911,7 @@ need_version=unknown
|
|||||||
|
|
||||||
case $host_os in
|
case $host_os in
|
||||||
aix3*)
|
aix3*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
|
||||||
shlibpath_var=LIBPATH
|
shlibpath_var=LIBPATH
|
||||||
|
|
||||||
@@ -9861,7 +9920,7 @@ aix3*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
aix[4-9]*)
|
aix[4-9]*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
hardcode_into_libs=yes
|
hardcode_into_libs=yes
|
||||||
@@ -9926,7 +9985,7 @@ beos*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
bsdi[45]*)
|
bsdi[45]*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
@@ -10065,7 +10124,7 @@ darwin* | rhapsody*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
dgux*)
|
dgux*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
|
||||||
@@ -10118,17 +10177,18 @@ freebsd* | dragonfly*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
gnu*)
|
gnu*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
|
shlibpath_overrides_runpath=no
|
||||||
hardcode_into_libs=yes
|
hardcode_into_libs=yes
|
||||||
;;
|
;;
|
||||||
|
|
||||||
haiku*)
|
haiku*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
dynamic_linker="$host_os runtime_loader"
|
dynamic_linker="$host_os runtime_loader"
|
||||||
@@ -10189,7 +10249,7 @@ hpux9* | hpux10* | hpux11*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
interix[3-9]*)
|
interix[3-9]*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
|
||||||
@@ -10205,7 +10265,7 @@ irix5* | irix6* | nonstopux*)
|
|||||||
nonstopux*) version_type=nonstopux ;;
|
nonstopux*) version_type=nonstopux ;;
|
||||||
*)
|
*)
|
||||||
if test "$lt_cv_prog_gnu_ld" = yes; then
|
if test "$lt_cv_prog_gnu_ld" = yes; then
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
else
|
else
|
||||||
version_type=irix
|
version_type=irix
|
||||||
fi ;;
|
fi ;;
|
||||||
@@ -10242,9 +10302,9 @@ linux*oldld* | linux*aout* | linux*coff*)
|
|||||||
dynamic_linker=no
|
dynamic_linker=no
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# This must be Linux ELF.
|
# This must be glibc/ELF.
|
||||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
@@ -10326,7 +10386,7 @@ netbsd*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
newsos6)
|
newsos6)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
shlibpath_overrides_runpath=yes
|
shlibpath_overrides_runpath=yes
|
||||||
@@ -10395,7 +10455,7 @@ rdos*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
solaris*)
|
solaris*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
@@ -10420,7 +10480,7 @@ sunos4*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
sysv4 | sysv4.3*)
|
sysv4 | sysv4.3*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
@@ -10444,7 +10504,7 @@ sysv4 | sysv4.3*)
|
|||||||
|
|
||||||
sysv4*MP*)
|
sysv4*MP*)
|
||||||
if test -d /usr/nec ;then
|
if test -d /usr/nec ;then
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
|
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
|
||||||
soname_spec='$libname${shared_ext}.$major'
|
soname_spec='$libname${shared_ext}.$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
@@ -10475,7 +10535,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
|||||||
|
|
||||||
tpf*)
|
tpf*)
|
||||||
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
|
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
need_lib_prefix=no
|
need_lib_prefix=no
|
||||||
need_version=no
|
need_version=no
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
@@ -10485,7 +10545,7 @@ tpf*)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
uts4*)
|
uts4*)
|
||||||
version_type=linux
|
version_type=linux # correct to gnu/linux during the next big refactor
|
||||||
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
|
||||||
soname_spec='${libname}${release}${shared_ext}$major'
|
soname_spec='${libname}${release}${shared_ext}$major'
|
||||||
shlibpath_var=LD_LIBRARY_PATH
|
shlibpath_var=LD_LIBRARY_PATH
|
||||||
@@ -11267,6 +11327,8 @@ CC="$lt_save_CC"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ac_config_commands="$ac_config_commands libtool"
|
ac_config_commands="$ac_config_commands libtool"
|
||||||
|
|
||||||
|
|
||||||
@@ -12649,7 +12711,7 @@ if test -n "$bigendian"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Specify output files
|
# Specify output files
|
||||||
ac_config_files="$ac_config_files Makefile libpcp/Makefile src/Makefile man/Makefile tests/Makefile"
|
ac_config_files="$ac_config_files Makefile include/Makefile libpcp/Makefile src/Makefile man/Makefile tests/Makefile"
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
@@ -13388,6 +13450,7 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
|
|||||||
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
|
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
|
||||||
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
|
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
|
||||||
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
|
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
|
||||||
|
PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
|
||||||
host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
|
host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
|
||||||
host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
|
host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
|
||||||
host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
|
host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
|
||||||
@@ -13470,7 +13533,6 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
|
|||||||
allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
|
allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
|
||||||
no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
|
no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
|
||||||
hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
|
hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
|
||||||
hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
|
|
||||||
hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
|
hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
|
||||||
hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
|
hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
|
||||||
hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
|
hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
|
||||||
@@ -13526,6 +13588,7 @@ _LTECHO_EOF'
|
|||||||
# Quote evaled strings.
|
# Quote evaled strings.
|
||||||
for var in SHELL \
|
for var in SHELL \
|
||||||
ECHO \
|
ECHO \
|
||||||
|
PATH_SEPARATOR \
|
||||||
SED \
|
SED \
|
||||||
GREP \
|
GREP \
|
||||||
EGREP \
|
EGREP \
|
||||||
@@ -13576,7 +13639,6 @@ with_gnu_ld \
|
|||||||
allow_undefined_flag \
|
allow_undefined_flag \
|
||||||
no_undefined_flag \
|
no_undefined_flag \
|
||||||
hardcode_libdir_flag_spec \
|
hardcode_libdir_flag_spec \
|
||||||
hardcode_libdir_flag_spec_ld \
|
|
||||||
hardcode_libdir_separator \
|
hardcode_libdir_separator \
|
||||||
exclude_expsyms \
|
exclude_expsyms \
|
||||||
include_expsyms \
|
include_expsyms \
|
||||||
@@ -13661,6 +13723,7 @@ do
|
|||||||
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
|
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
|
||||||
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
|
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
|
||||||
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||||
|
"include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
|
||||||
"libpcp/Makefile") CONFIG_FILES="$CONFIG_FILES libpcp/Makefile" ;;
|
"libpcp/Makefile") CONFIG_FILES="$CONFIG_FILES libpcp/Makefile" ;;
|
||||||
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
||||||
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
|
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
|
||||||
@@ -14374,8 +14437,8 @@ $as_echo X"$file" |
|
|||||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||||
# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
|
# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
# Inc.
|
# Foundation, Inc.
|
||||||
# Written by Gordon Matzigkeit, 1996
|
# Written by Gordon Matzigkeit, 1996
|
||||||
#
|
#
|
||||||
# This file is part of GNU Libtool.
|
# This file is part of GNU Libtool.
|
||||||
@@ -14429,6 +14492,9 @@ SHELL=$lt_SHELL
|
|||||||
# An echo program that protects backslashes.
|
# An echo program that protects backslashes.
|
||||||
ECHO=$lt_ECHO
|
ECHO=$lt_ECHO
|
||||||
|
|
||||||
|
# The PATH separator for the build system.
|
||||||
|
PATH_SEPARATOR=$lt_PATH_SEPARATOR
|
||||||
|
|
||||||
# The host system.
|
# The host system.
|
||||||
host_alias=$host_alias
|
host_alias=$host_alias
|
||||||
host=$host
|
host=$host
|
||||||
@@ -14730,10 +14796,6 @@ no_undefined_flag=$lt_no_undefined_flag
|
|||||||
# This must work even if \$libdir does not exist
|
# This must work even if \$libdir does not exist
|
||||||
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
|
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
|
||||||
|
|
||||||
# If ld is used when linking, flag to hardcode \$libdir into a binary
|
|
||||||
# during linking. This must work even if \$libdir does not exist.
|
|
||||||
hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
|
|
||||||
|
|
||||||
# Whether we need a single "-rpath" flag with a separated argument.
|
# Whether we need a single "-rpath" flag with a separated argument.
|
||||||
hardcode_libdir_separator=$lt_hardcode_libdir_separator
|
hardcode_libdir_separator=$lt_hardcode_libdir_separator
|
||||||
|
|
||||||
|
|||||||
@@ -232,5 +232,5 @@ if test -n "$bigendian"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Specify output files
|
# Specify output files
|
||||||
AC_CONFIG_FILES([Makefile libpcp/Makefile src/Makefile man/Makefile tests/Makefile])
|
AC_CONFIG_FILES([Makefile include/Makefile libpcp/Makefile src/Makefile man/Makefile tests/Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
19
include/Makefile.am
Normal file
19
include/Makefile.am
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
PCPEXPORT = pcp.h \
|
||||||
|
pcp/crypto.h \
|
||||||
|
pcp/defines.h \
|
||||||
|
pcp/digital_crc32.h \
|
||||||
|
pcp/getpass.h \
|
||||||
|
pcp/jenhash.h \
|
||||||
|
pcp/key.h \
|
||||||
|
pcp/mac.h \
|
||||||
|
pcp/mem.h \
|
||||||
|
pcp/pad.h \
|
||||||
|
pcp/platform.h \
|
||||||
|
pcp/randomart.h \
|
||||||
|
pcp/uthash.h \
|
||||||
|
pcp/vault.h \
|
||||||
|
pcp/version.h \
|
||||||
|
pcp/z85.h \
|
||||||
|
pcp/zmq_z85.h
|
||||||
|
|
||||||
|
nobase_include_HEADERS = $(PCPEXPORT)
|
||||||
520
include/Makefile.in
Normal file
520
include/Makefile.in
Normal file
@@ -0,0 +1,520 @@
|
|||||||
|
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
@SET_MAKE@
|
||||||
|
|
||||||
|
VPATH = @srcdir@
|
||||||
|
am__make_dryrun = \
|
||||||
|
{ \
|
||||||
|
am__dry=no; \
|
||||||
|
case $$MAKEFLAGS in \
|
||||||
|
*\\[\ \ ]*) \
|
||||||
|
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||||
|
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||||
|
*) \
|
||||||
|
for am__flg in $$MAKEFLAGS; do \
|
||||||
|
case $$am__flg in \
|
||||||
|
*=*|--*) ;; \
|
||||||
|
*n*) am__dry=yes; break;; \
|
||||||
|
esac; \
|
||||||
|
done;; \
|
||||||
|
esac; \
|
||||||
|
test $$am__dry = yes; \
|
||||||
|
}
|
||||||
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||||
|
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||||
|
install_sh_DATA = $(install_sh) -c -m 644
|
||||||
|
install_sh_PROGRAM = $(install_sh) -c
|
||||||
|
install_sh_SCRIPT = $(install_sh) -c
|
||||||
|
INSTALL_HEADER = $(INSTALL_DATA)
|
||||||
|
transform = $(program_transform_name)
|
||||||
|
NORMAL_INSTALL = :
|
||||||
|
PRE_INSTALL = :
|
||||||
|
POST_INSTALL = :
|
||||||
|
NORMAL_UNINSTALL = :
|
||||||
|
PRE_UNINSTALL = :
|
||||||
|
POST_UNINSTALL = :
|
||||||
|
build_triplet = @build@
|
||||||
|
host_triplet = @host@
|
||||||
|
subdir = include
|
||||||
|
DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \
|
||||||
|
$(srcdir)/Makefile.in
|
||||||
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
|
am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
|
||||||
|
$(top_srcdir)/config/ltoptions.m4 \
|
||||||
|
$(top_srcdir)/config/ltsugar.m4 \
|
||||||
|
$(top_srcdir)/config/ltversion.m4 \
|
||||||
|
$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||||
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
|
$(ACLOCAL_M4)
|
||||||
|
mkinstalldirs = $(install_sh) -d
|
||||||
|
CONFIG_HEADER = $(top_builddir)/libpcp/config.h
|
||||||
|
CONFIG_CLEAN_FILES =
|
||||||
|
CONFIG_CLEAN_VPATH_FILES =
|
||||||
|
SOURCES =
|
||||||
|
DIST_SOURCES =
|
||||||
|
am__can_run_installinfo = \
|
||||||
|
case $$AM_UPDATE_INFO_DIR in \
|
||||||
|
n|no|NO) false;; \
|
||||||
|
*) (install-info --version) >/dev/null 2>&1;; \
|
||||||
|
esac
|
||||||
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
|
am__vpath_adj = case $$p in \
|
||||||
|
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||||
|
*) f=$$p;; \
|
||||||
|
esac;
|
||||||
|
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||||
|
am__install_max = 40
|
||||||
|
am__nobase_strip_setup = \
|
||||||
|
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||||
|
am__nobase_strip = \
|
||||||
|
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||||
|
am__nobase_list = $(am__nobase_strip_setup); \
|
||||||
|
for p in $$list; do echo "$$p $$p"; done | \
|
||||||
|
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||||
|
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||||
|
if (++n[$$2] == $(am__install_max)) \
|
||||||
|
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||||
|
END { for (dir in files) print dir, files[dir] }'
|
||||||
|
am__base_list = \
|
||||||
|
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||||
|
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||||
|
am__uninstall_files_from_dir = { \
|
||||||
|
test -z "$$files" \
|
||||||
|
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||||
|
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||||
|
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||||
|
}
|
||||||
|
am__installdirs = "$(DESTDIR)$(includedir)"
|
||||||
|
HEADERS = $(nobase_include_HEADERS)
|
||||||
|
ETAGS = etags
|
||||||
|
CTAGS = ctags
|
||||||
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
ACLOCAL = @ACLOCAL@
|
||||||
|
AMTAR = @AMTAR@
|
||||||
|
AR = @AR@
|
||||||
|
AUTOCONF = @AUTOCONF@
|
||||||
|
AUTOHEADER = @AUTOHEADER@
|
||||||
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
AWK = @AWK@
|
||||||
|
CC = @CC@
|
||||||
|
CCDEPMODE = @CCDEPMODE@
|
||||||
|
CFLAGS = @CFLAGS@
|
||||||
|
CPP = @CPP@
|
||||||
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CYGPATH_W = @CYGPATH_W@
|
||||||
|
DEFS = @DEFS@
|
||||||
|
DEPDIR = @DEPDIR@
|
||||||
|
DLLTOOL = @DLLTOOL@
|
||||||
|
DSYMUTIL = @DSYMUTIL@
|
||||||
|
DUMPBIN = @DUMPBIN@
|
||||||
|
ECHO_C = @ECHO_C@
|
||||||
|
ECHO_N = @ECHO_N@
|
||||||
|
ECHO_T = @ECHO_T@
|
||||||
|
EGREP = @EGREP@
|
||||||
|
EXEEXT = @EXEEXT@
|
||||||
|
FGREP = @FGREP@
|
||||||
|
GREP = @GREP@
|
||||||
|
INSTALL = @INSTALL@
|
||||||
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||||
|
LD = @LD@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
|
LIBOBJS = @LIBOBJS@
|
||||||
|
LIBS = @LIBS@
|
||||||
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LIPO = @LIPO@
|
||||||
|
LN_S = @LN_S@
|
||||||
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
MAKEINFO = @MAKEINFO@
|
||||||
|
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||||
|
MKDIR_P = @MKDIR_P@
|
||||||
|
NM = @NM@
|
||||||
|
NMEDIT = @NMEDIT@
|
||||||
|
OBJDUMP = @OBJDUMP@
|
||||||
|
OBJEXT = @OBJEXT@
|
||||||
|
OTOOL = @OTOOL@
|
||||||
|
OTOOL64 = @OTOOL64@
|
||||||
|
PACKAGE = @PACKAGE@
|
||||||
|
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||||
|
PACKAGE_NAME = @PACKAGE_NAME@
|
||||||
|
PACKAGE_STRING = @PACKAGE_STRING@
|
||||||
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||||
|
PACKAGE_URL = @PACKAGE_URL@
|
||||||
|
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||||
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||||
|
RANLIB = @RANLIB@
|
||||||
|
SED = @SED@
|
||||||
|
SET_MAKE = @SET_MAKE@
|
||||||
|
SHELL = @SHELL@
|
||||||
|
STRIP = @STRIP@
|
||||||
|
VERSION = @VERSION@
|
||||||
|
abs_builddir = @abs_builddir@
|
||||||
|
abs_srcdir = @abs_srcdir@
|
||||||
|
abs_top_builddir = @abs_top_builddir@
|
||||||
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
|
ac_ct_AR = @ac_ct_AR@
|
||||||
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||||
|
am__include = @am__include@
|
||||||
|
am__leading_dot = @am__leading_dot@
|
||||||
|
am__quote = @am__quote@
|
||||||
|
am__tar = @am__tar@
|
||||||
|
am__untar = @am__untar@
|
||||||
|
bindir = @bindir@
|
||||||
|
build = @build@
|
||||||
|
build_alias = @build_alias@
|
||||||
|
build_cpu = @build_cpu@
|
||||||
|
build_os = @build_os@
|
||||||
|
build_vendor = @build_vendor@
|
||||||
|
builddir = @builddir@
|
||||||
|
datadir = @datadir@
|
||||||
|
datarootdir = @datarootdir@
|
||||||
|
docdir = @docdir@
|
||||||
|
dvidir = @dvidir@
|
||||||
|
exec_prefix = @exec_prefix@
|
||||||
|
host = @host@
|
||||||
|
host_alias = @host_alias@
|
||||||
|
host_cpu = @host_cpu@
|
||||||
|
host_os = @host_os@
|
||||||
|
host_vendor = @host_vendor@
|
||||||
|
htmldir = @htmldir@
|
||||||
|
includedir = @includedir@
|
||||||
|
infodir = @infodir@
|
||||||
|
install_sh = @install_sh@
|
||||||
|
libdir = @libdir@
|
||||||
|
libexecdir = @libexecdir@
|
||||||
|
localedir = @localedir@
|
||||||
|
localstatedir = @localstatedir@
|
||||||
|
mandir = @mandir@
|
||||||
|
mkdir_p = @mkdir_p@
|
||||||
|
oldincludedir = @oldincludedir@
|
||||||
|
pdfdir = @pdfdir@
|
||||||
|
prefix = @prefix@
|
||||||
|
program_transform_name = @program_transform_name@
|
||||||
|
psdir = @psdir@
|
||||||
|
sbindir = @sbindir@
|
||||||
|
sharedstatedir = @sharedstatedir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
sysconfdir = @sysconfdir@
|
||||||
|
target_alias = @target_alias@
|
||||||
|
top_build_prefix = @top_build_prefix@
|
||||||
|
top_builddir = @top_builddir@
|
||||||
|
top_srcdir = @top_srcdir@
|
||||||
|
PCPEXPORT = pcp.h \
|
||||||
|
pcp/crypto.h \
|
||||||
|
pcp/defines.h \
|
||||||
|
pcp/digital_crc32.h \
|
||||||
|
pcp/getpass.h \
|
||||||
|
pcp/jenhash.h \
|
||||||
|
pcp/key.h \
|
||||||
|
pcp/mac.h \
|
||||||
|
pcp/mem.h \
|
||||||
|
pcp/pad.h \
|
||||||
|
pcp/platform.h \
|
||||||
|
pcp/randomart.h \
|
||||||
|
pcp/uthash.h \
|
||||||
|
pcp/vault.h \
|
||||||
|
pcp/version.h \
|
||||||
|
pcp/z85.h \
|
||||||
|
pcp/zmq_z85.h
|
||||||
|
|
||||||
|
nobase_include_HEADERS = $(PCPEXPORT)
|
||||||
|
all: all-am
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
|
@for dep in $?; do \
|
||||||
|
case '$(am__configure_deps)' in \
|
||||||
|
*$$dep*) \
|
||||||
|
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||||
|
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||||
|
exit 1;; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
|
||||||
|
$(am__cd) $(top_srcdir) && \
|
||||||
|
$(AUTOMAKE) --gnu include/Makefile
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
|
@case '$?' in \
|
||||||
|
*config.status*) \
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
|
*) \
|
||||||
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||||
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||||
|
esac;
|
||||||
|
|
||||||
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
|
||||||
|
$(top_srcdir)/configure: $(am__configure_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||||
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
|
$(am__aclocal_m4_deps):
|
||||||
|
|
||||||
|
mostlyclean-libtool:
|
||||||
|
-rm -f *.lo
|
||||||
|
|
||||||
|
clean-libtool:
|
||||||
|
-rm -rf .libs _libs
|
||||||
|
install-nobase_includeHEADERS: $(nobase_include_HEADERS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
@list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||||
|
if test -n "$$list"; then \
|
||||||
|
echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
|
||||||
|
$(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
|
||||||
|
fi; \
|
||||||
|
$(am__nobase_list) | while read dir files; do \
|
||||||
|
xfiles=; for file in $$files; do \
|
||||||
|
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
|
||||||
|
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
|
||||||
|
test -z "$$xfiles" || { \
|
||||||
|
test "x$$dir" = x. || { \
|
||||||
|
echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \
|
||||||
|
$(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \
|
||||||
|
echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \
|
||||||
|
$(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall-nobase_includeHEADERS:
|
||||||
|
@$(NORMAL_UNINSTALL)
|
||||||
|
@list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||||
|
$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
|
||||||
|
dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
mkid -fID $$unique
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
set x; \
|
||||||
|
here=`pwd`; \
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
shift; \
|
||||||
|
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||||
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
if test $$# -gt 0; then \
|
||||||
|
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||||
|
"$$@" $$unique; \
|
||||||
|
else \
|
||||||
|
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||||
|
$$unique; \
|
||||||
|
fi; \
|
||||||
|
fi
|
||||||
|
ctags: CTAGS
|
||||||
|
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
|
$(TAGS_FILES) $(LISP)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||||
|
unique=`for i in $$list; do \
|
||||||
|
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||||
|
done | \
|
||||||
|
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||||
|
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||||
|
test -z "$(CTAGS_ARGS)$$unique" \
|
||||||
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
|
$$unique
|
||||||
|
|
||||||
|
GTAGS:
|
||||||
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
|
&& $(am__cd) $(top_srcdir) \
|
||||||
|
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||||
|
|
||||||
|
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
|
||||||
|
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||||
|
case "$(srcdir)" in \
|
||||||
|
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||||
|
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||||
|
esac; \
|
||||||
|
for i in $$list; do \
|
||||||
|
if test -f "$$i"; then \
|
||||||
|
echo "$(subdir)/$$i"; \
|
||||||
|
else \
|
||||||
|
echo "$$sdir/$$i"; \
|
||||||
|
fi; \
|
||||||
|
done >> $(top_builddir)/cscope.files
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
|
list='$(DISTFILES)'; \
|
||||||
|
dist_files=`for file in $$list; do echo $$file; done | \
|
||||||
|
sed -e "s|^$$srcdirstrip/||;t" \
|
||||||
|
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||||
|
case $$dist_files in \
|
||||||
|
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||||
|
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||||
|
sort -u` ;; \
|
||||||
|
esac; \
|
||||||
|
for file in $$dist_files; do \
|
||||||
|
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||||
|
if test -d $$d/$$file; then \
|
||||||
|
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||||
|
if test -d "$(distdir)/$$file"; then \
|
||||||
|
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||||
|
fi; \
|
||||||
|
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||||
|
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||||
|
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||||
|
fi; \
|
||||||
|
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||||
|
else \
|
||||||
|
test -f "$(distdir)/$$file" \
|
||||||
|
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||||
|
|| exit 1; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
check-am: all-am
|
||||||
|
check: check-am
|
||||||
|
all-am: Makefile $(HEADERS)
|
||||||
|
installdirs:
|
||||||
|
for dir in "$(DESTDIR)$(includedir)"; do \
|
||||||
|
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||||
|
done
|
||||||
|
install: install-am
|
||||||
|
install-exec: install-exec-am
|
||||||
|
install-data: install-data-am
|
||||||
|
uninstall: uninstall-am
|
||||||
|
|
||||||
|
install-am: all-am
|
||||||
|
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||||
|
|
||||||
|
installcheck: installcheck-am
|
||||||
|
install-strip:
|
||||||
|
if test -z '$(STRIP)'; then \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
install; \
|
||||||
|
else \
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
|
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||||
|
fi
|
||||||
|
mostlyclean-generic:
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
@echo "This command is intended for maintainers to use"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
clean: clean-am
|
||||||
|
|
||||||
|
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||||
|
|
||||||
|
distclean: distclean-am
|
||||||
|
-rm -f Makefile
|
||||||
|
distclean-am: clean-am distclean-generic distclean-tags
|
||||||
|
|
||||||
|
dvi: dvi-am
|
||||||
|
|
||||||
|
dvi-am:
|
||||||
|
|
||||||
|
html: html-am
|
||||||
|
|
||||||
|
html-am:
|
||||||
|
|
||||||
|
info: info-am
|
||||||
|
|
||||||
|
info-am:
|
||||||
|
|
||||||
|
install-data-am: install-nobase_includeHEADERS
|
||||||
|
|
||||||
|
install-dvi: install-dvi-am
|
||||||
|
|
||||||
|
install-dvi-am:
|
||||||
|
|
||||||
|
install-exec-am:
|
||||||
|
|
||||||
|
install-html: install-html-am
|
||||||
|
|
||||||
|
install-html-am:
|
||||||
|
|
||||||
|
install-info: install-info-am
|
||||||
|
|
||||||
|
install-info-am:
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
|
||||||
|
install-pdf: install-pdf-am
|
||||||
|
|
||||||
|
install-pdf-am:
|
||||||
|
|
||||||
|
install-ps: install-ps-am
|
||||||
|
|
||||||
|
install-ps-am:
|
||||||
|
|
||||||
|
installcheck-am:
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-am
|
||||||
|
-rm -f Makefile
|
||||||
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-am
|
||||||
|
|
||||||
|
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||||
|
|
||||||
|
pdf: pdf-am
|
||||||
|
|
||||||
|
pdf-am:
|
||||||
|
|
||||||
|
ps: ps-am
|
||||||
|
|
||||||
|
ps-am:
|
||||||
|
|
||||||
|
uninstall-am: uninstall-nobase_includeHEADERS
|
||||||
|
|
||||||
|
.MAKE: install-am install-strip
|
||||||
|
|
||||||
|
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||||
|
clean-libtool cscopelist ctags distclean distclean-generic \
|
||||||
|
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||||
|
html-am info info-am install install-am install-data \
|
||||||
|
install-data-am install-dvi install-dvi-am install-exec \
|
||||||
|
install-exec-am install-html install-html-am install-info \
|
||||||
|
install-info-am install-man install-nobase_includeHEADERS \
|
||||||
|
install-pdf install-pdf-am install-ps install-ps-am \
|
||||||
|
install-strip installcheck installcheck-am installdirs \
|
||||||
|
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||||
|
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||||
|
tags uninstall uninstall-am uninstall-nobase_includeHEADERS
|
||||||
|
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
||||||
756
include/pcp.h
756
include/pcp.h
@@ -5,746 +5,22 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <err.h>
|
#include "pcp/crypto.h"
|
||||||
#include <errno.h>
|
#include "pcp/defines.h"
|
||||||
#include <inttypes.h> /* uint32_t */
|
#include "pcp/digital_crc32.h"
|
||||||
#include <limits.h>
|
#include "pcp/getpass.h"
|
||||||
#include <sodium.h>
|
#include "pcp/jenhash.h"
|
||||||
#include <stddef.h> /* ptrdiff_t */
|
#include "pcp/key.h"
|
||||||
#include <stdint.h>
|
#include "pcp/mac.h"
|
||||||
#include <stdio.h>
|
#include "pcp/mem.h"
|
||||||
#include <stdlib.h>
|
#include "pcp/pad.h"
|
||||||
#include <stdlib.h> /* exit() */
|
#include "pcp/platform.h"
|
||||||
#include <string.h>
|
#include "pcp/randomart.h"
|
||||||
#include <string.h> /* memcmp,strlen */
|
#include "pcp/uthash.h"
|
||||||
#include <strings.h>
|
#include "pcp/vault.h"
|
||||||
#include <sys/stat.h>
|
#include "pcp/version.h"
|
||||||
#include <sys/types.h>
|
#include "pcp/z85.h"
|
||||||
#include <termios.h>
|
#include "pcp/zmq_z85.h"
|
||||||
#include <time.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include CONFIG_H_FILE
|
|
||||||
|
|
||||||
// +++ from libpcp/crypto.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
size_t pcp_sodium_box(unsigned char **cipher,
|
|
||||||
unsigned char *cleartext,
|
|
||||||
size_t clearsize,
|
|
||||||
unsigned char *nonce,
|
|
||||||
unsigned char *secret,
|
|
||||||
unsigned char *public);
|
|
||||||
|
|
||||||
int pcp_sodium_verify_box(unsigned char **cleartext, unsigned char* message,
|
|
||||||
size_t messagesize, unsigned char *nonce,
|
|
||||||
unsigned char *secret, unsigned char *public);
|
|
||||||
|
|
||||||
unsigned char *pcp_box_encrypt(pcp_key_t *secret, pcp_pubkey_t *public,
|
|
||||||
unsigned char *message, size_t messagesize,
|
|
||||||
size_t *csize);
|
|
||||||
|
|
||||||
unsigned char *pcp_box_decrypt(pcp_key_t *secret, pcp_pubkey_t *public,
|
|
||||||
unsigned char *cipher, size_t ciphersize,
|
|
||||||
size_t *dsize);
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/getpass.h: +++
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (unportable) functions to turn on/off terminal echo
|
|
||||||
* using termios functions. might compile however on
|
|
||||||
* most unices, tested on FreeBSD only.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void pcp_echo_off();
|
|
||||||
void pcp_echo_on();
|
|
||||||
char *pcp_get_stdin();
|
|
||||||
char *pcp_get_passphrase(char *prompt);
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/key.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
PCP private key structure. Most fields are self explanatory.
|
|
||||||
Some notes:
|
|
||||||
|
|
||||||
'encrypted' contains the encrypted secret key. If it's set,
|
|
||||||
the field 'secret' which contains the clear secret key will
|
|
||||||
be zeroed with random values, the first byte will be 0.
|
|
||||||
|
|
||||||
'nonce' contains the nonce required to decrypt the encrypted
|
|
||||||
secret, if set.
|
|
||||||
|
|
||||||
'serial' is a random number.
|
|
||||||
|
|
||||||
'id' is a string containing the hex values of the CRC32 checksum
|
|
||||||
of the public and secret key.
|
|
||||||
|
|
||||||
Upon creation everything will be filled with random bytes.
|
|
||||||
String fields will contain a string followed by 0 followed
|
|
||||||
by the rest of the pre-filled random bytes. To denote a string
|
|
||||||
field as empty, the first byte will be set to 0.
|
|
||||||
|
|
||||||
There are dynamically calculated attributes as well:
|
|
||||||
|
|
||||||
'checksum' is a 256 bit SHA hash of the public key returned
|
|
||||||
by pcpkey_getchecksum() or pcppubkey_getchecksum().
|
|
||||||
|
|
||||||
'random id' is a random art ascii image returned by
|
|
||||||
pcppubkey_get_art() or pcpkey_get_art(), calculated from
|
|
||||||
the public key.
|
|
||||||
|
|
||||||
If exported to a single file or printed, the structure will
|
|
||||||
be encoded using Z85 encoding.
|
|
||||||
|
|
||||||
*/
|
|
||||||
struct _pcp_key_t {
|
|
||||||
byte public[32];
|
|
||||||
byte secret[32];
|
|
||||||
byte nonce[24];
|
|
||||||
byte encrypted[48];
|
|
||||||
char owner[255];
|
|
||||||
char mail[255];
|
|
||||||
char id[17];
|
|
||||||
long ctime;
|
|
||||||
uint32_t version;
|
|
||||||
uint32_t serial;
|
|
||||||
uint8_t type;
|
|
||||||
UT_hash_handle hh;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _pcp_pubkey_t {
|
|
||||||
byte public[32];
|
|
||||||
char owner[255];
|
|
||||||
char mail[255];
|
|
||||||
char id[17];
|
|
||||||
long ctime;
|
|
||||||
uint32_t version;
|
|
||||||
uint32_t serial;
|
|
||||||
uint8_t type;
|
|
||||||
UT_hash_handle hh;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _pcp_key_t pcp_key_t;
|
|
||||||
typedef struct _pcp_pubkey_t pcp_pubkey_t;
|
|
||||||
|
|
||||||
pcp_key_t *pcpkey_hash;
|
|
||||||
pcp_pubkey_t *pcppubkey_hash;
|
|
||||||
|
|
||||||
void pcp_cleanhashes();
|
|
||||||
pcp_key_t *pcpkey_new ();
|
|
||||||
|
|
||||||
char *pcppubkey_get_art(pcp_pubkey_t *k);
|
|
||||||
char *pcpkey_get_art(pcp_key_t *k);
|
|
||||||
|
|
||||||
pcp_key_t *pcpkey_encrypt(pcp_key_t *key, char *passphrase);
|
|
||||||
pcp_key_t *pcpkey_decrypt(pcp_key_t *key, char *passphrase);
|
|
||||||
pcp_pubkey_t *pcpkey_pub_from_secret(pcp_key_t *key);
|
|
||||||
char *pcp_getkeyid(pcp_key_t *k);
|
|
||||||
unsigned char *pcppubkey_getchecksum(pcp_pubkey_t *k);
|
|
||||||
unsigned char *pcpkey_getchecksum(pcp_key_t *k);
|
|
||||||
void pcp_inithashes();
|
|
||||||
|
|
||||||
pcp_key_t *pcpkey_exists(char *id);
|
|
||||||
pcp_pubkey_t *pcppubkey_exists(char *id);
|
|
||||||
|
|
||||||
pcp_key_t * key2be(pcp_key_t *k);
|
|
||||||
pcp_key_t *key2native(pcp_key_t *k);
|
|
||||||
pcp_pubkey_t * pubkey2be(pcp_pubkey_t *k);
|
|
||||||
pcp_pubkey_t *pubkey2native(pcp_pubkey_t *k);
|
|
||||||
|
|
||||||
unsigned char * pcp_gennonce();
|
|
||||||
|
|
||||||
void pcpedit_key(char *keyid);
|
|
||||||
|
|
||||||
// proprietary key derivation function. derives an
|
|
||||||
// secure encryption key from the given passphrase by
|
|
||||||
// calculating a SALSA20 hash from it HCYCLES times.
|
|
||||||
//
|
|
||||||
// turns the result into a proper CURVE25519 secret
|
|
||||||
// key. allocates memory for key and it is up to the
|
|
||||||
// user to free it after use.
|
|
||||||
//
|
|
||||||
// deprecation warning: maybe removed once the libsodium
|
|
||||||
// developers incorporated some key derivation function
|
|
||||||
// into libsodium. so far, there's none but word goes
|
|
||||||
// that perhaps something like scrypt() from the star
|
|
||||||
// distribution may be added in the future.
|
|
||||||
unsigned char *pcp_derivekey(char *passphrase);
|
|
||||||
|
|
||||||
pcp_key_t *pcp_derive_pcpkey (pcp_key_t *ours, char *theirs);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/mac.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// how many times do we hash the passphrase
|
|
||||||
#define HCYCLES 128000
|
|
||||||
|
|
||||||
// encrypt some arbitrary cleartext using
|
|
||||||
// a curve25519 secret key and a given nonce.
|
|
||||||
//
|
|
||||||
// expects a pointer to the target binary
|
|
||||||
// stream containing the encrypted data,
|
|
||||||
// the cleartext string, its size, the nonce
|
|
||||||
// (24 bytes) and the secret key (32 bytes).
|
|
||||||
//
|
|
||||||
// allocates memory for the returned cipher
|
|
||||||
// and it is up to the user to free it after use.
|
|
||||||
//
|
|
||||||
// returns the size of the returned cipherstream.
|
|
||||||
// in case of an error, the cipher will be set
|
|
||||||
// to NULL.
|
|
||||||
size_t pcp_sodium_mac(unsigned char **cipher,
|
|
||||||
unsigned char *cleartext,
|
|
||||||
size_t clearsize,
|
|
||||||
unsigned char *nonce,
|
|
||||||
unsigned char *key);
|
|
||||||
|
|
||||||
// does the opposite of pcp_sodium_mac and decrypts
|
|
||||||
// a given encrypted binary stream using a nonce and
|
|
||||||
// a secret key (sizes: see above).
|
|
||||||
//
|
|
||||||
// allocates memory for the returned cleartext and
|
|
||||||
// it is up to the user to free it after use.
|
|
||||||
//
|
|
||||||
// returns 0 if decryption and verification were
|
|
||||||
// successful, otherwise -1.
|
|
||||||
int pcp_sodium_verify_mac(unsigned char **cleartext,
|
|
||||||
unsigned char* message,
|
|
||||||
size_t messagesize,
|
|
||||||
unsigned char *nonce,
|
|
||||||
unsigned char *key);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/mem.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// simple malloc() wrapper
|
|
||||||
// behaves like calloc(), which
|
|
||||||
// I don't have here.
|
|
||||||
//
|
|
||||||
// exits if there's no more memory
|
|
||||||
// available.
|
|
||||||
void *ucmalloc(size_t s);
|
|
||||||
|
|
||||||
// the same but it fills the pointer with random values
|
|
||||||
void *urmalloc(size_t s);
|
|
||||||
|
|
||||||
// dito.
|
|
||||||
void *ucfree(void *ptr);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/pad.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#define ZPADCHAR 48
|
|
||||||
#else
|
|
||||||
#define ZPADCHAR 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// prepends a binary stream with a number of
|
|
||||||
// \0's as required by the secret_box and
|
|
||||||
// secret_box_open functions of libsodium.
|
|
||||||
//
|
|
||||||
// parameters:
|
|
||||||
//
|
|
||||||
// padded: destination array (ref)
|
|
||||||
// unpadded: source array without padding
|
|
||||||
// padlen: length of padding
|
|
||||||
// unpadlen: length of source array
|
|
||||||
//
|
|
||||||
// turns "efa5" into "00000000efa5" with padlen 8
|
|
||||||
//
|
|
||||||
// if DEBUG is set, destination will be padded with
|
|
||||||
// the character '0', NOT the integer 0.
|
|
||||||
//
|
|
||||||
// allocates memory for padded and it is up to the
|
|
||||||
// user to free it after use.
|
|
||||||
//
|
|
||||||
// sample call:
|
|
||||||
//
|
|
||||||
// char unpadded[] = {0xef, 0xa5};
|
|
||||||
// unsigned char *padded;
|
|
||||||
// pcp_pad_prepend(&padded, unpadded, 8, 2);
|
|
||||||
//
|
|
||||||
// the result, padded, would be 10 bytes long, 8
|
|
||||||
// bytes for the leading zeros and 2 for the content
|
|
||||||
// of the original unpadded.
|
|
||||||
void pcp_pad_prepend(unsigned char **padded, unsigned char *unpadded,
|
|
||||||
size_t padlen, size_t unpadlen);
|
|
||||||
|
|
||||||
// removes zero's of a binary stream, which is
|
|
||||||
// the reverse of pcp_pad_prepend().
|
|
||||||
//
|
|
||||||
// parameters:
|
|
||||||
//
|
|
||||||
// unpadded: destination array (ref), with padding removed
|
|
||||||
// padded: source array with padding
|
|
||||||
// padlen: length of padding
|
|
||||||
// unpadlen: length of source array
|
|
||||||
//
|
|
||||||
// turns "00000000efa5" into "efa5" with padlen 8
|
|
||||||
//
|
|
||||||
// allocates memory for unpadded and it is up to the
|
|
||||||
// user to free it after use.
|
|
||||||
//
|
|
||||||
// sample call:
|
|
||||||
//
|
|
||||||
// char padded[] = {0x0, 0x0, 0x0, 0x0, 0xef, 0xa5};
|
|
||||||
// unsigned char *unpadded;
|
|
||||||
// pcp_pad_remove(unpadded, padded, 4, 2);
|
|
||||||
//
|
|
||||||
// the result, unpadded would be 2 bytes long containing
|
|
||||||
// only the 2 bytes we want to have with zeros removed.
|
|
||||||
void pcp_pad_remove(unsigned char **unpadded, unsigned char *padded,
|
|
||||||
size_t padlen, size_t unpadlen);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/platform.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(CONFIG_H_FILE)
|
|
||||||
#elif defined(HAVE_CONFIG_H)
|
|
||||||
#else
|
|
||||||
#error Need either CONFIG_H_FILE or HAVE_CONFIG_H defined.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ENDIAN_H
|
|
||||||
# include <endian.h>
|
|
||||||
#else // no endian.h
|
|
||||||
# ifdef HAVE_SYS_ENDIAN_H
|
|
||||||
# include <sys/endian.h>
|
|
||||||
# ifdef HAVE_BETOH32
|
|
||||||
// openbsd, use aliases
|
|
||||||
# define be32toh betoh32
|
|
||||||
# define htobe32 hto32be
|
|
||||||
# endif
|
|
||||||
# else // no sys/endian.h
|
|
||||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
|
||||||
# define be32toh(x) ((void)0)
|
|
||||||
# define htobe32(x) ((void)0)
|
|
||||||
# else
|
|
||||||
# ifdef HAVE_ARPA_INET_H
|
|
||||||
# include <arpa/inet.h>
|
|
||||||
# else
|
|
||||||
# ifdef HAVE_NETINET_IN_H
|
|
||||||
# include <netinet/in.h>
|
|
||||||
# else
|
|
||||||
# error Need either netinet/in.h or arpa/inet.h for ntohl() and htonl()
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# define be32toh(x) ((u_int32_t)ntohl((u_int32_t)(x)))
|
|
||||||
# define htobe32(x) ((u_int32_t)htonl((u_int32_t)(x)))
|
|
||||||
# endif
|
|
||||||
# endif // HAVE_SYS_ENDIAN_H
|
|
||||||
#endif // HAVE_ENDIAN_H
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAVE_ARC4RANDOM_BUF
|
|
||||||
// shitty OS. we've got to use other stuff
|
|
||||||
|
|
||||||
|
|
||||||
static inline FILE *__getranddev() {
|
|
||||||
FILE *R;
|
|
||||||
if((R = fopen("/dev/urandom", "rb")) == NULL) {
|
|
||||||
// not even this is here! what a shame
|
|
||||||
if((R = fopen("/dev/random", "rb")) == NULL) {
|
|
||||||
// not available or depleted. that's too bad
|
|
||||||
fprintf(stderr, "ERROR: /dev/urandom not available, /dev/random is depleted.\n");
|
|
||||||
fprintf(stderr, "That's horrible for you but a nightmare for me. I die. Bye.\n");
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return R;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline u_int32_t arc4random() {
|
|
||||||
uint32_t x;
|
|
||||||
FILE *R = __getranddev();
|
|
||||||
fread(&x, sizeof(uint32_t), 1, R);
|
|
||||||
fclose(R);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void arc4random_buf(void *buf, size_t nbytes) {
|
|
||||||
FILE *R = __getranddev();
|
|
||||||
fread(buf, nbytes, 1, R);
|
|
||||||
fclose(R);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/randomart.h: +++
|
|
||||||
|
|
||||||
/* $OpenBSD: key.c,v 1.70 2008/06/11 21:01:35 grunk Exp $ */
|
|
||||||
/*
|
|
||||||
* read_bignum():
|
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
|
||||||
*
|
|
||||||
* As far as I am concerned, the code I have written for this software
|
|
||||||
* can be used freely for any purpose. Any derived versions of this
|
|
||||||
* software must be clearly marked as such, and if the derived work is
|
|
||||||
* incompatible with the protocol description in the RFC file, it must be
|
|
||||||
* called by a name other than "ssh" or "Secure Shell".
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// key_fingerprint_randomart comitted by Alexander von Gernler in rev 1.70
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// from openssh key.c
|
|
||||||
|
|
||||||
#ifndef MAX
|
|
||||||
# define MAX(a,b) (((a)>(b))?(a):(b))
|
|
||||||
# define MIN(a,b) (((a)<(b))?(a):(b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
char *key_fingerprint_randomart(unsigned char *dgst_raw, unsigned int dgst_raw_len);
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/vault.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct _vault_t {
|
|
||||||
char *filename;
|
|
||||||
FILE *fd;
|
|
||||||
uint8_t unsafed;
|
|
||||||
uint8_t isnew;
|
|
||||||
uint32_t size;
|
|
||||||
time_t modified;
|
|
||||||
mode_t mode;
|
|
||||||
uint32_t version;
|
|
||||||
byte checksum[32];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _vault_header_t {
|
|
||||||
byte fileid;
|
|
||||||
uint32_t version;
|
|
||||||
byte checksum[32];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _vault_item_header_t {
|
|
||||||
byte type;
|
|
||||||
uint32_t size;
|
|
||||||
uint32_t version;
|
|
||||||
byte checksum[32];
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _vault_t vault_t;
|
|
||||||
typedef struct _vault_header_t vault_header_t;
|
|
||||||
typedef struct _vault_item_header_t vault_item_header_t;
|
|
||||||
|
|
||||||
vault_t *pcpvault_init(char *filename);
|
|
||||||
vault_t *pcpvault_new(char *filename, int is_tmp);
|
|
||||||
int pcpvault_create(vault_t *vault);
|
|
||||||
int pcpvault_additem(vault_t *vault, void *item, size_t itemsize, uint8_t type, uint8_t do_hash);
|
|
||||||
int pcpvault_close(vault_t *vault);
|
|
||||||
int pcpvault_fetchall(vault_t *vault);
|
|
||||||
int pcpvault_writeall(vault_t *vault);
|
|
||||||
void pcpvault_copy(vault_t *tmp, vault_t *vault);
|
|
||||||
void pcpvault_unlink(vault_t *tmp);
|
|
||||||
unsigned char *pcpvault_create_checksum(vault_t *vault);
|
|
||||||
void pcpvault_update_checksum(vault_t *vault);
|
|
||||||
|
|
||||||
vault_header_t * vh2be(vault_header_t *h);
|
|
||||||
vault_header_t * vh2native(vault_header_t *h);
|
|
||||||
vault_item_header_t * ih2be(vault_item_header_t *h);
|
|
||||||
vault_item_header_t * ih2native(vault_item_header_t *h);
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/version.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define PCP_VERSION_MAJOR 0
|
|
||||||
#define PCP_VERSION_MINOR 1
|
|
||||||
#define PCP_VERSION_PATCH 2
|
|
||||||
|
|
||||||
#define PCP_MAKE_VERSION(major, minor, patch) \
|
|
||||||
((major) * 10000 + (minor) * 100 + (patch))
|
|
||||||
#define PCP_VERSION \
|
|
||||||
PCP_MAKE_VERSION(PCP_VERSION_MAJOR, PCP_VERSION_MINOR, PCP_VERSION_PATCH)
|
|
||||||
|
|
||||||
int pcp_version();
|
|
||||||
|
|
||||||
|
|
||||||
// +++ from libpcp/z85.h: +++
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is part of Pretty Curved Privacy (pcp1).
|
|
||||||
|
|
||||||
Copyright (C) 2013 T.Linden.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
You can contact me by mail: <tlinden AT cpan DOT org>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// from https://github.com/tlinden/curve-keygen/
|
|
||||||
|
|
||||||
|
|
||||||
// convert a binary stream to one which gets accepted by zmq_z85_encode
|
|
||||||
// we pad it with zeroes and put the number of zerores in front of it
|
|
||||||
unsigned char *pcp_unpadfour(unsigned char *src, size_t srclen, size_t *dstlen);
|
|
||||||
|
|
||||||
// the reverse of the above
|
|
||||||
unsigned char *pcp_unpadfour(unsigned char *src, size_t srclen, size_t *dstlen);
|
|
||||||
|
|
||||||
// wrapper around zmq Z85 encoding function
|
|
||||||
unsigned char *pcp_z85_decode(char *z85block, size_t *dstlen);
|
|
||||||
|
|
||||||
// the reverse of the above
|
|
||||||
char *pcp_z85_encode(unsigned char *raw, size_t srclen, size_t *dstlen);
|
|
||||||
|
|
||||||
char *pcp_readz85file(FILE *infile);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
55
include/pcp/crypto.h
Normal file
55
include/pcp/crypto.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_CRYPTO_H
|
||||||
|
#define _HAVE_PCP_CRYPTO_H
|
||||||
|
|
||||||
|
#include <sodium.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sodium.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
|
#include "mem.h"
|
||||||
|
#include "key.h"
|
||||||
|
|
||||||
|
size_t pcp_sodium_box(unsigned char **cipher,
|
||||||
|
unsigned char *cleartext,
|
||||||
|
size_t clearsize,
|
||||||
|
unsigned char *nonce,
|
||||||
|
unsigned char *secret,
|
||||||
|
unsigned char *public);
|
||||||
|
|
||||||
|
int pcp_sodium_verify_box(unsigned char **cleartext, unsigned char* message,
|
||||||
|
size_t messagesize, unsigned char *nonce,
|
||||||
|
unsigned char *secret, unsigned char *public);
|
||||||
|
|
||||||
|
unsigned char *pcp_box_encrypt(pcp_key_t *secret, pcp_pubkey_t *public,
|
||||||
|
unsigned char *message, size_t messagesize,
|
||||||
|
size_t *csize);
|
||||||
|
|
||||||
|
unsigned char *pcp_box_decrypt(pcp_key_t *secret, pcp_pubkey_t *public,
|
||||||
|
unsigned char *cipher, size_t ciphersize,
|
||||||
|
size_t *dsize);
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_CRYPTO_H
|
||||||
75
include/pcp/defines.h
Normal file
75
include/pcp/defines.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _DEFINES_H
|
||||||
|
#define _DEFINES_H
|
||||||
|
|
||||||
|
typedef unsigned char byte; // Single unsigned byte = 8 bits
|
||||||
|
typedef unsigned short dbyte; // Double byte = 16 bits
|
||||||
|
typedef unsigned int qbyte; // Quad byte = 32 bits
|
||||||
|
|
||||||
|
// key stuff
|
||||||
|
#define PCP_KEY_HEADER "----- BEGIN PCP SECRET KEY -----"
|
||||||
|
#define PCP_KEY_FOOTER "------ END PCP SECRET KEY ------"
|
||||||
|
|
||||||
|
#define PCP_PUBKEY_HEADER "----- BEGIN PCP PUBLIC KEY -----"
|
||||||
|
#define PCP_PUBKEY_FOOTER "------ END PCP PUBLICKEY ------"
|
||||||
|
|
||||||
|
#define PCP_ENFILE_HEADER "----- BEGIN PCP ENCRYPTED FILE -----"
|
||||||
|
#define PCP_ENFILE_FOOTER "------ END PCP ENCRYPTED FILE ------"
|
||||||
|
|
||||||
|
#define PCP_ZFILE_HEADER "----- BEGIN Z85 ENCODED FILE -----"
|
||||||
|
#define PCP_ZFILE_FOOTER "------ END Z85 ENCODED FILE ------"
|
||||||
|
|
||||||
|
#define PCP_ME "Pretty Curved Privacy"
|
||||||
|
|
||||||
|
#define PCP_KEY_VERSION 0x00000001U
|
||||||
|
#define PCP_KEY_PRIMITIVE "CURVE25519-ED25519-SALSA20-POLY1305"
|
||||||
|
|
||||||
|
#define PCP_KEY_TYPE_MAINSECRET 0x01
|
||||||
|
#define PCP_KEY_TYPE_SECRET 0x02
|
||||||
|
#define PCP_KEY_TYPE_PUBLIC 0x03
|
||||||
|
|
||||||
|
// how many times do we hash a passphrase
|
||||||
|
#define HCYCLES 128000
|
||||||
|
|
||||||
|
// save typing, dammit
|
||||||
|
#define PCP_ENCRYPT_PAD crypto_secretbox_ZEROBYTES + crypto_secretbox_NONCEBYTES
|
||||||
|
|
||||||
|
// vault id
|
||||||
|
#define PCP_VAULT_ID 0xC4
|
||||||
|
#define PCP_VAULT_VERSION 0x01
|
||||||
|
|
||||||
|
char *PCP_ERR;
|
||||||
|
byte PCP_ERRSET;
|
||||||
|
int PCP_EXIT;
|
||||||
|
|
||||||
|
//set error
|
||||||
|
void fatal(const char * fmt, ...);
|
||||||
|
|
||||||
|
// fetch error
|
||||||
|
void fatals_ifany();
|
||||||
|
|
||||||
|
// reset
|
||||||
|
void fatals_reset();
|
||||||
|
|
||||||
|
#endif // _DEFINES_H
|
||||||
43
include/pcp/digital_crc32.h
Normal file
43
include/pcp/digital_crc32.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/* -*- c++ -*- */
|
||||||
|
/*
|
||||||
|
* Copyright 2005,2011 Free Software Foundation, Inc.
|
||||||
|
*
|
||||||
|
* This file is part of GNU Radio
|
||||||
|
*
|
||||||
|
* GNU Radio is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* GNU Radio is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with GNU Radio; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDED_DIGITAL_CRC32_H
|
||||||
|
#define INCLUDED_DIGITAL_CRC32_H
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief update running CRC-32
|
||||||
|
* \ingroup misc
|
||||||
|
*
|
||||||
|
* Update a running CRC with the bytes buf[0..len-1] The CRC should be
|
||||||
|
* initialized to all 1's, and the transmitted value is the 1's
|
||||||
|
* complement of the final running CRC. The resulting CRC should be
|
||||||
|
* transmitted in big endian order.
|
||||||
|
*/
|
||||||
|
unsigned int
|
||||||
|
digital_update_crc32(unsigned int crc, const unsigned char *buf, size_t len);
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
digital_crc32(const unsigned char *buf, size_t len);
|
||||||
|
|
||||||
|
#endif /* INCLUDED_CRC32_H */
|
||||||
22
include/pcp/getpass.h
Normal file
22
include/pcp/getpass.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef _HAVE_PCP_GETPASS
|
||||||
|
#define _HAVE_PCP_GETPASS
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (unportable) functions to turn on/off terminal echo
|
||||||
|
* using termios functions. might compile however on
|
||||||
|
* most unices, tested on FreeBSD only.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <termios.h>
|
||||||
|
|
||||||
|
|
||||||
|
void pcp_echo_off();
|
||||||
|
void pcp_echo_on();
|
||||||
|
char *pcp_get_stdin();
|
||||||
|
char *pcp_get_passphrase(char *prompt);
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_GETPASS
|
||||||
25
include/pcp/jenhash.h
Normal file
25
include/pcp/jenhash.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef _HAVE_JENHASH_H
|
||||||
|
#define _HAVE_JENHASH_H
|
||||||
|
|
||||||
|
// Bob Jenkins 32bit hash function
|
||||||
|
// via: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
|
||||||
|
|
||||||
|
#define jen_mix(a,b,c) \
|
||||||
|
{ \
|
||||||
|
a -= b; a -= c; a ^= ( c >> 13 ); \
|
||||||
|
b -= c; b -= a; b ^= ( a << 8 ); \
|
||||||
|
c -= a; c -= b; c ^= ( b >> 13 ); \
|
||||||
|
a -= b; a -= c; a ^= ( c >> 12 ); \
|
||||||
|
b -= c; b -= a; b ^= ( a << 16 ); \
|
||||||
|
c -= a; c -= b; c ^= ( b >> 5 ); \
|
||||||
|
a -= b; a -= c; a ^= ( c >> 3 ); \
|
||||||
|
b -= c; b -= a; b ^= ( a << 10 ); \
|
||||||
|
c -= a; c -= b; c ^= ( b >> 15 ); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define JEN_PSALT 0xD9A03
|
||||||
|
#define JEN_SSALT 0xC503B
|
||||||
|
|
||||||
|
unsigned jen_hash ( unsigned char *k, unsigned length, unsigned initval );
|
||||||
|
|
||||||
|
#endif // _HAVE_JENHASH_H
|
||||||
159
include/pcp/key.h
Normal file
159
include/pcp/key.h
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_KEYPAIR_H
|
||||||
|
#define _HAVE_PCP_KEYPAIR_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sodium.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
|
#include "platform.h"
|
||||||
|
#include "mem.h"
|
||||||
|
#include "mac.h"
|
||||||
|
#include "randomart.h"
|
||||||
|
#include "version.h"
|
||||||
|
#include "z85.h"
|
||||||
|
#include "uthash.h"
|
||||||
|
#include "jenhash.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
PCP private key structure. Most fields are self explanatory.
|
||||||
|
Some notes:
|
||||||
|
|
||||||
|
'encrypted' contains the encrypted secret key. If it's set,
|
||||||
|
the field 'secret' which contains the clear secret key will
|
||||||
|
be zeroed with random values, the first byte will be 0.
|
||||||
|
|
||||||
|
'nonce' contains the nonce required to decrypt the encrypted
|
||||||
|
secret, if set.
|
||||||
|
|
||||||
|
'serial' is a random number.
|
||||||
|
|
||||||
|
'id' is a string containing the hex values of the CRC32 checksum
|
||||||
|
of the public and secret key.
|
||||||
|
|
||||||
|
Upon creation everything will be filled with random bytes.
|
||||||
|
String fields will contain a string followed by 0 followed
|
||||||
|
by the rest of the pre-filled random bytes. To denote a string
|
||||||
|
field as empty, the first byte will be set to 0.
|
||||||
|
|
||||||
|
There are dynamically calculated attributes as well:
|
||||||
|
|
||||||
|
'checksum' is a 256 bit SHA hash of the public key returned
|
||||||
|
by pcpkey_getchecksum() or pcppubkey_getchecksum().
|
||||||
|
|
||||||
|
'random id' is a random art ascii image returned by
|
||||||
|
pcppubkey_get_art() or pcpkey_get_art(), calculated from
|
||||||
|
the public key.
|
||||||
|
|
||||||
|
If exported to a single file or printed, the structure will
|
||||||
|
be encoded using Z85 encoding.
|
||||||
|
|
||||||
|
*/
|
||||||
|
struct _pcp_key_t {
|
||||||
|
byte public[32];
|
||||||
|
byte secret[32];
|
||||||
|
byte nonce[24];
|
||||||
|
byte encrypted[48];
|
||||||
|
char owner[255];
|
||||||
|
char mail[255];
|
||||||
|
char id[17];
|
||||||
|
long ctime;
|
||||||
|
uint32_t version;
|
||||||
|
uint32_t serial;
|
||||||
|
uint8_t type;
|
||||||
|
UT_hash_handle hh;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _pcp_pubkey_t {
|
||||||
|
byte public[32];
|
||||||
|
char owner[255];
|
||||||
|
char mail[255];
|
||||||
|
char id[17];
|
||||||
|
long ctime;
|
||||||
|
uint32_t version;
|
||||||
|
uint32_t serial;
|
||||||
|
uint8_t type;
|
||||||
|
UT_hash_handle hh;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _pcp_key_t pcp_key_t;
|
||||||
|
typedef struct _pcp_pubkey_t pcp_pubkey_t;
|
||||||
|
|
||||||
|
pcp_key_t *pcpkey_hash;
|
||||||
|
pcp_pubkey_t *pcppubkey_hash;
|
||||||
|
|
||||||
|
void pcp_cleanhashes();
|
||||||
|
pcp_key_t *pcpkey_new ();
|
||||||
|
|
||||||
|
char *pcppubkey_get_art(pcp_pubkey_t *k);
|
||||||
|
char *pcpkey_get_art(pcp_key_t *k);
|
||||||
|
|
||||||
|
pcp_key_t *pcpkey_encrypt(pcp_key_t *key, char *passphrase);
|
||||||
|
pcp_key_t *pcpkey_decrypt(pcp_key_t *key, char *passphrase);
|
||||||
|
pcp_pubkey_t *pcpkey_pub_from_secret(pcp_key_t *key);
|
||||||
|
char *pcp_getkeyid(pcp_key_t *k);
|
||||||
|
unsigned char *pcppubkey_getchecksum(pcp_pubkey_t *k);
|
||||||
|
unsigned char *pcpkey_getchecksum(pcp_key_t *k);
|
||||||
|
void pcp_inithashes();
|
||||||
|
|
||||||
|
pcp_key_t *pcpkey_exists(char *id);
|
||||||
|
pcp_pubkey_t *pcppubkey_exists(char *id);
|
||||||
|
|
||||||
|
pcp_key_t * key2be(pcp_key_t *k);
|
||||||
|
pcp_key_t *key2native(pcp_key_t *k);
|
||||||
|
pcp_pubkey_t * pubkey2be(pcp_pubkey_t *k);
|
||||||
|
pcp_pubkey_t *pubkey2native(pcp_pubkey_t *k);
|
||||||
|
|
||||||
|
unsigned char * pcp_gennonce();
|
||||||
|
|
||||||
|
void pcpedit_key(char *keyid);
|
||||||
|
|
||||||
|
// proprietary key derivation function. derives an
|
||||||
|
// secure encryption key from the given passphrase by
|
||||||
|
// calculating a SALSA20 hash from it HCYCLES times.
|
||||||
|
//
|
||||||
|
// turns the result into a proper CURVE25519 secret
|
||||||
|
// key. allocates memory for key and it is up to the
|
||||||
|
// user to free it after use.
|
||||||
|
//
|
||||||
|
// deprecation warning: maybe removed once the libsodium
|
||||||
|
// developers incorporated some key derivation function
|
||||||
|
// into libsodium. so far, there's none but word goes
|
||||||
|
// that perhaps something like scrypt() from the star
|
||||||
|
// distribution may be added in the future.
|
||||||
|
unsigned char *pcp_derivekey(char *passphrase);
|
||||||
|
|
||||||
|
pcp_key_t *pcp_derive_pcpkey (pcp_key_t *ours, char *theirs);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_KEYPAIR_H
|
||||||
75
include/pcp/mac.h
Normal file
75
include/pcp/mac.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_MAC
|
||||||
|
#define _HAVE_PCP_MAC
|
||||||
|
|
||||||
|
#include <strings.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sodium.h>
|
||||||
|
#include "pad.h"
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
|
|
||||||
|
// how many times do we hash the passphrase
|
||||||
|
#define HCYCLES 128000
|
||||||
|
|
||||||
|
// encrypt some arbitrary cleartext using
|
||||||
|
// a curve25519 secret key and a given nonce.
|
||||||
|
//
|
||||||
|
// expects a pointer to the target binary
|
||||||
|
// stream containing the encrypted data,
|
||||||
|
// the cleartext string, its size, the nonce
|
||||||
|
// (24 bytes) and the secret key (32 bytes).
|
||||||
|
//
|
||||||
|
// allocates memory for the returned cipher
|
||||||
|
// and it is up to the user to free it after use.
|
||||||
|
//
|
||||||
|
// returns the size of the returned cipherstream.
|
||||||
|
// in case of an error, the cipher will be set
|
||||||
|
// to NULL.
|
||||||
|
size_t pcp_sodium_mac(unsigned char **cipher,
|
||||||
|
unsigned char *cleartext,
|
||||||
|
size_t clearsize,
|
||||||
|
unsigned char *nonce,
|
||||||
|
unsigned char *key);
|
||||||
|
|
||||||
|
// does the opposite of pcp_sodium_mac and decrypts
|
||||||
|
// a given encrypted binary stream using a nonce and
|
||||||
|
// a secret key (sizes: see above).
|
||||||
|
//
|
||||||
|
// allocates memory for the returned cleartext and
|
||||||
|
// it is up to the user to free it after use.
|
||||||
|
//
|
||||||
|
// returns 0 if decryption and verification were
|
||||||
|
// successful, otherwise -1.
|
||||||
|
int pcp_sodium_verify_mac(unsigned char **cleartext,
|
||||||
|
unsigned char* message,
|
||||||
|
size_t messagesize,
|
||||||
|
unsigned char *nonce,
|
||||||
|
unsigned char *key);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_MAC
|
||||||
47
include/pcp/mem.h
Normal file
47
include/pcp/mem.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_MEM
|
||||||
|
#define _HAVE_PCP_MEM
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <err.h>
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
// simple malloc() wrapper
|
||||||
|
// behaves like calloc(), which
|
||||||
|
// I don't have here.
|
||||||
|
//
|
||||||
|
// exits if there's no more memory
|
||||||
|
// available.
|
||||||
|
void *ucmalloc(size_t s);
|
||||||
|
|
||||||
|
// the same but it fills the pointer with random values
|
||||||
|
void *urmalloc(size_t s);
|
||||||
|
|
||||||
|
// dito.
|
||||||
|
void *ucfree(void *ptr);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_MEM
|
||||||
98
include/pcp/pad.h
Normal file
98
include/pcp/pad.h
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_ZPADDING
|
||||||
|
#define _HAVE_PCP_ZPADDING
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
#define ZPADCHAR 48
|
||||||
|
#else
|
||||||
|
#define ZPADCHAR 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// prepends a binary stream with a number of
|
||||||
|
// \0's as required by the secret_box and
|
||||||
|
// secret_box_open functions of libsodium.
|
||||||
|
//
|
||||||
|
// parameters:
|
||||||
|
//
|
||||||
|
// padded: destination array (ref)
|
||||||
|
// unpadded: source array without padding
|
||||||
|
// padlen: length of padding
|
||||||
|
// unpadlen: length of source array
|
||||||
|
//
|
||||||
|
// turns "efa5" into "00000000efa5" with padlen 8
|
||||||
|
//
|
||||||
|
// if DEBUG is set, destination will be padded with
|
||||||
|
// the character '0', NOT the integer 0.
|
||||||
|
//
|
||||||
|
// allocates memory for padded and it is up to the
|
||||||
|
// user to free it after use.
|
||||||
|
//
|
||||||
|
// sample call:
|
||||||
|
//
|
||||||
|
// char unpadded[] = {0xef, 0xa5};
|
||||||
|
// unsigned char *padded;
|
||||||
|
// pcp_pad_prepend(&padded, unpadded, 8, 2);
|
||||||
|
//
|
||||||
|
// the result, padded, would be 10 bytes long, 8
|
||||||
|
// bytes for the leading zeros and 2 for the content
|
||||||
|
// of the original unpadded.
|
||||||
|
void pcp_pad_prepend(unsigned char **padded, unsigned char *unpadded,
|
||||||
|
size_t padlen, size_t unpadlen);
|
||||||
|
|
||||||
|
// removes zero's of a binary stream, which is
|
||||||
|
// the reverse of pcp_pad_prepend().
|
||||||
|
//
|
||||||
|
// parameters:
|
||||||
|
//
|
||||||
|
// unpadded: destination array (ref), with padding removed
|
||||||
|
// padded: source array with padding
|
||||||
|
// padlen: length of padding
|
||||||
|
// unpadlen: length of source array
|
||||||
|
//
|
||||||
|
// turns "00000000efa5" into "efa5" with padlen 8
|
||||||
|
//
|
||||||
|
// allocates memory for unpadded and it is up to the
|
||||||
|
// user to free it after use.
|
||||||
|
//
|
||||||
|
// sample call:
|
||||||
|
//
|
||||||
|
// char padded[] = {0x0, 0x0, 0x0, 0x0, 0xef, 0xa5};
|
||||||
|
// unsigned char *unpadded;
|
||||||
|
// pcp_pad_remove(unpadded, padded, 4, 2);
|
||||||
|
//
|
||||||
|
// the result, unpadded would be 2 bytes long containing
|
||||||
|
// only the 2 bytes we want to have with zeros removed.
|
||||||
|
void pcp_pad_remove(unsigned char **unpadded, unsigned char *padded,
|
||||||
|
size_t padlen, size_t unpadlen);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_ZPADDING
|
||||||
106
include/pcp/platform.h
Normal file
106
include/pcp/platform.h
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_PLATFORM_H
|
||||||
|
#define _HAVE_PCP_PLATFORM_H
|
||||||
|
|
||||||
|
#if defined(CONFIG_H_FILE)
|
||||||
|
#include CONFIG_H_FILE
|
||||||
|
#elif defined(HAVE_CONFIG_H)
|
||||||
|
#include "config.h"
|
||||||
|
#else
|
||||||
|
#error Need either CONFIG_H_FILE or HAVE_CONFIG_H defined.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ENDIAN_H
|
||||||
|
# include <endian.h>
|
||||||
|
#else // no endian.h
|
||||||
|
# ifdef HAVE_SYS_ENDIAN_H
|
||||||
|
# include <sys/endian.h>
|
||||||
|
# ifdef HAVE_BETOH32
|
||||||
|
// openbsd, use aliases
|
||||||
|
# define be32toh betoh32
|
||||||
|
# define htobe32 hto32be
|
||||||
|
# endif
|
||||||
|
# else // no sys/endian.h
|
||||||
|
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||||
|
# define be32toh(x) ((void)0)
|
||||||
|
# define htobe32(x) ((void)0)
|
||||||
|
# else
|
||||||
|
# ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
# else
|
||||||
|
# ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
# else
|
||||||
|
# error Need either netinet/in.h or arpa/inet.h for ntohl() and htonl()
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# define be32toh(x) ((u_int32_t)ntohl((u_int32_t)(x)))
|
||||||
|
# define htobe32(x) ((u_int32_t)htonl((u_int32_t)(x)))
|
||||||
|
# endif
|
||||||
|
# endif // HAVE_SYS_ENDIAN_H
|
||||||
|
#endif // HAVE_ENDIAN_H
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef HAVE_ARC4RANDOM_BUF
|
||||||
|
// shitty OS. we've got to use other stuff
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
static inline FILE *__getranddev() {
|
||||||
|
FILE *R;
|
||||||
|
if((R = fopen("/dev/urandom", "rb")) == NULL) {
|
||||||
|
// not even this is here! what a shame
|
||||||
|
if((R = fopen("/dev/random", "rb")) == NULL) {
|
||||||
|
// not available or depleted. that's too bad
|
||||||
|
fprintf(stderr, "ERROR: /dev/urandom not available, /dev/random is depleted.\n");
|
||||||
|
fprintf(stderr, "That's horrible for you but a nightmare for me. I die. Bye.\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline u_int32_t arc4random() {
|
||||||
|
uint32_t x;
|
||||||
|
FILE *R = __getranddev();
|
||||||
|
fread(&x, sizeof(uint32_t), 1, R);
|
||||||
|
fclose(R);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void arc4random_buf(void *buf, size_t nbytes) {
|
||||||
|
FILE *R = __getranddev();
|
||||||
|
fread(buf, nbytes, 1, R);
|
||||||
|
fclose(R);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* !_HAVE_PCP_PLATFORM_H */
|
||||||
|
|
||||||
54
include/pcp/randomart.h
Normal file
54
include/pcp/randomart.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/* $OpenBSD: key.c,v 1.70 2008/06/11 21:01:35 grunk Exp $ */
|
||||||
|
/*
|
||||||
|
* read_bignum():
|
||||||
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
|
*
|
||||||
|
* As far as I am concerned, the code I have written for this software
|
||||||
|
* can be used freely for any purpose. Any derived versions of this
|
||||||
|
* software must be clearly marked as such, and if the derived work is
|
||||||
|
* incompatible with the protocol description in the RFC file, it must be
|
||||||
|
* called by a name other than "ssh" or "Secure Shell".
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// key_fingerprint_randomart comitted by Alexander von Gernler in rev 1.70
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_RANDOMART_H
|
||||||
|
#define _HAVE_PCP_RANDOMART_H
|
||||||
|
|
||||||
|
#include "mem.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
// from openssh key.c
|
||||||
|
|
||||||
|
#ifndef MAX
|
||||||
|
# define MAX(a,b) (((a)>(b))?(a):(b))
|
||||||
|
# define MIN(a,b) (((a)<(b))?(a):(b))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
char *key_fingerprint_randomart(unsigned char *dgst_raw, unsigned int dgst_raw_len);
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_RANDOMART_H
|
||||||
948
include/pcp/uthash.h
Executable file
948
include/pcp/uthash.h
Executable file
@@ -0,0 +1,948 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2013, Troy D. Hanson http://troydhanson.github.com/uthash/
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||||
|
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef UTHASH_H
|
||||||
|
#define UTHASH_H
|
||||||
|
|
||||||
|
#include <string.h> /* memcmp,strlen */
|
||||||
|
#include <stddef.h> /* ptrdiff_t */
|
||||||
|
#include <stdlib.h> /* exit() */
|
||||||
|
|
||||||
|
/* These macros use decltype or the earlier __typeof GNU extension.
|
||||||
|
As decltype is only available in newer compilers (VS2010 or gcc 4.3+
|
||||||
|
when compiling c++ source) this code uses whatever method is needed
|
||||||
|
or, for VS2008 where neither is available, uses casting workarounds. */
|
||||||
|
#ifdef _MSC_VER /* MS compiler */
|
||||||
|
#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */
|
||||||
|
#define DECLTYPE(x) (decltype(x))
|
||||||
|
#else /* VS2008 or older (or VS2010 in C mode) */
|
||||||
|
#define NO_DECLTYPE
|
||||||
|
#define DECLTYPE(x)
|
||||||
|
#endif
|
||||||
|
#else /* GNU, Sun and other compilers */
|
||||||
|
#define DECLTYPE(x) (__typeof(x))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NO_DECLTYPE
|
||||||
|
#define DECLTYPE_ASSIGN(dst,src) \
|
||||||
|
do { \
|
||||||
|
char **_da_dst = (char**)(&(dst)); \
|
||||||
|
*_da_dst = (char*)(src); \
|
||||||
|
} while(0)
|
||||||
|
#else
|
||||||
|
#define DECLTYPE_ASSIGN(dst,src) \
|
||||||
|
do { \
|
||||||
|
(dst) = DECLTYPE(dst)(src); \
|
||||||
|
} while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* a number of the hash function use uint32_t which isn't defined on win32 */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
typedef unsigned int uint32_t;
|
||||||
|
typedef unsigned char uint8_t;
|
||||||
|
#else
|
||||||
|
#include <inttypes.h> /* uint32_t */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define UTHASH_VERSION 1.9.8
|
||||||
|
|
||||||
|
#ifndef uthash_fatal
|
||||||
|
#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */
|
||||||
|
#endif
|
||||||
|
#ifndef uthash_malloc
|
||||||
|
#define uthash_malloc(sz) malloc(sz) /* malloc fcn */
|
||||||
|
#endif
|
||||||
|
#ifndef uthash_free
|
||||||
|
#define uthash_free(ptr,sz) free(ptr) /* free fcn */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef uthash_noexpand_fyi
|
||||||
|
#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */
|
||||||
|
#endif
|
||||||
|
#ifndef uthash_expand_fyi
|
||||||
|
#define uthash_expand_fyi(tbl) /* can be defined to log expands */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* initial number of buckets */
|
||||||
|
#define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */
|
||||||
|
#define HASH_INITIAL_NUM_BUCKETS_LOG2 5 /* lg2 of initial number of buckets */
|
||||||
|
#define HASH_BKT_CAPACITY_THRESH 10 /* expand when bucket count reaches */
|
||||||
|
|
||||||
|
/* calculate the element whose hash handle address is hhe */
|
||||||
|
#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))
|
||||||
|
|
||||||
|
#define HASH_FIND(hh,head,keyptr,keylen,out) \
|
||||||
|
do { \
|
||||||
|
unsigned _hf_bkt,_hf_hashv; \
|
||||||
|
out=NULL; \
|
||||||
|
if (head) { \
|
||||||
|
HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \
|
||||||
|
if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \
|
||||||
|
HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \
|
||||||
|
keyptr,keylen,out); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#ifdef HASH_BLOOM
|
||||||
|
#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM)
|
||||||
|
#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0)
|
||||||
|
#define HASH_BLOOM_MAKE(tbl) \
|
||||||
|
do { \
|
||||||
|
(tbl)->bloom_nbits = HASH_BLOOM; \
|
||||||
|
(tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \
|
||||||
|
if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \
|
||||||
|
memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \
|
||||||
|
(tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define HASH_BLOOM_FREE(tbl) \
|
||||||
|
do { \
|
||||||
|
uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8)))
|
||||||
|
#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8)))
|
||||||
|
|
||||||
|
#define HASH_BLOOM_ADD(tbl,hashv) \
|
||||||
|
HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))
|
||||||
|
|
||||||
|
#define HASH_BLOOM_TEST(tbl,hashv) \
|
||||||
|
HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))
|
||||||
|
|
||||||
|
#else
|
||||||
|
#define HASH_BLOOM_MAKE(tbl)
|
||||||
|
#define HASH_BLOOM_FREE(tbl)
|
||||||
|
#define HASH_BLOOM_ADD(tbl,hashv)
|
||||||
|
#define HASH_BLOOM_TEST(tbl,hashv) (1)
|
||||||
|
#define HASH_BLOOM_BYTELEN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define HASH_MAKE_TABLE(hh,head) \
|
||||||
|
do { \
|
||||||
|
(head)->hh.tbl = (UT_hash_table*)uthash_malloc( \
|
||||||
|
sizeof(UT_hash_table)); \
|
||||||
|
if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \
|
||||||
|
memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \
|
||||||
|
(head)->hh.tbl->tail = &((head)->hh); \
|
||||||
|
(head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \
|
||||||
|
(head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \
|
||||||
|
(head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \
|
||||||
|
(head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \
|
||||||
|
HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \
|
||||||
|
if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \
|
||||||
|
memset((head)->hh.tbl->buckets, 0, \
|
||||||
|
HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \
|
||||||
|
HASH_BLOOM_MAKE((head)->hh.tbl); \
|
||||||
|
(head)->hh.tbl->signature = HASH_SIGNATURE; \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define HASH_ADD(hh,head,fieldname,keylen_in,add) \
|
||||||
|
HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add)
|
||||||
|
|
||||||
|
#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \
|
||||||
|
do { \
|
||||||
|
replaced=NULL; \
|
||||||
|
HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced); \
|
||||||
|
if (replaced!=NULL) { \
|
||||||
|
HASH_DELETE(hh,head,replaced); \
|
||||||
|
}; \
|
||||||
|
HASH_ADD(hh,head,fieldname,keylen_in,add); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \
|
||||||
|
do { \
|
||||||
|
unsigned _ha_bkt; \
|
||||||
|
(add)->hh.next = NULL; \
|
||||||
|
(add)->hh.key = (char*)(keyptr); \
|
||||||
|
(add)->hh.keylen = (unsigned)(keylen_in); \
|
||||||
|
if (!(head)) { \
|
||||||
|
head = (add); \
|
||||||
|
(head)->hh.prev = NULL; \
|
||||||
|
HASH_MAKE_TABLE(hh,head); \
|
||||||
|
} else { \
|
||||||
|
(head)->hh.tbl->tail->next = (add); \
|
||||||
|
(add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \
|
||||||
|
(head)->hh.tbl->tail = &((add)->hh); \
|
||||||
|
} \
|
||||||
|
(head)->hh.tbl->num_items++; \
|
||||||
|
(add)->hh.tbl = (head)->hh.tbl; \
|
||||||
|
HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \
|
||||||
|
(add)->hh.hashv, _ha_bkt); \
|
||||||
|
HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \
|
||||||
|
HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \
|
||||||
|
HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \
|
||||||
|
HASH_FSCK(hh,head); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define HASH_TO_BKT( hashv, num_bkts, bkt ) \
|
||||||
|
do { \
|
||||||
|
bkt = ((hashv) & ((num_bkts) - 1)); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
/* delete "delptr" from the hash table.
|
||||||
|
* "the usual" patch-up process for the app-order doubly-linked-list.
|
||||||
|
* The use of _hd_hh_del below deserves special explanation.
|
||||||
|
* These used to be expressed using (delptr) but that led to a bug
|
||||||
|
* if someone used the same symbol for the head and deletee, like
|
||||||
|
* HASH_DELETE(hh,users,users);
|
||||||
|
* We want that to work, but by changing the head (users) below
|
||||||
|
* we were forfeiting our ability to further refer to the deletee (users)
|
||||||
|
* in the patch-up process. Solution: use scratch space to
|
||||||
|
* copy the deletee pointer, then the latter references are via that
|
||||||
|
* scratch pointer rather than through the repointed (users) symbol.
|
||||||
|
*/
|
||||||
|
#define HASH_DELETE(hh,head,delptr) \
|
||||||
|
do { \
|
||||||
|
unsigned _hd_bkt; \
|
||||||
|
struct UT_hash_handle *_hd_hh_del; \
|
||||||
|
if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \
|
||||||
|
uthash_free((head)->hh.tbl->buckets, \
|
||||||
|
(head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \
|
||||||
|
HASH_BLOOM_FREE((head)->hh.tbl); \
|
||||||
|
uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
|
||||||
|
head = NULL; \
|
||||||
|
} else { \
|
||||||
|
_hd_hh_del = &((delptr)->hh); \
|
||||||
|
if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \
|
||||||
|
(head)->hh.tbl->tail = \
|
||||||
|
(UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \
|
||||||
|
(head)->hh.tbl->hho); \
|
||||||
|
} \
|
||||||
|
if ((delptr)->hh.prev) { \
|
||||||
|
((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \
|
||||||
|
(head)->hh.tbl->hho))->next = (delptr)->hh.next; \
|
||||||
|
} else { \
|
||||||
|
DECLTYPE_ASSIGN(head,(delptr)->hh.next); \
|
||||||
|
} \
|
||||||
|
if (_hd_hh_del->next) { \
|
||||||
|
((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \
|
||||||
|
(head)->hh.tbl->hho))->prev = \
|
||||||
|
_hd_hh_del->prev; \
|
||||||
|
} \
|
||||||
|
HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \
|
||||||
|
HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \
|
||||||
|
(head)->hh.tbl->num_items--; \
|
||||||
|
} \
|
||||||
|
HASH_FSCK(hh,head); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */
|
||||||
|
#define HASH_FIND_STR(head,findstr,out) \
|
||||||
|
HASH_FIND(hh,head,findstr,strlen(findstr),out)
|
||||||
|
#define HASH_ADD_STR(head,strfield,add) \
|
||||||
|
HASH_ADD(hh,head,strfield,strlen(add->strfield),add)
|
||||||
|
#define HASH_REPLACE_STR(head,strfield,add,replaced) \
|
||||||
|
HASH_REPLACE(hh,head,strfield,strlen(add->strfield),add,replaced)
|
||||||
|
#define HASH_FIND_INT(head,findint,out) \
|
||||||
|
HASH_FIND(hh,head,findint,sizeof(int),out)
|
||||||
|
#define HASH_ADD_INT(head,intfield,add) \
|
||||||
|
HASH_ADD(hh,head,intfield,sizeof(int),add)
|
||||||
|
#define HASH_REPLACE_INT(head,intfield,add,replaced) \
|
||||||
|
HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced)
|
||||||
|
#define HASH_FIND_PTR(head,findptr,out) \
|
||||||
|
HASH_FIND(hh,head,findptr,sizeof(void *),out)
|
||||||
|
#define HASH_ADD_PTR(head,ptrfield,add) \
|
||||||
|
HASH_ADD(hh,head,ptrfield,sizeof(void *),add)
|
||||||
|
#define HASH_REPLACE_PTR(head,ptrfield,add) \
|
||||||
|
HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced)
|
||||||
|
#define HASH_DEL(head,delptr) \
|
||||||
|
HASH_DELETE(hh,head,delptr)
|
||||||
|
|
||||||
|
/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.
|
||||||
|
* This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.
|
||||||
|
*/
|
||||||
|
#ifdef HASH_DEBUG
|
||||||
|
#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
|
||||||
|
#define HASH_FSCK(hh,head) \
|
||||||
|
do { \
|
||||||
|
unsigned _bkt_i; \
|
||||||
|
unsigned _count, _bkt_count; \
|
||||||
|
char *_prev; \
|
||||||
|
struct UT_hash_handle *_thh; \
|
||||||
|
if (head) { \
|
||||||
|
_count = 0; \
|
||||||
|
for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \
|
||||||
|
_bkt_count = 0; \
|
||||||
|
_thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \
|
||||||
|
_prev = NULL; \
|
||||||
|
while (_thh) { \
|
||||||
|
if (_prev != (char*)(_thh->hh_prev)) { \
|
||||||
|
HASH_OOPS("invalid hh_prev %p, actual %p\n", \
|
||||||
|
_thh->hh_prev, _prev ); \
|
||||||
|
} \
|
||||||
|
_bkt_count++; \
|
||||||
|
_prev = (char*)(_thh); \
|
||||||
|
_thh = _thh->hh_next; \
|
||||||
|
} \
|
||||||
|
_count += _bkt_count; \
|
||||||
|
if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \
|
||||||
|
HASH_OOPS("invalid bucket count %d, actual %d\n", \
|
||||||
|
(head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
if (_count != (head)->hh.tbl->num_items) { \
|
||||||
|
HASH_OOPS("invalid hh item count %d, actual %d\n", \
|
||||||
|
(head)->hh.tbl->num_items, _count ); \
|
||||||
|
} \
|
||||||
|
/* traverse hh in app order; check next/prev integrity, count */ \
|
||||||
|
_count = 0; \
|
||||||
|
_prev = NULL; \
|
||||||
|
_thh = &(head)->hh; \
|
||||||
|
while (_thh) { \
|
||||||
|
_count++; \
|
||||||
|
if (_prev !=(char*)(_thh->prev)) { \
|
||||||
|
HASH_OOPS("invalid prev %p, actual %p\n", \
|
||||||
|
_thh->prev, _prev ); \
|
||||||
|
} \
|
||||||
|
_prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \
|
||||||
|
_thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \
|
||||||
|
(head)->hh.tbl->hho) : NULL ); \
|
||||||
|
} \
|
||||||
|
if (_count != (head)->hh.tbl->num_items) { \
|
||||||
|
HASH_OOPS("invalid app item count %d, actual %d\n", \
|
||||||
|
(head)->hh.tbl->num_items, _count ); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
#else
|
||||||
|
#define HASH_FSCK(hh,head)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to
|
||||||
|
* the descriptor to which this macro is defined for tuning the hash function.
|
||||||
|
* The app can #include <unistd.h> to get the prototype for write(2). */
|
||||||
|
#ifdef HASH_EMIT_KEYS
|
||||||
|
#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \
|
||||||
|
do { \
|
||||||
|
unsigned _klen = fieldlen; \
|
||||||
|
write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \
|
||||||
|
write(HASH_EMIT_KEYS, keyptr, fieldlen); \
|
||||||
|
} while (0)
|
||||||
|
#else
|
||||||
|
#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */
|
||||||
|
#ifdef HASH_FUNCTION
|
||||||
|
#define HASH_FCN HASH_FUNCTION
|
||||||
|
#else
|
||||||
|
#define HASH_FCN HASH_JEN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The Bernstein hash function, used in Perl prior to v5.6 */
|
||||||
|
#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \
|
||||||
|
do { \
|
||||||
|
unsigned _hb_keylen=keylen; \
|
||||||
|
char *_hb_key=(char*)(key); \
|
||||||
|
(hashv) = 0; \
|
||||||
|
while (_hb_keylen--) { (hashv) = ((hashv) * 33) + *_hb_key++; } \
|
||||||
|
bkt = (hashv) & (num_bkts-1); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at
|
||||||
|
* http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */
|
||||||
|
#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \
|
||||||
|
do { \
|
||||||
|
unsigned _sx_i; \
|
||||||
|
char *_hs_key=(char*)(key); \
|
||||||
|
hashv = 0; \
|
||||||
|
for(_sx_i=0; _sx_i < keylen; _sx_i++) \
|
||||||
|
hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \
|
||||||
|
bkt = hashv & (num_bkts-1); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \
|
||||||
|
do { \
|
||||||
|
unsigned _fn_i; \
|
||||||
|
char *_hf_key=(char*)(key); \
|
||||||
|
hashv = 2166136261UL; \
|
||||||
|
for(_fn_i=0; _fn_i < keylen; _fn_i++) \
|
||||||
|
hashv = (hashv * 16777619) ^ _hf_key[_fn_i]; \
|
||||||
|
bkt = hashv & (num_bkts-1); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \
|
||||||
|
do { \
|
||||||
|
unsigned _ho_i; \
|
||||||
|
char *_ho_key=(char*)(key); \
|
||||||
|
hashv = 0; \
|
||||||
|
for(_ho_i=0; _ho_i < keylen; _ho_i++) { \
|
||||||
|
hashv += _ho_key[_ho_i]; \
|
||||||
|
hashv += (hashv << 10); \
|
||||||
|
hashv ^= (hashv >> 6); \
|
||||||
|
} \
|
||||||
|
hashv += (hashv << 3); \
|
||||||
|
hashv ^= (hashv >> 11); \
|
||||||
|
hashv += (hashv << 15); \
|
||||||
|
bkt = hashv & (num_bkts-1); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define HASH_JEN_MIX(a,b,c) \
|
||||||
|
do { \
|
||||||
|
a -= b; a -= c; a ^= ( c >> 13 ); \
|
||||||
|
b -= c; b -= a; b ^= ( a << 8 ); \
|
||||||
|
c -= a; c -= b; c ^= ( b >> 13 ); \
|
||||||
|
a -= b; a -= c; a ^= ( c >> 12 ); \
|
||||||
|
b -= c; b -= a; b ^= ( a << 16 ); \
|
||||||
|
c -= a; c -= b; c ^= ( b >> 5 ); \
|
||||||
|
a -= b; a -= c; a ^= ( c >> 3 ); \
|
||||||
|
b -= c; b -= a; b ^= ( a << 10 ); \
|
||||||
|
c -= a; c -= b; c ^= ( b >> 15 ); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \
|
||||||
|
do { \
|
||||||
|
unsigned _hj_i,_hj_j,_hj_k; \
|
||||||
|
unsigned char *_hj_key=(unsigned char*)(key); \
|
||||||
|
hashv = 0xfeedbeef; \
|
||||||
|
_hj_i = _hj_j = 0x9e3779b9; \
|
||||||
|
_hj_k = (unsigned)(keylen); \
|
||||||
|
while (_hj_k >= 12) { \
|
||||||
|
_hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \
|
||||||
|
+ ( (unsigned)_hj_key[2] << 16 ) \
|
||||||
|
+ ( (unsigned)_hj_key[3] << 24 ) ); \
|
||||||
|
_hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \
|
||||||
|
+ ( (unsigned)_hj_key[6] << 16 ) \
|
||||||
|
+ ( (unsigned)_hj_key[7] << 24 ) ); \
|
||||||
|
hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \
|
||||||
|
+ ( (unsigned)_hj_key[10] << 16 ) \
|
||||||
|
+ ( (unsigned)_hj_key[11] << 24 ) ); \
|
||||||
|
\
|
||||||
|
HASH_JEN_MIX(_hj_i, _hj_j, hashv); \
|
||||||
|
\
|
||||||
|
_hj_key += 12; \
|
||||||
|
_hj_k -= 12; \
|
||||||
|
} \
|
||||||
|
hashv += keylen; \
|
||||||
|
switch ( _hj_k ) { \
|
||||||
|
case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); \
|
||||||
|
case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); \
|
||||||
|
case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); \
|
||||||
|
case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); \
|
||||||
|
case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); \
|
||||||
|
case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); \
|
||||||
|
case 5: _hj_j += _hj_key[4]; \
|
||||||
|
case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); \
|
||||||
|
case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); \
|
||||||
|
case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); \
|
||||||
|
case 1: _hj_i += _hj_key[0]; \
|
||||||
|
} \
|
||||||
|
HASH_JEN_MIX(_hj_i, _hj_j, hashv); \
|
||||||
|
bkt = hashv & (num_bkts-1); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
/* The Paul Hsieh hash function */
|
||||||
|
#undef get16bits
|
||||||
|
#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
|
||||||
|
|| defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
|
||||||
|
#define get16bits(d) (*((const uint16_t *) (d)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined (get16bits)
|
||||||
|
#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \
|
||||||
|
+(uint32_t)(((const uint8_t *)(d))[0]) )
|
||||||
|
#endif
|
||||||
|
#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \
|
||||||
|
do { \
|
||||||
|
unsigned char *_sfh_key=(unsigned char*)(key); \
|
||||||
|
uint32_t _sfh_tmp, _sfh_len = keylen; \
|
||||||
|
\
|
||||||
|
int _sfh_rem = _sfh_len & 3; \
|
||||||
|
_sfh_len >>= 2; \
|
||||||
|
hashv = 0xcafebabe; \
|
||||||
|
\
|
||||||
|
/* Main loop */ \
|
||||||
|
for (;_sfh_len > 0; _sfh_len--) { \
|
||||||
|
hashv += get16bits (_sfh_key); \
|
||||||
|
_sfh_tmp = (uint32_t)(get16bits (_sfh_key+2)) << 11 ^ hashv; \
|
||||||
|
hashv = (hashv << 16) ^ _sfh_tmp; \
|
||||||
|
_sfh_key += 2*sizeof (uint16_t); \
|
||||||
|
hashv += hashv >> 11; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* Handle end cases */ \
|
||||||
|
switch (_sfh_rem) { \
|
||||||
|
case 3: hashv += get16bits (_sfh_key); \
|
||||||
|
hashv ^= hashv << 16; \
|
||||||
|
hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)] << 18); \
|
||||||
|
hashv += hashv >> 11; \
|
||||||
|
break; \
|
||||||
|
case 2: hashv += get16bits (_sfh_key); \
|
||||||
|
hashv ^= hashv << 11; \
|
||||||
|
hashv += hashv >> 17; \
|
||||||
|
break; \
|
||||||
|
case 1: hashv += *_sfh_key; \
|
||||||
|
hashv ^= hashv << 10; \
|
||||||
|
hashv += hashv >> 1; \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
/* Force "avalanching" of final 127 bits */ \
|
||||||
|
hashv ^= hashv << 3; \
|
||||||
|
hashv += hashv >> 5; \
|
||||||
|
hashv ^= hashv << 4; \
|
||||||
|
hashv += hashv >> 17; \
|
||||||
|
hashv ^= hashv << 25; \
|
||||||
|
hashv += hashv >> 6; \
|
||||||
|
bkt = hashv & (num_bkts-1); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#ifdef HASH_USING_NO_STRICT_ALIASING
|
||||||
|
/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads.
|
||||||
|
* For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error.
|
||||||
|
* MurmurHash uses the faster approach only on CPU's where we know it's safe.
|
||||||
|
*
|
||||||
|
* Note the preprocessor built-in defines can be emitted using:
|
||||||
|
*
|
||||||
|
* gcc -m64 -dM -E - < /dev/null (on gcc)
|
||||||
|
* cc -## a.c (where a.c is a simple test file) (Sun Studio)
|
||||||
|
*/
|
||||||
|
#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86))
|
||||||
|
#define MUR_GETBLOCK(p,i) p[i]
|
||||||
|
#else /* non intel */
|
||||||
|
#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0)
|
||||||
|
#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1)
|
||||||
|
#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2)
|
||||||
|
#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3)
|
||||||
|
#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))
|
||||||
|
#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))
|
||||||
|
#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))
|
||||||
|
#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))
|
||||||
|
#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8))
|
||||||
|
#else /* assume little endian non-intel */
|
||||||
|
#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24))
|
||||||
|
#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16))
|
||||||
|
#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8))
|
||||||
|
#endif
|
||||||
|
#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \
|
||||||
|
(MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \
|
||||||
|
(MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \
|
||||||
|
MUR_ONE_THREE(p))))
|
||||||
|
#endif
|
||||||
|
#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))
|
||||||
|
#define MUR_FMIX(_h) \
|
||||||
|
do { \
|
||||||
|
_h ^= _h >> 16; \
|
||||||
|
_h *= 0x85ebca6b; \
|
||||||
|
_h ^= _h >> 13; \
|
||||||
|
_h *= 0xc2b2ae35l; \
|
||||||
|
_h ^= _h >> 16; \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \
|
||||||
|
do { \
|
||||||
|
const uint8_t *_mur_data = (const uint8_t*)(key); \
|
||||||
|
const int _mur_nblocks = (keylen) / 4; \
|
||||||
|
uint32_t _mur_h1 = 0xf88D5353; \
|
||||||
|
uint32_t _mur_c1 = 0xcc9e2d51; \
|
||||||
|
uint32_t _mur_c2 = 0x1b873593; \
|
||||||
|
uint32_t _mur_k1 = 0; \
|
||||||
|
const uint8_t *_mur_tail; \
|
||||||
|
const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \
|
||||||
|
int _mur_i; \
|
||||||
|
for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) { \
|
||||||
|
_mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \
|
||||||
|
_mur_k1 *= _mur_c1; \
|
||||||
|
_mur_k1 = MUR_ROTL32(_mur_k1,15); \
|
||||||
|
_mur_k1 *= _mur_c2; \
|
||||||
|
\
|
||||||
|
_mur_h1 ^= _mur_k1; \
|
||||||
|
_mur_h1 = MUR_ROTL32(_mur_h1,13); \
|
||||||
|
_mur_h1 = _mur_h1*5+0xe6546b64; \
|
||||||
|
} \
|
||||||
|
_mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \
|
||||||
|
_mur_k1=0; \
|
||||||
|
switch((keylen) & 3) { \
|
||||||
|
case 3: _mur_k1 ^= _mur_tail[2] << 16; \
|
||||||
|
case 2: _mur_k1 ^= _mur_tail[1] << 8; \
|
||||||
|
case 1: _mur_k1 ^= _mur_tail[0]; \
|
||||||
|
_mur_k1 *= _mur_c1; \
|
||||||
|
_mur_k1 = MUR_ROTL32(_mur_k1,15); \
|
||||||
|
_mur_k1 *= _mur_c2; \
|
||||||
|
_mur_h1 ^= _mur_k1; \
|
||||||
|
} \
|
||||||
|
_mur_h1 ^= (keylen); \
|
||||||
|
MUR_FMIX(_mur_h1); \
|
||||||
|
hashv = _mur_h1; \
|
||||||
|
bkt = hashv & (num_bkts-1); \
|
||||||
|
} while(0)
|
||||||
|
#endif /* HASH_USING_NO_STRICT_ALIASING */
|
||||||
|
|
||||||
|
/* key comparison function; return 0 if keys equal */
|
||||||
|
#define HASH_KEYCMP(a,b,len) memcmp(a,b,len)
|
||||||
|
|
||||||
|
/* iterate over items in a known bucket to find desired item */
|
||||||
|
#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \
|
||||||
|
do { \
|
||||||
|
if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); \
|
||||||
|
else out=NULL; \
|
||||||
|
while (out) { \
|
||||||
|
if ((out)->hh.keylen == keylen_in) { \
|
||||||
|
if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break; \
|
||||||
|
} \
|
||||||
|
if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \
|
||||||
|
else out = NULL; \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
/* add an item to a bucket */
|
||||||
|
#define HASH_ADD_TO_BKT(head,addhh) \
|
||||||
|
do { \
|
||||||
|
head.count++; \
|
||||||
|
(addhh)->hh_next = head.hh_head; \
|
||||||
|
(addhh)->hh_prev = NULL; \
|
||||||
|
if (head.hh_head) { (head).hh_head->hh_prev = (addhh); } \
|
||||||
|
(head).hh_head=addhh; \
|
||||||
|
if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH) \
|
||||||
|
&& (addhh)->tbl->noexpand != 1) { \
|
||||||
|
HASH_EXPAND_BUCKETS((addhh)->tbl); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
/* remove an item from a given bucket */
|
||||||
|
#define HASH_DEL_IN_BKT(hh,head,hh_del) \
|
||||||
|
(head).count--; \
|
||||||
|
if ((head).hh_head == hh_del) { \
|
||||||
|
(head).hh_head = hh_del->hh_next; \
|
||||||
|
} \
|
||||||
|
if (hh_del->hh_prev) { \
|
||||||
|
hh_del->hh_prev->hh_next = hh_del->hh_next; \
|
||||||
|
} \
|
||||||
|
if (hh_del->hh_next) { \
|
||||||
|
hh_del->hh_next->hh_prev = hh_del->hh_prev; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bucket expansion has the effect of doubling the number of buckets
|
||||||
|
* and redistributing the items into the new buckets. Ideally the
|
||||||
|
* items will distribute more or less evenly into the new buckets
|
||||||
|
* (the extent to which this is true is a measure of the quality of
|
||||||
|
* the hash function as it applies to the key domain).
|
||||||
|
*
|
||||||
|
* With the items distributed into more buckets, the chain length
|
||||||
|
* (item count) in each bucket is reduced. Thus by expanding buckets
|
||||||
|
* the hash keeps a bound on the chain length. This bounded chain
|
||||||
|
* length is the essence of how a hash provides constant time lookup.
|
||||||
|
*
|
||||||
|
* The calculation of tbl->ideal_chain_maxlen below deserves some
|
||||||
|
* explanation. First, keep in mind that we're calculating the ideal
|
||||||
|
* maximum chain length based on the *new* (doubled) bucket count.
|
||||||
|
* In fractions this is just n/b (n=number of items,b=new num buckets).
|
||||||
|
* Since the ideal chain length is an integer, we want to calculate
|
||||||
|
* ceil(n/b). We don't depend on floating point arithmetic in this
|
||||||
|
* hash, so to calculate ceil(n/b) with integers we could write
|
||||||
|
*
|
||||||
|
* ceil(n/b) = (n/b) + ((n%b)?1:0)
|
||||||
|
*
|
||||||
|
* and in fact a previous version of this hash did just that.
|
||||||
|
* But now we have improved things a bit by recognizing that b is
|
||||||
|
* always a power of two. We keep its base 2 log handy (call it lb),
|
||||||
|
* so now we can write this with a bit shift and logical AND:
|
||||||
|
*
|
||||||
|
* ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define HASH_EXPAND_BUCKETS(tbl) \
|
||||||
|
do { \
|
||||||
|
unsigned _he_bkt; \
|
||||||
|
unsigned _he_bkt_i; \
|
||||||
|
struct UT_hash_handle *_he_thh, *_he_hh_nxt; \
|
||||||
|
UT_hash_bucket *_he_new_buckets, *_he_newbkt; \
|
||||||
|
_he_new_buckets = (UT_hash_bucket*)uthash_malloc( \
|
||||||
|
2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \
|
||||||
|
if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \
|
||||||
|
memset(_he_new_buckets, 0, \
|
||||||
|
2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \
|
||||||
|
tbl->ideal_chain_maxlen = \
|
||||||
|
(tbl->num_items >> (tbl->log2_num_buckets+1)) + \
|
||||||
|
((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0); \
|
||||||
|
tbl->nonideal_items = 0; \
|
||||||
|
for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \
|
||||||
|
{ \
|
||||||
|
_he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \
|
||||||
|
while (_he_thh) { \
|
||||||
|
_he_hh_nxt = _he_thh->hh_next; \
|
||||||
|
HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt); \
|
||||||
|
_he_newbkt = &(_he_new_buckets[ _he_bkt ]); \
|
||||||
|
if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \
|
||||||
|
tbl->nonideal_items++; \
|
||||||
|
_he_newbkt->expand_mult = _he_newbkt->count / \
|
||||||
|
tbl->ideal_chain_maxlen; \
|
||||||
|
} \
|
||||||
|
_he_thh->hh_prev = NULL; \
|
||||||
|
_he_thh->hh_next = _he_newbkt->hh_head; \
|
||||||
|
if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev = \
|
||||||
|
_he_thh; \
|
||||||
|
_he_newbkt->hh_head = _he_thh; \
|
||||||
|
_he_thh = _he_hh_nxt; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \
|
||||||
|
tbl->num_buckets *= 2; \
|
||||||
|
tbl->log2_num_buckets++; \
|
||||||
|
tbl->buckets = _he_new_buckets; \
|
||||||
|
tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \
|
||||||
|
(tbl->ineff_expands+1) : 0; \
|
||||||
|
if (tbl->ineff_expands > 1) { \
|
||||||
|
tbl->noexpand=1; \
|
||||||
|
uthash_noexpand_fyi(tbl); \
|
||||||
|
} \
|
||||||
|
uthash_expand_fyi(tbl); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
|
/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */
|
||||||
|
/* Note that HASH_SORT assumes the hash handle name to be hh.
|
||||||
|
* HASH_SRT was added to allow the hash handle name to be passed in. */
|
||||||
|
#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn)
|
||||||
|
#define HASH_SRT(hh,head,cmpfcn) \
|
||||||
|
do { \
|
||||||
|
unsigned _hs_i; \
|
||||||
|
unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \
|
||||||
|
struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \
|
||||||
|
if (head) { \
|
||||||
|
_hs_insize = 1; \
|
||||||
|
_hs_looping = 1; \
|
||||||
|
_hs_list = &((head)->hh); \
|
||||||
|
while (_hs_looping) { \
|
||||||
|
_hs_p = _hs_list; \
|
||||||
|
_hs_list = NULL; \
|
||||||
|
_hs_tail = NULL; \
|
||||||
|
_hs_nmerges = 0; \
|
||||||
|
while (_hs_p) { \
|
||||||
|
_hs_nmerges++; \
|
||||||
|
_hs_q = _hs_p; \
|
||||||
|
_hs_psize = 0; \
|
||||||
|
for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \
|
||||||
|
_hs_psize++; \
|
||||||
|
_hs_q = (UT_hash_handle*)((_hs_q->next) ? \
|
||||||
|
((void*)((char*)(_hs_q->next) + \
|
||||||
|
(head)->hh.tbl->hho)) : NULL); \
|
||||||
|
if (! (_hs_q) ) break; \
|
||||||
|
} \
|
||||||
|
_hs_qsize = _hs_insize; \
|
||||||
|
while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) { \
|
||||||
|
if (_hs_psize == 0) { \
|
||||||
|
_hs_e = _hs_q; \
|
||||||
|
_hs_q = (UT_hash_handle*)((_hs_q->next) ? \
|
||||||
|
((void*)((char*)(_hs_q->next) + \
|
||||||
|
(head)->hh.tbl->hho)) : NULL); \
|
||||||
|
_hs_qsize--; \
|
||||||
|
} else if ( (_hs_qsize == 0) || !(_hs_q) ) { \
|
||||||
|
_hs_e = _hs_p; \
|
||||||
|
if (_hs_p){ \
|
||||||
|
_hs_p = (UT_hash_handle*)((_hs_p->next) ? \
|
||||||
|
((void*)((char*)(_hs_p->next) + \
|
||||||
|
(head)->hh.tbl->hho)) : NULL); \
|
||||||
|
} \
|
||||||
|
_hs_psize--; \
|
||||||
|
} else if (( \
|
||||||
|
cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \
|
||||||
|
DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \
|
||||||
|
) <= 0) { \
|
||||||
|
_hs_e = _hs_p; \
|
||||||
|
if (_hs_p){ \
|
||||||
|
_hs_p = (UT_hash_handle*)((_hs_p->next) ? \
|
||||||
|
((void*)((char*)(_hs_p->next) + \
|
||||||
|
(head)->hh.tbl->hho)) : NULL); \
|
||||||
|
} \
|
||||||
|
_hs_psize--; \
|
||||||
|
} else { \
|
||||||
|
_hs_e = _hs_q; \
|
||||||
|
_hs_q = (UT_hash_handle*)((_hs_q->next) ? \
|
||||||
|
((void*)((char*)(_hs_q->next) + \
|
||||||
|
(head)->hh.tbl->hho)) : NULL); \
|
||||||
|
_hs_qsize--; \
|
||||||
|
} \
|
||||||
|
if ( _hs_tail ) { \
|
||||||
|
_hs_tail->next = ((_hs_e) ? \
|
||||||
|
ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \
|
||||||
|
} else { \
|
||||||
|
_hs_list = _hs_e; \
|
||||||
|
} \
|
||||||
|
if (_hs_e) { \
|
||||||
|
_hs_e->prev = ((_hs_tail) ? \
|
||||||
|
ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \
|
||||||
|
} \
|
||||||
|
_hs_tail = _hs_e; \
|
||||||
|
} \
|
||||||
|
_hs_p = _hs_q; \
|
||||||
|
} \
|
||||||
|
if (_hs_tail){ \
|
||||||
|
_hs_tail->next = NULL; \
|
||||||
|
} \
|
||||||
|
if ( _hs_nmerges <= 1 ) { \
|
||||||
|
_hs_looping=0; \
|
||||||
|
(head)->hh.tbl->tail = _hs_tail; \
|
||||||
|
DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \
|
||||||
|
} \
|
||||||
|
_hs_insize *= 2; \
|
||||||
|
} \
|
||||||
|
HASH_FSCK(hh,head); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/* This function selects items from one hash into another hash.
|
||||||
|
* The end result is that the selected items have dual presence
|
||||||
|
* in both hashes. There is no copy of the items made; rather
|
||||||
|
* they are added into the new hash through a secondary hash
|
||||||
|
* hash handle that must be present in the structure. */
|
||||||
|
#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \
|
||||||
|
do { \
|
||||||
|
unsigned _src_bkt, _dst_bkt; \
|
||||||
|
void *_last_elt=NULL, *_elt; \
|
||||||
|
UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \
|
||||||
|
ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \
|
||||||
|
if (src) { \
|
||||||
|
for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \
|
||||||
|
for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \
|
||||||
|
_src_hh; \
|
||||||
|
_src_hh = _src_hh->hh_next) { \
|
||||||
|
_elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \
|
||||||
|
if (cond(_elt)) { \
|
||||||
|
_dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \
|
||||||
|
_dst_hh->key = _src_hh->key; \
|
||||||
|
_dst_hh->keylen = _src_hh->keylen; \
|
||||||
|
_dst_hh->hashv = _src_hh->hashv; \
|
||||||
|
_dst_hh->prev = _last_elt; \
|
||||||
|
_dst_hh->next = NULL; \
|
||||||
|
if (_last_elt_hh) { _last_elt_hh->next = _elt; } \
|
||||||
|
if (!dst) { \
|
||||||
|
DECLTYPE_ASSIGN(dst,_elt); \
|
||||||
|
HASH_MAKE_TABLE(hh_dst,dst); \
|
||||||
|
} else { \
|
||||||
|
_dst_hh->tbl = (dst)->hh_dst.tbl; \
|
||||||
|
} \
|
||||||
|
HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \
|
||||||
|
HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \
|
||||||
|
(dst)->hh_dst.tbl->num_items++; \
|
||||||
|
_last_elt = _elt; \
|
||||||
|
_last_elt_hh = _dst_hh; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
HASH_FSCK(hh_dst,dst); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define HASH_CLEAR(hh,head) \
|
||||||
|
do { \
|
||||||
|
if (head) { \
|
||||||
|
uthash_free((head)->hh.tbl->buckets, \
|
||||||
|
(head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \
|
||||||
|
HASH_BLOOM_FREE((head)->hh.tbl); \
|
||||||
|
uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
|
||||||
|
(head)=NULL; \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define HASH_OVERHEAD(hh,head) \
|
||||||
|
(size_t)((((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \
|
||||||
|
((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \
|
||||||
|
(sizeof(UT_hash_table)) + \
|
||||||
|
(HASH_BLOOM_BYTELEN)))
|
||||||
|
|
||||||
|
#ifdef NO_DECLTYPE
|
||||||
|
#define HASH_ITER(hh,head,el,tmp) \
|
||||||
|
for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \
|
||||||
|
el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL))
|
||||||
|
#else
|
||||||
|
#define HASH_ITER(hh,head,el,tmp) \
|
||||||
|
for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \
|
||||||
|
el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* obtain a count of items in the hash */
|
||||||
|
#define HASH_COUNT(head) HASH_CNT(hh,head)
|
||||||
|
#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0)
|
||||||
|
|
||||||
|
typedef struct UT_hash_bucket {
|
||||||
|
struct UT_hash_handle *hh_head;
|
||||||
|
unsigned count;
|
||||||
|
|
||||||
|
/* expand_mult is normally set to 0. In this situation, the max chain length
|
||||||
|
* threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If
|
||||||
|
* the bucket's chain exceeds this length, bucket expansion is triggered).
|
||||||
|
* However, setting expand_mult to a non-zero value delays bucket expansion
|
||||||
|
* (that would be triggered by additions to this particular bucket)
|
||||||
|
* until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.
|
||||||
|
* (The multiplier is simply expand_mult+1). The whole idea of this
|
||||||
|
* multiplier is to reduce bucket expansions, since they are expensive, in
|
||||||
|
* situations where we know that a particular bucket tends to be overused.
|
||||||
|
* It is better to let its chain length grow to a longer yet-still-bounded
|
||||||
|
* value, than to do an O(n) bucket expansion too often.
|
||||||
|
*/
|
||||||
|
unsigned expand_mult;
|
||||||
|
|
||||||
|
} UT_hash_bucket;
|
||||||
|
|
||||||
|
/* random signature used only to find hash tables in external analysis */
|
||||||
|
#define HASH_SIGNATURE 0xa0111fe1
|
||||||
|
#define HASH_BLOOM_SIGNATURE 0xb12220f2
|
||||||
|
|
||||||
|
typedef struct UT_hash_table {
|
||||||
|
UT_hash_bucket *buckets;
|
||||||
|
unsigned num_buckets, log2_num_buckets;
|
||||||
|
unsigned num_items;
|
||||||
|
struct UT_hash_handle *tail; /* tail hh in app order, for fast append */
|
||||||
|
ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */
|
||||||
|
|
||||||
|
/* in an ideal situation (all buckets used equally), no bucket would have
|
||||||
|
* more than ceil(#items/#buckets) items. that's the ideal chain length. */
|
||||||
|
unsigned ideal_chain_maxlen;
|
||||||
|
|
||||||
|
/* nonideal_items is the number of items in the hash whose chain position
|
||||||
|
* exceeds the ideal chain maxlen. these items pay the penalty for an uneven
|
||||||
|
* hash distribution; reaching them in a chain traversal takes >ideal steps */
|
||||||
|
unsigned nonideal_items;
|
||||||
|
|
||||||
|
/* ineffective expands occur when a bucket doubling was performed, but
|
||||||
|
* afterward, more than half the items in the hash had nonideal chain
|
||||||
|
* positions. If this happens on two consecutive expansions we inhibit any
|
||||||
|
* further expansion, as it's not helping; this happens when the hash
|
||||||
|
* function isn't a good fit for the key domain. When expansion is inhibited
|
||||||
|
* the hash will still work, albeit no longer in constant time. */
|
||||||
|
unsigned ineff_expands, noexpand;
|
||||||
|
|
||||||
|
uint32_t signature; /* used only to find hash tables in external analysis */
|
||||||
|
#ifdef HASH_BLOOM
|
||||||
|
uint32_t bloom_sig; /* used only to test bloom exists in external analysis */
|
||||||
|
uint8_t *bloom_bv;
|
||||||
|
char bloom_nbits;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} UT_hash_table;
|
||||||
|
|
||||||
|
typedef struct UT_hash_handle {
|
||||||
|
struct UT_hash_table *tbl;
|
||||||
|
void *prev; /* prev element in app order */
|
||||||
|
void *next; /* next element in app order */
|
||||||
|
struct UT_hash_handle *hh_prev; /* previous hh in bucket order */
|
||||||
|
struct UT_hash_handle *hh_next; /* next hh in bucket order */
|
||||||
|
void *key; /* ptr to enclosing struct's key */
|
||||||
|
unsigned keylen; /* enclosing struct's key len */
|
||||||
|
unsigned hashv; /* result of hash-fcn(key) */
|
||||||
|
} UT_hash_handle;
|
||||||
|
|
||||||
|
#endif /* UTHASH_H */
|
||||||
85
include/pcp/vault.h
Normal file
85
include/pcp/vault.h
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_VAULT
|
||||||
|
#define _HAVE_PCP_VAULT
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sodium.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
|
#include "platform.h"
|
||||||
|
#include "mem.h"
|
||||||
|
#include "key.h"
|
||||||
|
#include "uthash.h"
|
||||||
|
|
||||||
|
|
||||||
|
struct _vault_t {
|
||||||
|
char *filename;
|
||||||
|
FILE *fd;
|
||||||
|
uint8_t unsafed;
|
||||||
|
uint8_t isnew;
|
||||||
|
uint32_t size;
|
||||||
|
time_t modified;
|
||||||
|
mode_t mode;
|
||||||
|
uint32_t version;
|
||||||
|
byte checksum[32];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _vault_header_t {
|
||||||
|
byte fileid;
|
||||||
|
uint32_t version;
|
||||||
|
byte checksum[32];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _vault_item_header_t {
|
||||||
|
byte type;
|
||||||
|
uint32_t size;
|
||||||
|
uint32_t version;
|
||||||
|
byte checksum[32];
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _vault_t vault_t;
|
||||||
|
typedef struct _vault_header_t vault_header_t;
|
||||||
|
typedef struct _vault_item_header_t vault_item_header_t;
|
||||||
|
|
||||||
|
vault_t *pcpvault_init(char *filename);
|
||||||
|
vault_t *pcpvault_new(char *filename, int is_tmp);
|
||||||
|
int pcpvault_create(vault_t *vault);
|
||||||
|
int pcpvault_additem(vault_t *vault, void *item, size_t itemsize, uint8_t type, uint8_t do_hash);
|
||||||
|
int pcpvault_close(vault_t *vault);
|
||||||
|
int pcpvault_fetchall(vault_t *vault);
|
||||||
|
int pcpvault_writeall(vault_t *vault);
|
||||||
|
void pcpvault_copy(vault_t *tmp, vault_t *vault);
|
||||||
|
void pcpvault_unlink(vault_t *tmp);
|
||||||
|
unsigned char *pcpvault_create_checksum(vault_t *vault);
|
||||||
|
void pcpvault_update_checksum(vault_t *vault);
|
||||||
|
|
||||||
|
vault_header_t * vh2be(vault_header_t *h);
|
||||||
|
vault_header_t * vh2native(vault_header_t *h);
|
||||||
|
vault_item_header_t * ih2be(vault_item_header_t *h);
|
||||||
|
vault_item_header_t * ih2native(vault_item_header_t *h);
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_VAULT
|
||||||
37
include/pcp/version.h
Normal file
37
include/pcp/version.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _HAVE_PCP_VERSION
|
||||||
|
#define _HAVE_PCP_VERSION
|
||||||
|
|
||||||
|
#define PCP_VERSION_MAJOR 0
|
||||||
|
#define PCP_VERSION_MINOR 1
|
||||||
|
#define PCP_VERSION_PATCH 2
|
||||||
|
|
||||||
|
#define PCP_MAKE_VERSION(major, minor, patch) \
|
||||||
|
((major) * 10000 + (minor) * 100 + (patch))
|
||||||
|
#define PCP_VERSION \
|
||||||
|
PCP_MAKE_VERSION(PCP_VERSION_MAJOR, PCP_VERSION_MINOR, PCP_VERSION_PATCH)
|
||||||
|
|
||||||
|
int pcp_version();
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_VERSION
|
||||||
45
include/pcp/z85.h
Normal file
45
include/pcp/z85.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
This file is part of Pretty Curved Privacy (pcp1).
|
||||||
|
|
||||||
|
Copyright (C) 2013 T.Linden.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// from https://github.com/tlinden/curve-keygen/
|
||||||
|
#ifndef _HAVE_PCP_Z85_H
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
|
#include "zmq_z85.h"
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
|
// convert a binary stream to one which gets accepted by zmq_z85_encode
|
||||||
|
// we pad it with zeroes and put the number of zerores in front of it
|
||||||
|
unsigned char *pcp_unpadfour(unsigned char *src, size_t srclen, size_t *dstlen);
|
||||||
|
|
||||||
|
// the reverse of the above
|
||||||
|
unsigned char *pcp_unpadfour(unsigned char *src, size_t srclen, size_t *dstlen);
|
||||||
|
|
||||||
|
// wrapper around zmq Z85 encoding function
|
||||||
|
unsigned char *pcp_z85_decode(char *z85block, size_t *dstlen);
|
||||||
|
|
||||||
|
// the reverse of the above
|
||||||
|
char *pcp_z85_encode(unsigned char *raw, size_t srclen, size_t *dstlen);
|
||||||
|
|
||||||
|
char *pcp_readz85file(FILE *infile);
|
||||||
|
|
||||||
|
#endif // _HAVE_PCP_Z85_H
|
||||||
39
include/pcp/zmq_z85.h
Normal file
39
include/pcp/zmq_z85.h
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
|
||||||
|
|
||||||
|
This file is part of 0MQ.
|
||||||
|
|
||||||
|
0MQ is free software; you can redistribute it and/or modify it under
|
||||||
|
the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation; either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
0MQ is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ZMQ_Z85_H_INCLUDED__
|
||||||
|
#define __ZMQ_Z85_H_INCLUDED__
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint8_t *zmq_z85_decode (uint8_t *dest, char *string);
|
||||||
|
char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
#
|
#
|
||||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
#
|
#
|
||||||
AM_CFLAGS = -I../libpcp -Wall -g
|
AM_CFLAGS = -I../include/pcp -Wall -g
|
||||||
|
|
||||||
lib_LTLIBRARIES = libpcp1.la
|
lib_LTLIBRARIES = libpcp1.la
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Makefile.in generated by automake 1.12.4 from Makefile.am.
|
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||||
@@ -259,7 +259,7 @@ top_srcdir = @top_srcdir@
|
|||||||
#
|
#
|
||||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
#
|
#
|
||||||
AM_CFLAGS = -I../libpcp -Wall -g
|
AM_CFLAGS = -I../include/pcp -Wall -g
|
||||||
lib_LTLIBRARIES = libpcp1.la
|
lib_LTLIBRARIES = libpcp1.la
|
||||||
libpcp1_la_SOURCES = mac.c mem.c pad.c version.c \
|
libpcp1_la_SOURCES = mac.c mem.c pad.c version.c \
|
||||||
z85.c zmq_z85.c key.c randomart.c \
|
z85.c zmq_z85.c key.c randomart.c \
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Makefile.in generated by automake 1.12.4 from Makefile.am.
|
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
|
.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
|
||||||
.\"
|
.\"
|
||||||
.\" Standard preamble:
|
.\" Standard preamble:
|
||||||
.\" ========================================================================
|
.\" ========================================================================
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
.\" ========================================================================
|
.\" ========================================================================
|
||||||
.\"
|
.\"
|
||||||
.IX Title "PCP1 1"
|
.IX Title "PCP1 1"
|
||||||
.TH PCP1 1 "2013-11-04" "PCP 0.1.2" "USER CONTRIBUTED DOCUMENTATION"
|
.TH PCP1 1 "2013-11-07" "PCP 0.1.2" "USER CONTRIBUTED DOCUMENTATION"
|
||||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||||
.\" way too many mistakes in technical documents.
|
.\" way too many mistakes in technical documents.
|
||||||
.if n .ad l
|
.if n .ad l
|
||||||
|
|||||||
@@ -19,9 +19,8 @@
|
|||||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
#
|
#
|
||||||
|
|
||||||
EXTRA_DIST = z85util.c
|
|
||||||
|
|
||||||
AM_CFLAGS = -I../libpcp -Wall -g
|
AM_CFLAGS = -I../include/pcp -Wall -g
|
||||||
|
|
||||||
bin_PROGRAMS = pcp1
|
bin_PROGRAMS = pcp1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Makefile.in generated by automake 1.12.4 from Makefile.am.
|
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||||
@@ -229,8 +229,7 @@ target_alias = @target_alias@
|
|||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
EXTRA_DIST = z85util.c
|
AM_CFLAGS = -I../include/pcp -Wall -g
|
||||||
AM_CFLAGS = -I../libpcp -Wall -g
|
|
||||||
pcp1_LDADD = ../libpcp/.libs/libpcp1.a
|
pcp1_LDADD = ../libpcp/.libs/libpcp1.a
|
||||||
pcp1_SOURCES = pcp.c keymgmt.c keyprint.c readpass.c encryption.c z85util.c
|
pcp1_SOURCES = pcp.c keymgmt.c keyprint.c readpass.c encryption.c z85util.c
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
#
|
#
|
||||||
|
|
||||||
AM_CFLAGS = -I../libpcp -Wall -g
|
AM_CFLAGS = -I../include/pcp -Wall -g
|
||||||
check_PROGRAMS = col invalidkeys pwhashes
|
check_PROGRAMS = col invalidkeys pwhashes
|
||||||
|
|
||||||
col_LDADD = ../libpcp/.libs/libpcp1.a
|
col_LDADD = ../libpcp/.libs/libpcp1.a
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Makefile.in generated by automake 1.12.4 from Makefile.am.
|
# Makefile.in generated by automake 1.12.6 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||||
@@ -232,7 +232,7 @@ target_alias = @target_alias@
|
|||||||
top_build_prefix = @top_build_prefix@
|
top_build_prefix = @top_build_prefix@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
AM_CFLAGS = -I../libpcp -Wall -g
|
AM_CFLAGS = -I../include/pcp -Wall -g
|
||||||
col_LDADD = ../libpcp/.libs/libpcp1.a
|
col_LDADD = ../libpcp/.libs/libpcp1.a
|
||||||
col_SOURCES = collisions.c
|
col_SOURCES = collisions.c
|
||||||
invalidkeys_LDADD = ../libpcp/.libs/libpcp1.a ../src/keyprint.o
|
invalidkeys_LDADD = ../libpcp/.libs/libpcp1.a ../src/keyprint.o
|
||||||
|
|||||||
Reference in New Issue
Block a user