mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 20:00:58 +01:00
the normal autogen.sh run doesn't generate usage.h and other generated stuff on users machines. I pre-generate them here, where I know it works as I expect. This should fix issue#3, where on some linux machines generation of usage.h doesn't work which leads to a compiler error.
This commit is contained in:
122
autogen.sh
122
autogen.sh
@@ -1,71 +1,72 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cat <<EOF > clean.sh
|
mode=config
|
||||||
#!/bin/sh
|
|
||||||
find . -name Makefile -exec rm {} \; > /dev/null 2>&1
|
|
||||||
find . -name Makefile.in -exec rm {} \; > /dev/null 2>&1
|
|
||||||
find . -name "*~" -exec rm {} \; > /dev/null 2>&1
|
|
||||||
find . -name config.h -exec rm {} \; > /dev/null 2>&1
|
|
||||||
find . -name "stamp*" -exec rm {} \; > /dev/null 2>&1
|
|
||||||
find . -name .deps -exec rm -rf {} \; > /dev/null 2>&1
|
|
||||||
find . -name .libs -exec rm -rf {} \; > /dev/null 2>&1
|
|
||||||
find . -name .o -exec rm -rf {} \; > /dev/null 2>&1
|
|
||||||
find . -name .lo -exec rm -rf {} \; > /dev/null 2>&1
|
|
||||||
|
|
||||||
rm -rf aclocal.m4 libtool man/pcp1.1 configure config.* config autom4te.cache tests/test* tests/v* tests/stresstest/* libpcp/libpcp1.pc
|
case $1 in
|
||||||
rm clean.sh
|
clean)
|
||||||
EOF
|
mode=clean
|
||||||
|
;;
|
||||||
chmod 700 clean.sh
|
gen)
|
||||||
|
mode=gen
|
||||||
# generate the install include file
|
;;
|
||||||
(echo "#ifndef _HAVE_PCP"; echo "#define _HAVE_PCP"; echo) > include/pcp.h
|
-h|--help|help|\?)
|
||||||
(echo "#ifdef __cplusplus"; echo "extern \"C\" {"; echo "#endif"; echo) >> include/pcp.h
|
echo "Usage: $0 [clean|gen]"
|
||||||
echo "#include \"pcp/config.h\"" >> include/pcp.h
|
exit 1
|
||||||
|
;;
|
||||||
ls include/pcp/*.h | sed 's#include/##' | while read include; do
|
esac
|
||||||
echo "#include \"$include\"" >> include/pcp.h
|
|
||||||
done
|
|
||||||
|
|
||||||
(echo "#ifdef __cplusplus"; echo "}"; echo "#endif"; echo) >> include/pcp.h
|
|
||||||
(echo; echo "#endif") >> include/pcp.h
|
|
||||||
|
|
||||||
|
|
||||||
# generate the version file
|
if test "$mode" = "gen"; then
|
||||||
maj=`egrep "#define PCP_VERSION_MAJOR" include/pcp/version.h | awk '{print $3}'`
|
# generate the install include file
|
||||||
min=`egrep "#define PCP_VERSION_MINOR" include/pcp/version.h | awk '{print $3}'`
|
(echo "#ifndef _HAVE_PCP"; echo "#define _HAVE_PCP"; echo) > include/pcp.h
|
||||||
pat=`egrep "#define PCP_VERSION_PATCH" include/pcp/version.h | awk '{print $3}'`
|
(echo "#ifdef __cplusplus"; echo "extern \"C\" {"; echo "#endif"; echo) >> include/pcp.h
|
||||||
echo -n "$maj.$min.$pat" > VERSION
|
echo "#include \"pcp/config.h\"" >> include/pcp.h
|
||||||
|
|
||||||
# generate the manpage
|
ls include/pcp/*.h | sed 's#include/##' | while read include; do
|
||||||
echo "=head1 NAME
|
echo "#include \"$include\"" >> include/pcp.h
|
||||||
|
done
|
||||||
|
|
||||||
|
(echo "#ifdef __cplusplus"; echo "}"; echo "#endif"; echo) >> include/pcp.h
|
||||||
|
(echo; echo "#endif") >> include/pcp.h
|
||||||
|
|
||||||
|
|
||||||
|
# generate the version file
|
||||||
|
maj=`egrep "#define PCP_VERSION_MAJOR" include/pcp/version.h | awk '{print $3}'`
|
||||||
|
min=`egrep "#define PCP_VERSION_MINOR" include/pcp/version.h | awk '{print $3}'`
|
||||||
|
pat=`egrep "#define PCP_VERSION_PATCH" include/pcp/version.h | awk '{print $3}'`
|
||||||
|
echo -n "$maj.$min.$pat" > VERSION
|
||||||
|
|
||||||
|
# generate the manpage
|
||||||
|
echo "=head1 NAME
|
||||||
|
|
||||||
Pretty Curved Privacy - File encryption using eliptic curve cryptography.
|
Pretty Curved Privacy - File encryption using eliptic curve cryptography.
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
" > man/pcp1.pod
|
" > man/pcp1.pod
|
||||||
cat src/usage.txt | sed "s/^/ /g" >> man/pcp1.pod
|
cat src/usage.txt | sed "s/^/ /g" >> man/pcp1.pod
|
||||||
cat man/options.pod >> man/pcp1.pod
|
cat man/options.pod >> man/pcp1.pod
|
||||||
cat man/pcp.pod >> man/pcp1.pod
|
cat man/pcp.pod >> man/pcp1.pod
|
||||||
cat man/details.pod >> man/pcp1.pod
|
cat man/details.pod >> man/pcp1.pod
|
||||||
cat man/footer.pod >> man/pcp1.pod
|
cat man/footer.pod >> man/pcp1.pod
|
||||||
|
|
||||||
pod2man -r "PCP `cat VERSION`" -c "USER CONTRIBUTED DOCUMENTATION" man/pcp1.pod > man/pcp1.1
|
pod2man -r "PCP `cat VERSION`" -c "USER CONTRIBUTED DOCUMENTATION" man/pcp1.pod > man/pcp1.1
|
||||||
|
|
||||||
# generate the top level readme
|
# generate the top level readme
|
||||||
cat man/pcp.pod man/install.pod man/footer.pod > README.pod
|
cat man/pcp.pod man/install.pod man/footer.pod > README.pod
|
||||||
pod2text README.pod > README.txt
|
pod2text README.pod > README.txt
|
||||||
|
|
||||||
# generate usage.h
|
# generate usage.h
|
||||||
(cd src && ./usage.sh)
|
(cd src && ./usage.sh)
|
||||||
|
|
||||||
clean=$1
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
touch README
|
|
||||||
|
|
||||||
if test -z "$clean"; then
|
|
||||||
|
if test "$mode" = "config"; then
|
||||||
mkdir -p ./config
|
mkdir -p ./config
|
||||||
|
touch README
|
||||||
|
|
||||||
if ! command -v libtool >/dev/null 2>&1; then
|
if ! command -v libtool >/dev/null 2>&1; then
|
||||||
echo "could not find libtool." 1>&2
|
echo "could not find libtool." 1>&2
|
||||||
@@ -80,6 +81,29 @@ if test -z "$clean"; then
|
|||||||
autoreconf --install --force --verbose -I config
|
autoreconf --install --force --verbose -I config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# normal autogen stuff
|
||||||
|
|
||||||
|
cat <<EOF > clean.sh
|
||||||
|
#!/bin/sh
|
||||||
|
find . -name Makefile -exec rm {} \; > /dev/null 2>&1
|
||||||
|
find . -name Makefile.in -exec rm {} \; > /dev/null 2>&1
|
||||||
|
find . -name "*~" -exec rm {} \; > /dev/null 2>&1
|
||||||
|
find . -name config.h -exec rm {} \; > /dev/null 2>&1
|
||||||
|
find . -name "stamp*" -exec rm {} \; > /dev/null 2>&1
|
||||||
|
find . -name .deps -exec rm -rf {} \; > /dev/null 2>&1
|
||||||
|
find . -name .libs -exec rm -rf {} \; > /dev/null 2>&1
|
||||||
|
find . -name .o -exec rm -rf {} \; > /dev/null 2>&1
|
||||||
|
find . -name .lo -exec rm -rf {} \; > /dev/null 2>&1
|
||||||
|
|
||||||
|
rm -rf aclocal.m4 libtool configure config.* config autom4te.cache tests/test* tests/v* tests/stresstest/* libpcp/libpcp1.pc
|
||||||
|
rm clean.sh
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod 700 clean.sh
|
||||||
|
|
||||||
|
|
||||||
rm -rf README include/pcp/config.h.in~ libpcp/stamp-h1 autom4te.cache
|
rm -rf README include/pcp/config.h.in~ libpcp/stamp-h1 autom4te.cache
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ extern "C" {
|
|||||||
#include "pcp/config.h"
|
#include "pcp/config.h"
|
||||||
#include "pcp/base85.h"
|
#include "pcp/base85.h"
|
||||||
#include "pcp/buffer.h"
|
#include "pcp/buffer.h"
|
||||||
#include "pcp/config.h"
|
|
||||||
#include "pcp/context.h"
|
#include "pcp/context.h"
|
||||||
#include "pcp/crypto.h"
|
#include "pcp/crypto.h"
|
||||||
#include "pcp/defines.h"
|
#include "pcp/defines.h"
|
||||||
|
|||||||
1021
man/pcp1.1
Normal file
1021
man/pcp1.1
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user