Blob


1 #!/bin/sh
4 echo "/* config.h - autogenerated by configure */" > config.h
6 until [ -z $1 ]
7 do
8 case $1 in
9 --user=*)
10 user=`echo $1 | sed -e 's/--user=//g'`
11 echo "#define DEFAULT_PRIVILEGE \"$user\"" >> config.h
12 ;;
13 *)
14 echo "usage: configure [--user=USERNAME]"
15 exit
16 ;;
17 esac
18 shift
19 done
21 openbsd() {
22 echo configuring for OpenBSD
23 cp Makefile.openbsd Makefile
24 }
26 netbsd() {
27 echo configuring for NetBSD
28 cp Makefile.netbsd Makefile
29 }
31 freebsd() {
32 echo configuring for FreeBSD
33 cp Makefile.freebsd Makefile
34 }
36 linux() {
37 echo configuring for Linux
38 cp Makefile.linux Makefile
40 # libressl
42 if [ ! -d ../libressl-2.1.1 ] ; then
43 echo Please install libressl-2.1.1 in the directory before this one!
44 echo You can get it from http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/
45 echo "Please extract it and ./configure && make check, this will not "
46 echo install it into your system only into that directory.
47 echo
48 echo Due to Linux distros not supporting libressl yet, we have to
49 echo make it this way, hopeing for someone making inroads one day!
50 echo cleaning up...
51 rm -f Makefile
52 exit 1
53 else
54 echo Now making a symlink for libcrypto and libssl...
55 ln -s ../libressl-2.1.1/crypto/.libs/libcrypto.a libressllibcrypto.a
56 ln -s ../libressl-2.1.1/crypto/.libs/libcompat.a libressllibcompat.a
57 ln -s ../libressl-2.1.1/ssl/.libs/libssl.a libressllibssl.a
58 ln -s ../libressl-2.1.1/crypto/.libs/libcompatnoopt.a libressllibcompatnoopt.a
59 echo done.
60 fi
61 }
63 darwin() {
64 echo configuring for Darwin
65 cp Makefile.macosx Makefile
66 }
69 case "`uname -s`" in
70 Darwin)
71 darwin;
72 ;;
73 OpenBSD)
74 openbsd;
75 ;;
76 FreeBSD)
77 freebsd
78 ;;
79 NetBSD)
80 netbsd;
81 ;;
82 Linux)
83 linux
84 ;;
85 esac
87 echo done. Type make to make programs.