simplify building the apps Makefile

Remove extra machinery in favor of a plain-old Makefile.am.
Tighten up what files are copied on build, package a simple openssl.cnf.
This commit is contained in:
Brent Cook 2014-12-06 11:20:56 -06:00
parent 33ff088a60
commit 13035fa666
5 changed files with 97 additions and 58 deletions

7
.gitignore vendored
View File

@ -88,7 +88,6 @@ crypto/Makefile.am
include/openssl/Makefile.am
ssl/Makefile.am
tls/Makefile.am
apps/Makefile.am
tests/Makefile.am
ssl/*.c
@ -99,10 +98,12 @@ include/pqueue.h
include/tls.h
include/openssl/*.h
include/openssl/*.he
apps/*.c
apps/*.h
apps/*.cnf
apps/*.c
apps/openssl
apps/openssl.cnf
!apps/apps_win.c
!apps/poll_win.c
crypto/compat/arc4random.c
crypto/compat/chacha_private.h

82
apps/Makefile.am Normal file
View File

@ -0,0 +1,82 @@
include $(top_srcdir)/Makefile.am.common
bin_PROGRAMS = openssl
openssl_CFLAGS = $(USER_CFLAGS)
openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
openssl_LDADD += $(top_builddir)/ssl/libssl.la
openssl_LDADD += $(top_builddir)/crypto/libcrypto.la
openssl_SOURCES = apps.c
openssl_SOURCES += asn1pars.c
openssl_SOURCES += ca.c
openssl_SOURCES += ciphers.c
openssl_SOURCES += cms.c
openssl_SOURCES += crl.c
openssl_SOURCES += crl2p7.c
openssl_SOURCES += dgst.c
openssl_SOURCES += dh.c
openssl_SOURCES += dhparam.c
openssl_SOURCES += dsa.c
openssl_SOURCES += dsaparam.c
openssl_SOURCES += ec.c
openssl_SOURCES += ecparam.c
openssl_SOURCES += enc.c
openssl_SOURCES += engine.c
openssl_SOURCES += errstr.c
openssl_SOURCES += gendh.c
openssl_SOURCES += gendsa.c
openssl_SOURCES += genpkey.c
openssl_SOURCES += genrsa.c
openssl_SOURCES += nseq.c
openssl_SOURCES += ocsp.c
openssl_SOURCES += openssl.c
openssl_SOURCES += passwd.c
openssl_SOURCES += pkcs12.c
openssl_SOURCES += pkcs7.c
openssl_SOURCES += pkcs8.c
openssl_SOURCES += pkey.c
openssl_SOURCES += pkeyparam.c
openssl_SOURCES += pkeyutl.c
openssl_SOURCES += prime.c
openssl_SOURCES += rand.c
openssl_SOURCES += req.c
openssl_SOURCES += rsa.c
openssl_SOURCES += rsautl.c
openssl_SOURCES += s_cb.c
openssl_SOURCES += s_client.c
openssl_SOURCES += s_server.c
openssl_SOURCES += s_socket.c
openssl_SOURCES += s_time.c
openssl_SOURCES += sess_id.c
openssl_SOURCES += smime.c
openssl_SOURCES += speed.c
openssl_SOURCES += spkac.c
openssl_SOURCES += ts.c
openssl_SOURCES += verify.c
openssl_SOURCES += version.c
openssl_SOURCES += x509.c
if HOST_WIN
openssl_SOURCES += apps_win.c
else
openssl_SOURCES += apps_posix.c
endif
if !HAVE_POLL
if HOST_WIN
openssl_SOURCES += poll_win.c
endif
endif
if !HAVE_STRTONUM
openssl_SOURCES += strtonum.c
endif
noinst_HEADERS = apps.h
noinst_HEADERS += progs.h
noinst_HEADERS += s_apps.h
noinst_HEADERS += testdsa.h
noinst_HEADERS += testrsa.h
noinst_HEADERS += timeouts.h
noinst_HEADERS += openssl.cnf

View File

@ -1,21 +0,0 @@
include $(top_srcdir)/Makefile.am.common
bin_PROGRAMS = openssl
openssl_CFLAGS = $(USER_CFLAGS)
openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
openssl_LDADD += $(top_builddir)/ssl/libssl.la
openssl_LDADD += $(top_builddir)/crypto/libcrypto.la
openssl_SOURCES =
noinst_HEADERS =
if !HAVE_STRTONUM
openssl_SOURCES += strtonum.c
endif
if !HAVE_POLL
if HOST_WIN
openssl_SOURCES += poll.c
endif
endif

View File

@ -289,6 +289,7 @@ copy_crypto x509v3 "v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c
pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c
pcy_int.h ext_dat.h"
for i in $openssl_cmd_src/*; do
cp $i apps
done
@ -393,10 +394,18 @@ echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am
)
rm -f tls/*.c tls/*.h
for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am.tpl` ; do
sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am
for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do
cp $libtls_src/$i tls
done
sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am
# conditional compiles
$CP $libc_src/stdlib/strtonum.c apps
for i in `awk '/SOURCES|HEADERS/ { print $3 }' apps/Makefile.am` ; do
if [ -e $openssl_app_src/$i ]; then
cp $openssl_app_src/$i apps
fi
done
# do not directly compile C files that are included in other C files
crypto_excludes=(
@ -447,38 +456,6 @@ crypto_win32_only=(
done
)
# conditional compiles
$CP $libc_src/stdlib/strtonum.c apps/
apps_excludes=(
poll.c
strtonum.c
)
apps_posix_only=(
apps_posix.c
)
apps_win32_only=(
apps_win.c
)
(cd apps
$CP Makefile.am.tpl Makefile.am
for i in `ls -1 *.c|sort`; do
if [[ ${apps_posix_only[*]} =~ $i ]]; then
echo "if !HOST_WIN" >> Makefile.am
echo "openssl_SOURCES += ${i}" >> Makefile.am
echo "endif" >> Makefile.am
elif [[ ${apps_win32_only[*]} =~ $i ]]; then
echo "if HOST_WIN" >> Makefile.am
echo "openssl_SOURCES += ${i}" >> Makefile.am
echo "endif" >> Makefile.am
elif ! [[ ${apps_excludes[*]} =~ $i ]]; then
echo "openssl_SOURCES += $i" >> Makefile.am
fi
done
for i in `ls -1 *.h|sort`; do
echo "noinst_HEADERS += $i" >> Makefile.am
done
)
(cd man
$CP Makefile.am.tpl Makefile.am