aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2014-12-06 11:20:56 -0600
committerBrent Cook <bcook@openbsd.org>2014-12-06 11:20:56 -0600
commit13035fa666c546330e9809691374e4fd0415eccc (patch)
tree922b4c94e13b0f6738131335995d67a7b5aeea3d
parent33ff088a6065cfbafe2f7b870595dc392832cdcb (diff)
downloadportable-13035fa666c546330e9809691374e4fd0415eccc.tar.gz
portable-13035fa666c546330e9809691374e4fd0415eccc.tar.bz2
portable-13035fa666c546330e9809691374e4fd0415eccc.zip
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.
-rw-r--r--.gitignore7
-rw-r--r--apps/Makefile.am82
-rw-r--r--apps/Makefile.am.tpl21
-rw-r--r--apps/poll_win.c (renamed from apps/poll.c)0
-rwxr-xr-xupdate.sh45
5 files changed, 97 insertions, 58 deletions
diff --git a/.gitignore b/.gitignore
index 28ec955..02704fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -88,7 +88,6 @@ crypto/Makefile.am
88include/openssl/Makefile.am 88include/openssl/Makefile.am
89ssl/Makefile.am 89ssl/Makefile.am
90tls/Makefile.am 90tls/Makefile.am
91apps/Makefile.am
92tests/Makefile.am 91tests/Makefile.am
93 92
94ssl/*.c 93ssl/*.c
@@ -99,10 +98,12 @@ include/pqueue.h
99include/tls.h 98include/tls.h
100include/openssl/*.h 99include/openssl/*.h
101include/openssl/*.he 100include/openssl/*.he
102apps/*.c
103apps/*.h 101apps/*.h
104apps/*.cnf 102apps/*.c
105apps/openssl 103apps/openssl
104apps/openssl.cnf
105!apps/apps_win.c
106!apps/poll_win.c
106 107
107crypto/compat/arc4random.c 108crypto/compat/arc4random.c
108crypto/compat/chacha_private.h 109crypto/compat/chacha_private.h
diff --git a/apps/Makefile.am b/apps/Makefile.am
new file mode 100644
index 0000000..769a033
--- /dev/null
+++ b/apps/Makefile.am
@@ -0,0 +1,82 @@
1include $(top_srcdir)/Makefile.am.common
2
3bin_PROGRAMS = openssl
4
5openssl_CFLAGS = $(USER_CFLAGS)
6openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
7openssl_LDADD += $(top_builddir)/ssl/libssl.la
8openssl_LDADD += $(top_builddir)/crypto/libcrypto.la
9
10openssl_SOURCES = apps.c
11openssl_SOURCES += asn1pars.c
12openssl_SOURCES += ca.c
13openssl_SOURCES += ciphers.c
14openssl_SOURCES += cms.c
15openssl_SOURCES += crl.c
16openssl_SOURCES += crl2p7.c
17openssl_SOURCES += dgst.c
18openssl_SOURCES += dh.c
19openssl_SOURCES += dhparam.c
20openssl_SOURCES += dsa.c
21openssl_SOURCES += dsaparam.c
22openssl_SOURCES += ec.c
23openssl_SOURCES += ecparam.c
24openssl_SOURCES += enc.c
25openssl_SOURCES += engine.c
26openssl_SOURCES += errstr.c
27openssl_SOURCES += gendh.c
28openssl_SOURCES += gendsa.c
29openssl_SOURCES += genpkey.c
30openssl_SOURCES += genrsa.c
31openssl_SOURCES += nseq.c
32openssl_SOURCES += ocsp.c
33openssl_SOURCES += openssl.c
34openssl_SOURCES += passwd.c
35openssl_SOURCES += pkcs12.c
36openssl_SOURCES += pkcs7.c
37openssl_SOURCES += pkcs8.c
38openssl_SOURCES += pkey.c
39openssl_SOURCES += pkeyparam.c
40openssl_SOURCES += pkeyutl.c
41openssl_SOURCES += prime.c
42openssl_SOURCES += rand.c
43openssl_SOURCES += req.c
44openssl_SOURCES += rsa.c
45openssl_SOURCES += rsautl.c
46openssl_SOURCES += s_cb.c
47openssl_SOURCES += s_client.c
48openssl_SOURCES += s_server.c
49openssl_SOURCES += s_socket.c
50openssl_SOURCES += s_time.c
51openssl_SOURCES += sess_id.c
52openssl_SOURCES += smime.c
53openssl_SOURCES += speed.c
54openssl_SOURCES += spkac.c
55openssl_SOURCES += ts.c
56openssl_SOURCES += verify.c
57openssl_SOURCES += version.c
58openssl_SOURCES += x509.c
59
60if HOST_WIN
61openssl_SOURCES += apps_win.c
62else
63openssl_SOURCES += apps_posix.c
64endif
65
66if !HAVE_POLL
67if HOST_WIN
68openssl_SOURCES += poll_win.c
69endif
70endif
71
72if !HAVE_STRTONUM
73openssl_SOURCES += strtonum.c
74endif
75
76noinst_HEADERS = apps.h
77noinst_HEADERS += progs.h
78noinst_HEADERS += s_apps.h
79noinst_HEADERS += testdsa.h
80noinst_HEADERS += testrsa.h
81noinst_HEADERS += timeouts.h
82noinst_HEADERS += openssl.cnf
diff --git a/apps/Makefile.am.tpl b/apps/Makefile.am.tpl
deleted file mode 100644
index 16b3d8b..0000000
--- a/apps/Makefile.am.tpl
+++ /dev/null
@@ -1,21 +0,0 @@
1include $(top_srcdir)/Makefile.am.common
2
3bin_PROGRAMS = openssl
4
5openssl_CFLAGS = $(USER_CFLAGS)
6openssl_LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
7openssl_LDADD += $(top_builddir)/ssl/libssl.la
8openssl_LDADD += $(top_builddir)/crypto/libcrypto.la
9
10openssl_SOURCES =
11noinst_HEADERS =
12
13if !HAVE_STRTONUM
14openssl_SOURCES += strtonum.c
15endif
16
17if !HAVE_POLL
18if HOST_WIN
19openssl_SOURCES += poll.c
20endif
21endif
diff --git a/apps/poll.c b/apps/poll_win.c
index bf30ccf..bf30ccf 100644
--- a/apps/poll.c
+++ b/apps/poll_win.c
diff --git a/update.sh b/update.sh
index c7eefb9..5f24123 100755
--- a/update.sh
+++ b/update.sh
@@ -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
289 pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c 289 pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c
290 pcy_int.h ext_dat.h" 290 pcy_int.h ext_dat.h"
291 291
292
292for i in $openssl_cmd_src/*; do 293for i in $openssl_cmd_src/*; do
293 cp $i apps 294 cp $i apps
294done 295done
@@ -393,10 +394,18 @@ echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am
393) 394)
394 395
395rm -f tls/*.c tls/*.h 396rm -f tls/*.c tls/*.h
396for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am.tpl` ; do 397sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am
398for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do
397 cp $libtls_src/$i tls 399 cp $libtls_src/$i tls
398done 400done
399sed -e "s/libtls-version/${libtls_version}/" tls/Makefile.am.tpl > tls/Makefile.am 401
402# conditional compiles
403$CP $libc_src/stdlib/strtonum.c apps
404for i in `awk '/SOURCES|HEADERS/ { print $3 }' apps/Makefile.am` ; do
405 if [ -e $openssl_app_src/$i ]; then
406 cp $openssl_app_src/$i apps
407 fi
408done
400 409
401# do not directly compile C files that are included in other C files 410# do not directly compile C files that are included in other C files
402crypto_excludes=( 411crypto_excludes=(
@@ -447,38 +456,6 @@ crypto_win32_only=(
447 done 456 done
448) 457)
449 458
450# conditional compiles
451$CP $libc_src/stdlib/strtonum.c apps/
452apps_excludes=(
453 poll.c
454 strtonum.c
455 )
456apps_posix_only=(
457 apps_posix.c
458 )
459apps_win32_only=(
460 apps_win.c
461 )
462(cd apps
463 $CP Makefile.am.tpl Makefile.am
464 for i in `ls -1 *.c|sort`; do
465 if [[ ${apps_posix_only[*]} =~ $i ]]; then
466 echo "if !HOST_WIN" >> Makefile.am
467 echo "openssl_SOURCES += ${i}" >> Makefile.am
468 echo "endif" >> Makefile.am
469 elif [[ ${apps_win32_only[*]} =~ $i ]]; then
470 echo "if HOST_WIN" >> Makefile.am
471 echo "openssl_SOURCES += ${i}" >> Makefile.am
472 echo "endif" >> Makefile.am
473 elif ! [[ ${apps_excludes[*]} =~ $i ]]; then
474 echo "openssl_SOURCES += $i" >> Makefile.am
475 fi
476 done
477 for i in `ls -1 *.h|sort`; do
478 echo "noinst_HEADERS += $i" >> Makefile.am
479 done
480)
481
482(cd man 459(cd man
483 $CP Makefile.am.tpl Makefile.am 460 $CP Makefile.am.tpl Makefile.am
484 461