| 1 | #!/bin/sh |
| 2 | |
| 3 | # Script to build links for all the exim source files from the system- |
| 4 | # specific build directory. It should be run from within that directory. |
| 5 | # |
| 6 | # Copyright (c) The Exim Maintainers 1995 - 2026 |
| 7 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 8 | |
| 9 | test ! -d ../src && \ |
| 10 | echo "*** $0 should be run in a system-specific subdirectory." && \ |
| 11 | exit 1 |
| 12 | test -r version.c && \ |
| 13 | echo "*** It appears that $0 has already been run." && \ |
| 14 | exit 1 |
| 15 | if [ -r pcre/Makefile ] ; then |
| 16 | echo "*** It appears that $0 was previously interrupted." |
| 17 | echo "*** You need to remove the build directory, and then run 'make' again." |
| 18 | exit 1 |
| 19 | fi |
| 20 | |
| 21 | |
| 22 | echo "" |
| 23 | echo ">>> Creating links to source files..." |
| 24 | |
| 25 | |
| 26 | # The sources for modular parts of Exim have to be linked independently |
| 27 | # in their own sub-directories, since their .o files are built using |
| 28 | # their own Makefile in their sub-directory. |
| 29 | |
| 30 | # Firstly the lookups |
| 31 | d="lookups" |
| 32 | mkdir $d |
| 33 | cd $d |
| 34 | # Makefile is generated |
| 35 | for f in README cdb.c dbmdb.c dnsdb.c dsearch.c json.c ldap.c \ |
| 36 | lmdb.c lsearch.c mysql.c nis.c nisplus.c nmh.c oracle.c passwd.c \ |
| 37 | pgsql.c psl.c readsock.c redis.c spf.c sqlite.c testdb.c whoson.c \ |
| 38 | lf_functions.h lf_check_file.c lf_quote.c lf_sqlperform.c |
| 39 | do |
| 40 | ln -s ../../src/$d/$f $f |
| 41 | done |
| 42 | |
| 43 | cd .. |
| 44 | |
| 45 | # Likewise for the code for the routers |
| 46 | d="routers" |
| 47 | mkdir $d |
| 48 | cd $d |
| 49 | # Makefile is generated |
| 50 | for f in README accept.h accept.c dnslookup.h dnslookup.c \ |
| 51 | ipliteral.h ipliteral.c iplookup.h iplookup.c manualroute.h \ |
| 52 | manualroute.c queryprogram.h queryprogram.c redirect.h redirect.c \ |
| 53 | rf_functions.h rf_change_domain.c rf_expand_data.c rf_get_errors_address.c \ |
| 54 | rf_get_munge_headers.c rf_get_transport.c rf_get_ugid.c rf_queue_add.c \ |
| 55 | rf_lookup_hostlist.c rf_self_action.c rf_set_ugid.c |
| 56 | do |
| 57 | ln -s ../../src/$d/$f $f |
| 58 | done |
| 59 | |
| 60 | cd .. |
| 61 | |
| 62 | # Likewise for the code for the transports |
| 63 | d="transports" |
| 64 | mkdir $d |
| 65 | cd $d |
| 66 | # Makefile is generated |
| 67 | for f in README appendfile.h appendfile.c autoreply.h \ |
| 68 | autoreply.c lmtp.h lmtp.c pipe.h pipe.c queuefile.c queuefile.h \ |
| 69 | smtp.h smtp.c tf_maildir.c tf_maildir.h |
| 70 | do |
| 71 | ln -s ../../src/$d/$f $f |
| 72 | done |
| 73 | |
| 74 | cd .. |
| 75 | |
| 76 | # Likewise for the code for the authentication drivers |
| 77 | d="auths" |
| 78 | mkdir $d |
| 79 | cd $d |
| 80 | # Makefile is generated |
| 81 | for f in README call_saslauthd.c \ |
| 82 | check_serv_cond.c cyrus_sasl.c cyrus_sasl.h gsasl.c \ |
| 83 | gsasl.h get_data.c get_no64_data.c heimdal_gssapi.c heimdal_gssapi.h \ |
| 84 | cram_md5.c cram_md5.h plaintext.c plaintext.h \ |
| 85 | pwcheck.c pwcheck.h auth-spa.c auth-spa.h dovecot.c dovecot.h spa.c \ |
| 86 | spa.h tls.c tls.h external.c external.h |
| 87 | do |
| 88 | ln -s ../../src/$d/$f $f |
| 89 | done |
| 90 | cd .. |
| 91 | |
| 92 | # miscellaneous modules |
| 93 | # Note that the files in the miscmods/pdkim/ source subdir get linked to the |
| 94 | # destination miscmods/ dir |
| 95 | d="miscmods" |
| 96 | mkdir $d |
| 97 | cd $d |
| 98 | # Makefile is generated |
| 99 | for f in dummy.c \ |
| 100 | arc.c arc_api.h \ |
| 101 | dkim.c dkim_transport.c dkim.h dkim_api.h \ |
| 102 | pdkim/crypt_ver.h pdkim/pdkim.c pdkim/pdkim.h \ |
| 103 | pdkim/pdkim_hash.h pdkim/signing.c pdkim/signing.h \ |
| 104 | dmarc.c dmarc_common.c dmarc.h dmarc_api.h dmarc_native.c \ |
| 105 | dscp.c dscp_api.h \ |
| 106 | exim_filter.c exim_filter_api.h \ |
| 107 | pam.c pam_api.h \ |
| 108 | perl.c perl_api.h \ |
| 109 | proxy.c proxy_api.h \ |
| 110 | radius.c radius_api.h \ |
| 111 | sieve_filter.c sieve_filter_body.c sieve_filter_input.c \ |
| 112 | sieve_filter.h sieve_filter_api.h \ |
| 113 | socks.c socks_api.h \ |
| 114 | spf.c spf_perl.c spf.h spf_api.h \ |
| 115 | xclient.c xclient_api.h |
| 116 | do |
| 117 | ln -s ../../src/$d/$f `basename $f` |
| 118 | done |
| 119 | cd .. |
| 120 | |
| 121 | # and the hintsdb implementations |
| 122 | d="hintsdb" |
| 123 | mkdir $d |
| 124 | cd $d |
| 125 | for f in hints_bdb.h hints_gdbm.h hints_ndbm.h hints_sqlite.h hints_tdb.h |
| 126 | do |
| 127 | ln -s ../../src/$d/$f $f |
| 128 | done |
| 129 | cd .. |
| 130 | |
| 131 | # The basic source files for Exim and utilities. NB local_scan.h gets linked, |
| 132 | # but local_scan.c does not, because its location is taken from the build-time |
| 133 | # configuration. Likewise for the os.c file, which gets build dynamically. |
| 134 | |
| 135 | for f in blob.h dbfunctions.h exim.h functions.h globals.h \ |
| 136 | hash.h hintsdb.h hintsdb_structs.h local_scan.h \ |
| 137 | macros.h mytypes.h osfunctions.h path_max.h store.h \ |
| 138 | structs.h lookupapi.h sha_ver.h \ |
| 139 | \ |
| 140 | acl.c atrn.c buildconfig.c base64.c child.c crypt16.c daemon.c dbfn.c \ |
| 141 | debug.c deliver.c directory.c dns.c dnsbl.c drtables.c dummies.c enq.c \ |
| 142 | exim.c exim_dbmbuild.c exim_dbutil.c exim_lock.c expand.c filtertest.c \ |
| 143 | globals.c hash.c header.c host.c host_address.c ip.c log.c lss.c match.c \ |
| 144 | md5.c moan.c parse.c priv.c queue.c rda.c readconf.c receive.c \ |
| 145 | retry.c rewrite.c regex_cache.c rfc2047.c route.c search.c setenv.c \ |
| 146 | environment.c smtp_in.c smtp_out.c spool_in.c spool_out.c std-crypto.c \ |
| 147 | store.c string.c tls.c tlscert-gnu.c tlscert-openssl.c tls-cipher-stdname.c \ |
| 148 | tls-gnu.c tls-openssl.c \ |
| 149 | tod.c transport.c tree.c verify.c version.c xtextencode.c \ |
| 150 | valgrind.h memcheck.h \ |
| 151 | macro_predef.c macro_predef.h |
| 152 | do |
| 153 | ln -s ../src/$f $f |
| 154 | done |
| 155 | |
| 156 | # WITH_CONTENT_SCAN |
| 157 | for f in spam.c spam.h spool_mbox.c regex.c mime.c mime.h malware.c |
| 158 | do |
| 159 | ln -s ../src/$f $f |
| 160 | done |
| 161 | |
| 162 | # EXPERIMENTAL_* |
| 163 | for f in dcc.c dcc.h dane.c dane-openssl.c \ |
| 164 | danessl.h imap_utf7.c utf8.c |
| 165 | do |
| 166 | ln -s ../src/$f $f |
| 167 | done |
| 168 | |
| 169 | |
| 170 | # End of MakeLinks |