mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
fixed linking to be clang compatible, made -g and -O? configurable
This commit is contained in:
@@ -18,9 +18,13 @@
|
|||||||
#
|
#
|
||||||
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
# You can contact me by mail: <tlinden AT cpan DOT org>.
|
||||||
#
|
#
|
||||||
AM_CXXFLAGS = -I../../include -I../../libpcp/scrypt/crypto -I../../libpcp/scrypt/util -Wall -g
|
AM_CXXFLAGS = -I../../include -I../../libpcp/scrypt/crypto -I../../libpcp/scrypt/util
|
||||||
|
|
||||||
lib_LTLIBRARIES = libpcp1++.la
|
lib_LTLIBRARIES = libpcp1++.la
|
||||||
|
|
||||||
libpcp1___la_SOURCES = pcp++.h ptx.cpp key.cpp vault.cpp crypto.cpp sign.cpp buffer.cpp
|
libpcp1___la_SOURCES = pcp++.h ptx.cpp key.cpp vault.cpp crypto.cpp sign.cpp buffer.cpp
|
||||||
include_HEADERS = pcp++.h
|
include_HEADERS = pcp++.h
|
||||||
|
|
||||||
|
libpcp1___la_CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||||
|
--mode=link $(CXXLD) $(AM_LDFLAGS) \
|
||||||
|
$(LDFLAGS) -o $@
|
||||||
|
|||||||
56
configure.ac
56
configure.ac
@@ -34,6 +34,7 @@ LT_INIT
|
|||||||
|
|
||||||
ORIG_CFLAGS="${CFLAGS:-none}"
|
ORIG_CFLAGS="${CFLAGS:-none}"
|
||||||
|
|
||||||
|
|
||||||
# Checks for programs
|
# Checks for programs
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_PROG_CXXCPP
|
AC_PROG_CXXCPP
|
||||||
@@ -45,7 +46,9 @@ AC_PROG_SED
|
|||||||
AC_PROG_AWK
|
AC_PROG_AWK
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
|
||||||
|
# remove flags set by AC_PROG_CC (duplicates and/or invalid for clang)
|
||||||
|
CFLAGS=""
|
||||||
|
CXXFLAGS=""
|
||||||
|
|
||||||
|
|
||||||
# Host speciffic checks
|
# Host speciffic checks
|
||||||
@@ -291,9 +294,37 @@ if test "x$bigendian" = "xyes"; then
|
|||||||
CFLAGS="$CFLAGS -D__CPU_IS_BIG_ENDIAN=1"
|
CFLAGS="$CFLAGS -D__CPU_IS_BIG_ENDIAN=1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -Werror -Wextra -O2"
|
# prepare FLAGS
|
||||||
|
CFLAGS="$CFLAGS -Werror -Wextra -Wall"
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([debug],
|
||||||
|
AS_HELP_STRING([--disable-debug], [Disable debugging]))
|
||||||
|
|
||||||
|
AS_IF([test "x$enable_debug" != "xno"], [
|
||||||
|
CFLAGS="$CFLAGS -g"
|
||||||
|
enable_debug="yes"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([optimize],
|
||||||
|
AS_HELP_STRING([--disable-optimize], [Disable optimization]))
|
||||||
|
|
||||||
|
AS_IF([test "x$enable_optimize" != "xno"], [
|
||||||
|
case $enable_optimize in
|
||||||
|
-O*)
|
||||||
|
CFLAGS="$CFLAGS $enable_optimize"
|
||||||
|
enable_optimize="$enable_optimize"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
CFLAGS="$CFLAGS -O2"
|
||||||
|
enable_optimize="-O2"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
CXXFLAGS="$CFLAGS"
|
CXXFLAGS="$CFLAGS"
|
||||||
|
|
||||||
|
|
||||||
# conditionals for bindings and stuff
|
# conditionals for bindings and stuff
|
||||||
|
|
||||||
# c++
|
# c++
|
||||||
@@ -302,12 +333,17 @@ AC_ARG_ENABLE([cpp-binding],
|
|||||||
[Disable C++ binding])],
|
[Disable C++ binding])],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AS_IF([test "x$enable_cpp_binding" != "xno"], [
|
||||||
|
enable_cpp_binding=yes
|
||||||
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL([BUILDCPP], [test "x$enable_cpp_binding" != "xno"])
|
AM_CONDITIONAL([BUILDCPP], [test "x$enable_cpp_binding" != "xno"])
|
||||||
|
|
||||||
# py
|
# py
|
||||||
AC_ARG_ENABLE([python-binding],
|
AC_ARG_ENABLE([python-binding],
|
||||||
[AS_HELP_STRING([--enable-python-binding],
|
[AS_HELP_STRING([--enable-python-binding],
|
||||||
[Enable python binding])],
|
[Enable python binding])
|
||||||
|
],
|
||||||
[python="yes"],
|
[python="yes"],
|
||||||
[])
|
[])
|
||||||
|
|
||||||
@@ -336,20 +372,26 @@ AC_CONFIG_FILES([Makefile include/Makefile libpcp/Makefile src/Makefile man/Make
|
|||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
AC_MSG_RESULT([
|
AC_MSG_RESULT([
|
||||||
$PACKAGE $VERSION
|
Build configured for $PACKAGE $VERSION:
|
||||||
CC: ${CC}
|
CC: ${CC}
|
||||||
CFLAGS: ${CFLAGS}
|
CFLAGS: ${CFLAGS}
|
||||||
CXX: ${CXX}
|
CXX: ${CXX}
|
||||||
CXXFLAGS: ${CXXFLAGS}
|
CXXFLAGS: ${CXXFLAGS}
|
||||||
LDFLAGS: ${LDFLAGS}
|
LDFLAGS: ${LDFLAGS}
|
||||||
LIBS: ${LIBS}
|
LIBS: ${LIBS}
|
||||||
|
debug: ${enable_debug}
|
||||||
|
optimize: ${enable_optimize}
|
||||||
|
|
||||||
prefix: ${prefix}
|
prefix: ${prefix}
|
||||||
sysconfdir: ${sysconfdir}
|
|
||||||
libdir: ${libdir}
|
libdir: ${libdir}
|
||||||
includedir: ${includedir}
|
includedir: ${includedir}
|
||||||
|
|
||||||
bigendian: ${bigendian}
|
target platform: ${host}
|
||||||
|
big endian cpu: ${bigendian}
|
||||||
|
|
||||||
build python binding: ${python}
|
build python binding: ${python}
|
||||||
|
build c++ binding: ${enable_cpp_binding}
|
||||||
|
|
||||||
|
Type 'make' to build, 'make install' to install.
|
||||||
|
To execute unit tests, type 'make test'.
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
#
|
#
|
||||||
# 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../include/pcp -Iscrypt/crypto -Iscrypt/util -Wall -g
|
AM_CFLAGS = -I../include/pcp -Iscrypt/crypto -Iscrypt/util
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libpcp1.la
|
lib_LTLIBRARIES = libpcp1.la
|
||||||
|
|
||||||
@@ -33,3 +35,7 @@ libpcp1_la_SOURCES = platform.c mac.c mem.c pad.c version.c \
|
|||||||
base85.c util.c buffer.c mgmt.c keysig.c pcpstream.c
|
base85.c util.c buffer.c mgmt.c keysig.c pcpstream.c
|
||||||
|
|
||||||
include_HEADERS = ../include/pcp.h
|
include_HEADERS = ../include/pcp.h
|
||||||
|
|
||||||
|
libpcp1_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||||
|
--mode=link $(CCLD) $(AM_LDFLAGS) \
|
||||||
|
$(LDFLAGS) -o $@
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
AM_CFLAGS = -I../include/pcp -I../libpcp/scrypt/crypto -Wall -g
|
AM_CFLAGS = -I../include/pcp -I../libpcp/scrypt/crypto
|
||||||
|
|
||||||
bin_PROGRAMS = pcp1
|
bin_PROGRAMS = pcp1
|
||||||
|
|
||||||
@@ -29,3 +29,6 @@ pcp1_SOURCES = pcp.c keymgmt.c keyprint.c readpass.c \
|
|||||||
encryption.c z85util.c signature.c \
|
encryption.c z85util.c signature.c \
|
||||||
compat_getopt.c
|
compat_getopt.c
|
||||||
|
|
||||||
|
pcp1_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||||
|
--mode=link $(CCLD) $(AM_LDFLAGS) \
|
||||||
|
$(LDFLAGS) -o $@
|
||||||
|
|||||||
@@ -19,10 +19,19 @@
|
|||||||
# 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../include/pcp -I../src -I../libpcp/scrypt/crypto -Wall -g
|
AM_CFLAGS = -I../include/pcp -I../src -I../libpcp/scrypt/crypto
|
||||||
check_PROGRAMS = col invalidkeys gencheader statictest cpptest \
|
check_PROGRAMS = col invalidkeys gencheader statictest cpptest \
|
||||||
buffertest sample streamtest pipetest decodertest mangle
|
buffertest sample streamtest pipetest decodertest mangle
|
||||||
|
|
||||||
|
|
||||||
|
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||||
|
--mode=link $(CCLD) $(AM_LDFLAGS) \
|
||||||
|
$(LDFLAGS) -o $@
|
||||||
|
|
||||||
|
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||||
|
--mode=link $(CXXLD) $(AM_LDFLAGS) \
|
||||||
|
$(LDFLAGS) -o $@
|
||||||
|
|
||||||
gencheader_LDADD = ../libpcp/.libs/libpcp1.a
|
gencheader_LDADD = ../libpcp/.libs/libpcp1.a
|
||||||
gencheader_SOURCES = gencheader.c
|
gencheader_SOURCES = gencheader.c
|
||||||
|
|
||||||
@@ -54,7 +63,7 @@ invalidkeys_LDADD = ../libpcp/.libs/libpcp1.a \
|
|||||||
../src/keyprint.o ../src/keymgmt.o ../src/readpass.o
|
../src/keyprint.o ../src/keymgmt.o ../src/readpass.o
|
||||||
invalidkeys_SOURCES = invalidkeys.c
|
invalidkeys_SOURCES = invalidkeys.c
|
||||||
|
|
||||||
AM_CXXFLAGS = -I../include -I../bindings/cpp -I../libpcp/scrypt/crypto -Wall -g
|
AM_CXXFLAGS = -I../include -I../bindings/cpp -I../libpcp/scrypt/crypto
|
||||||
cpptest_LDADD = ../bindings/cpp/.libs/libpcp1++.a ../libpcp/.libs/libpcp1.a
|
cpptest_LDADD = ../bindings/cpp/.libs/libpcp1++.a ../libpcp/.libs/libpcp1.a
|
||||||
cpptest_SOURCES = cpptest.cpp
|
cpptest_SOURCES = cpptest.cpp
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user