Merge ~ahasenack/ubuntu/+source/exim4:bionic-exim4-uninitialized-1786508 into ubuntu/+source/exim4:ubuntu/bionic-devel

Proposed by Andreas Hasenack
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 191ee014ec2b07202a9bef3f380612b14e4e3178
Merge reported by: Christian Ehrhardt 
Merged at revision: 191ee014ec2b07202a9bef3f380612b14e4e3178
Proposed branch: ~ahasenack/ubuntu/+source/exim4:bionic-exim4-uninitialized-1786508
Merge into: ubuntu/+source/exim4:ubuntu/bionic-devel
Diff against target: 304134 lines (+300414/-0)
620 files modified
Makefile (+115/-0)
NOTICE (+152/-0)
OS/Makefile-Base (+980/-0)
OS/Makefile-Default (+321/-0)
OS/Makefile-FreeBSD (+54/-0)
OS/Makefile-Linux (+36/-0)
OS/Makefile-OpenBSD (+28/-0)
OS/Makefile-SunOS5 (+24/-0)
OS/eximon.conf-Default (+41/-0)
OS/os.Configuring (+215/-0)
OS/os.c-FreeBSD (+24/-0)
OS/os.c-Linux (+165/-0)
OS/os.c-SunOS5 (+16/-0)
OS/os.h-FreeBSD (+68/-0)
OS/os.h-Linux (+88/-0)
OS/os.h-OpenBSD (+56/-0)
OS/os.h-SunOS5 (+51/-0)
OS/unsupported/Makefile-AIX (+28/-0)
OS/unsupported/Makefile-BSDI (+21/-0)
OS/unsupported/Makefile-CYGWIN (+113/-0)
OS/unsupported/Makefile-DGUX (+32/-0)
OS/unsupported/Makefile-Darwin (+29/-0)
OS/unsupported/Makefile-DragonFly (+31/-0)
OS/unsupported/Makefile-GNU (+29/-0)
OS/unsupported/Makefile-GNUkFreeBSD (+29/-0)
OS/unsupported/Makefile-GNUkNetBSD (+29/-0)
OS/unsupported/Makefile-HI-OSF (+8/-0)
OS/unsupported/Makefile-HI-UX (+12/-0)
OS/unsupported/Makefile-HP-UX (+27/-0)
OS/unsupported/Makefile-HP-UX-9 (+15/-0)
OS/unsupported/Makefile-IRIX (+12/-0)
OS/unsupported/Makefile-IRIX6 (+13/-0)
OS/unsupported/Makefile-IRIX632 (+16/-0)
OS/unsupported/Makefile-IRIX65 (+16/-0)
OS/unsupported/Makefile-NetBSD (+27/-0)
OS/unsupported/Makefile-NetBSD-a.out (+24/-0)
OS/unsupported/Makefile-OSF1 (+10/-0)
OS/unsupported/Makefile-OpenUNIX (+17/-0)
OS/unsupported/Makefile-QNX (+30/-0)
OS/unsupported/Makefile-SCO (+28/-0)
OS/unsupported/Makefile-SCO_SV (+34/-0)
OS/unsupported/Makefile-SunOS4 (+16/-0)
OS/unsupported/Makefile-SunOS5-hal (+18/-0)
OS/unsupported/Makefile-ULTRIX (+18/-0)
OS/unsupported/Makefile-UNIX_SV (+24/-0)
OS/unsupported/Makefile-USG (+33/-0)
OS/unsupported/Makefile-Unixware7 (+32/-0)
OS/unsupported/Makefile-mips (+16/-0)
OS/unsupported/README (+14/-0)
OS/unsupported/os.c-BSDI (+19/-0)
OS/unsupported/os.c-GNU (+55/-0)
OS/unsupported/os.c-HI-OSF (+35/-0)
OS/unsupported/os.c-HP-UX (+16/-0)
OS/unsupported/os.c-IRIX (+118/-0)
OS/unsupported/os.c-IRIX6 (+118/-0)
OS/unsupported/os.c-IRIX632 (+118/-0)
OS/unsupported/os.c-IRIX65 (+118/-0)
OS/unsupported/os.c-OSF1 (+36/-0)
OS/unsupported/os.c-cygwin (+531/-0)
OS/unsupported/os.h-AIX (+27/-0)
OS/unsupported/os.h-BSDI (+15/-0)
OS/unsupported/os.h-DGUX (+28/-0)
OS/unsupported/os.h-Darwin (+48/-0)
OS/unsupported/os.h-DragonFly (+13/-0)
OS/unsupported/os.h-GNU (+23/-0)
OS/unsupported/os.h-GNUkFreeBSD (+25/-0)
OS/unsupported/os.h-GNUkNetBSD (+25/-0)
OS/unsupported/os.h-HI-OSF (+12/-0)
OS/unsupported/os.h-HI-UX (+21/-0)
OS/unsupported/os.h-HP-UX (+34/-0)
OS/unsupported/os.h-HP-UX-9 (+23/-0)
OS/unsupported/os.h-IRIX (+17/-0)
OS/unsupported/os.h-IRIX6 (+16/-0)
OS/unsupported/os.h-IRIX632 (+18/-0)
OS/unsupported/os.h-IRIX65 (+16/-0)
OS/unsupported/os.h-NetBSD (+28/-0)
OS/unsupported/os.h-NetBSD-a.out (+5/-0)
OS/unsupported/os.h-OSF1 (+16/-0)
OS/unsupported/os.h-OpenUNIX (+19/-0)
OS/unsupported/os.h-QNX (+24/-0)
OS/unsupported/os.h-SCO (+21/-0)
OS/unsupported/os.h-SCO_SV (+19/-0)
OS/unsupported/os.h-SunOS4 (+39/-0)
OS/unsupported/os.h-SunOS5-hal (+14/-0)
OS/unsupported/os.h-ULTRIX (+18/-0)
OS/unsupported/os.h-UNIX_SV (+25/-0)
OS/unsupported/os.h-USG (+19/-0)
OS/unsupported/os.h-Unixware7 (+18/-0)
OS/unsupported/os.h-cygwin (+41/-0)
OS/unsupported/os.h-mips (+27/-0)
README (+349/-0)
README.DSN (+141/-0)
README.UPDATING (+790/-0)
conf (+2/-0)
debian/EDITME.exim4-heavy.diff (+158/-0)
debian/EDITME.exim4-light.diff (+229/-0)
debian/EDITME.eximon.diff (+10/-0)
debian/EDITME.openssl.exim4-light.diff (+19/-0)
debian/NEWS (+450/-0)
debian/README.Debian.xml (+1961/-0)
debian/TODO (+2/-0)
debian/changelog (+5626/-0)
debian/changelog.Debian.old (+1128/-0)
debian/compat (+1/-0)
debian/config-custom/create-custom-config-package (+71/-0)
debian/config-custom/debian/compat (+1/-0)
debian/config-custom/debian/control (+18/-0)
debian/config-custom/debian/copyright (+15/-0)
debian/config-custom/debian/install (+2/-0)
debian/config-custom/debian/rules (+94/-0)
debian/control (+251/-0)
debian/copyright (+229/-0)
debian/create-custom-package (+95/-0)
debian/debconf/conf.d/acl/00_exim4-config_header (+8/-0)
debian/debconf/conf.d/acl/20_exim4-config_local_deny_exceptions (+49/-0)
debian/debconf/conf.d/acl/30_exim4-config_check_mail (+11/-0)
debian/debconf/conf.d/acl/30_exim4-config_check_rcpt (+363/-0)
debian/debconf/conf.d/acl/40_exim4-config_check_data (+84/-0)
debian/debconf/conf.d/auth/00_exim4-config_header (+8/-0)
debian/debconf/conf.d/auth/30_exim4-config_examples (+254/-0)
debian/debconf/conf.d/main/01_exim4-config_listmacrosdefs (+101/-0)
debian/debconf/conf.d/main/02_exim4-config_options (+218/-0)
debian/debconf/conf.d/main/03_exim4-config_tlsoptions (+85/-0)
debian/debconf/conf.d/main/90_exim4-config_log_selector (+10/-0)
debian/debconf/conf.d/retry/00_exim4-config_header (+7/-0)
debian/debconf/conf.d/retry/30_exim4-config (+19/-0)
debian/debconf/conf.d/rewrite/00_exim4-config_header (+7/-0)
debian/debconf/conf.d/rewrite/31_exim4-config_rewriting (+16/-0)
debian/debconf/conf.d/router/00_exim4-config_header (+11/-0)
debian/debconf/conf.d/router/100_exim4-config_domain_literal (+18/-0)
debian/debconf/conf.d/router/150_exim4-config_hubbed_hosts (+18/-0)
debian/debconf/conf.d/router/200_exim4-config_primary (+90/-0)
debian/debconf/conf.d/router/300_exim4-config_real_local (+22/-0)
debian/debconf/conf.d/router/400_exim4-config_system_aliases (+44/-0)
debian/debconf/conf.d/router/500_exim4-config_hubuser (+31/-0)
debian/debconf/conf.d/router/600_exim4-config_userforward (+51/-0)
debian/debconf/conf.d/router/700_exim4-config_procmail (+15/-0)
debian/debconf/conf.d/router/800_exim4-config_maildrop (+14/-0)
debian/debconf/conf.d/router/850_exim4-config_lowuid (+29/-0)
debian/debconf/conf.d/router/900_exim4-config_local_user (+15/-0)
debian/debconf/conf.d/router/mmm_mail4root (+17/-0)
debian/debconf/conf.d/transport/00_exim4-config_header (+13/-0)
debian/debconf/conf.d/transport/10_exim4-config_transport-macros (+16/-0)
debian/debconf/conf.d/transport/30_exim4-config_address_file (+11/-0)
debian/debconf/conf.d/transport/30_exim4-config_address_pipe (+10/-0)
debian/debconf/conf.d/transport/30_exim4-config_address_reply (+8/-0)
debian/debconf/conf.d/transport/30_exim4-config_mail_spool (+17/-0)
debian/debconf/conf.d/transport/30_exim4-config_maildir_home (+41/-0)
debian/debconf/conf.d/transport/30_exim4-config_maildrop_pipe (+12/-0)
debian/debconf/conf.d/transport/30_exim4-config_procmail_pipe (+10/-0)
debian/debconf/conf.d/transport/30_exim4-config_remote_smtp (+53/-0)
debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_smarthost (+47/-0)
debian/debconf/conf.d/transport/35_exim4-config_address_directory (+14/-0)
debian/debconf/update-exim4.conf (+484/-0)
debian/debconf/update-exim4.conf.template (+139/-0)
debian/e-n-if-up (+37/-0)
debian/email-addresses (+9/-0)
debian/example.conf.md5 (+1/-0)
debian/exim-adduser (+52/-0)
debian/exim-gencert (+78/-0)
debian/exim4-base.config (+15/-0)
debian/exim4-base.cron.daily (+105/-0)
debian/exim4-base.dirs (+5/-0)
debian/exim4-base.doc-base.debian (+9/-0)
debian/exim4-base.doc-base.filter (+8/-0)
debian/exim4-base.doc-base.spec (+8/-0)
debian/exim4-base.docs (+15/-0)
debian/exim4-base.examples (+5/-0)
debian/exim4-base.exim4-paniclog.logrotate (+10/-0)
debian/exim4-base.exim4.init (+279/-0)
debian/exim4-base.install (+3/-0)
debian/exim4-base.links (+3/-0)
debian/exim4-base.logrotate (+9/-0)
debian/exim4-base.manpages (+12/-0)
debian/exim4-base.postinst (+103/-0)
debian/exim4-base.postrm (+65/-0)
debian/exim4-base.preinst (+35/-0)
debian/exim4-base.templates (+17/-0)
debian/exim4-config.config (+820/-0)
debian/exim4-config.dirs (+6/-0)
debian/exim4-config.docs (+1/-0)
debian/exim4-config.examples (+1/-0)
debian/exim4-config.exim4.ppp.ip-up (+15/-0)
debian/exim4-config.install (+3/-0)
debian/exim4-config.links (+15/-0)
debian/exim4-config.lintian-overrides (+1/-0)
debian/exim4-config.manpages (+4/-0)
debian/exim4-config.postinst (+408/-0)
debian/exim4-config.postrm (+30/-0)
debian/exim4-config.preinst (+39/-0)
debian/exim4-config.templates (+196/-0)
debian/exim4-daemon-custom.dirs (+3/-0)
debian/exim4-daemon-custom.docs (+1/-0)
debian/exim4-daemon-custom.install (+1/-0)
debian/exim4-daemon-custom.links (+18/-0)
debian/exim4-daemon-heavy.config (+17/-0)
debian/exim4-daemon-heavy.dirs (+4/-0)
debian/exim4-daemon-heavy.docs (+1/-0)
debian/exim4-daemon-heavy.install (+1/-0)
debian/exim4-daemon-heavy.links (+18/-0)
debian/exim4-daemon-heavy.lintian-overrides (+2/-0)
debian/exim4-daemon-heavy.templates (+5/-0)
debian/exim4-daemon-light.config (+17/-0)
debian/exim4-daemon-light.dirs (+3/-0)
debian/exim4-daemon-light.docs (+1/-0)
debian/exim4-daemon-light.install (+1/-0)
debian/exim4-daemon-light.links (+18/-0)
debian/exim4-daemon-light.lintian-overrides (+1/-0)
debian/exim4-daemon-light.postinst (+60/-0)
debian/exim4-daemon-light.prerm (+33/-0)
debian/exim4-daemon-light.templates (+5/-0)
debian/exim4-dev.install (+4/-0)
debian/exim4-dev.links (+2/-0)
debian/exim4-dev.manpages (+1/-0)
debian/exim4-localscan-plugin-config (+12/-0)
debian/exim4-localscan-plugin-config.1 (+40/-0)
debian/exim4-localscan-plugin-config.1.xml (+82/-0)
debian/exim4.config (+17/-0)
debian/exim4.install (+1/-0)
debian/exim4.links (+1/-0)
debian/exim4.postinst (+14/-0)
debian/exim4.templates (+5/-0)
debian/exim4_refresh_gnutls-params (+52/-0)
debian/eximon4.dirs (+2/-0)
debian/eximon4.links (+1/-0)
debian/eximon4.manpages (+1/-0)
debian/eximonconf-patch (+7/-0)
debian/gnutls-params-2048 (+31/-0)
debian/lynx-dump-postprocess (+49/-0)
debian/manpages/exicyclog.8 (+75/-0)
debian/manpages/exigrep.8 (+70/-0)
debian/manpages/exim4-config_files.5 (+364/-0)
debian/manpages/exim_checkaccess.8 (+80/-0)
debian/manpages/exim_convert4r4.8 (+73/-0)
debian/manpages/exim_db.8 (+193/-0)
debian/manpages/exim_dbmbuild.8 (+105/-0)
debian/manpages/exim_lock.8 (+137/-0)
debian/manpages/eximon.8 (+50/-0)
debian/manpages/exinext.8 (+73/-0)
debian/manpages/exiqgrep.8 (+88/-0)
debian/manpages/exiqsumm.8 (+74/-0)
debian/manpages/exiwhat.8 (+102/-0)
debian/manpages/update-exim4.conf.8 (+346/-0)
debian/manpages/update-exim4.conf.template.8 (+92/-0)
debian/manpages/update-exim4defaults.8 (+173/-0)
debian/minimaltest (+87/-0)
debian/mtalist (+1/-0)
debian/passwd.client (+7/-0)
debian/patches/31_eximmanpage.dpatch (+250/-0)
debian/patches/32_exim4.dpatch (+106/-0)
debian/patches/33_eximon.binary.dpatch (+18/-0)
debian/patches/34_eximstatsmanpage.dpatch (+20/-0)
debian/patches/35_install.dpatch (+49/-0)
debian/patches/50_localscan_dlopen.dpatch (+280/-0)
debian/patches/60_convert4r4.dpatch (+41/-0)
debian/patches/67_unnecessaryCopt.diff (+69/-0)
debian/patches/70_remove_exim-users_references.dpatch (+40/-0)
debian/patches/eximstats_unitialized_value.patch (+20/-0)
debian/patches/fix_smtp_banner.patch (+52/-0)
debian/patches/series (+11/-0)
debian/po/POTFILES.in (+5/-0)
debian/po/ar.po (+627/-0)
debian/po/ast.po (+645/-0)
debian/po/be.po (+636/-0)
debian/po/bg.po (+809/-0)
debian/po/bn.po (+614/-0)
debian/po/bs.po (+812/-0)
debian/po/ca.po (+826/-0)
debian/po/cs.po (+685/-0)
debian/po/cy.po (+765/-0)
debian/po/da.po (+650/-0)
debian/po/de.po (+690/-0)
debian/po/dz.po (+814/-0)
debian/po/el.po (+668/-0)
debian/po/eo.po (+631/-0)
debian/po/es.po (+936/-0)
debian/po/et.po (+751/-0)
debian/po/eu.po (+657/-0)
debian/po/fi.po (+939/-0)
debian/po/fr.po (+682/-0)
debian/po/gl.po (+788/-0)
debian/po/he.po (+617/-0)
debian/po/hr.po (+618/-0)
debian/po/hu.po (+880/-0)
debian/po/id.po (+830/-0)
debian/po/it.po (+628/-0)
debian/po/ja.po (+627/-0)
debian/po/kk.po (+610/-0)
debian/po/km.po (+627/-0)
debian/po/ko.po (+782/-0)
debian/po/lt.po (+661/-0)
debian/po/mk.po (+770/-0)
debian/po/ml.po (+631/-0)
debian/po/mr.po (+759/-0)
debian/po/nb.po (+663/-0)
debian/po/ne.po (+611/-0)
debian/po/nl.po (+687/-0)
debian/po/nn.po (+660/-0)
debian/po/pa.po (+609/-0)
debian/po/pl.po (+636/-0)
debian/po/pt.po (+888/-0)
debian/po/pt_BR.po (+673/-0)
debian/po/ro.po (+861/-0)
debian/po/ru.po (+644/-0)
debian/po/sk.po (+638/-0)
debian/po/sl.po (+832/-0)
debian/po/sq.po (+813/-0)
debian/po/sv.po (+747/-0)
debian/po/ta.po (+628/-0)
debian/po/templates.pot (+518/-0)
debian/po/th.po (+752/-0)
debian/po/tl.po (+772/-0)
debian/po/tr.po (+640/-0)
debian/po/uk.po (+682/-0)
debian/po/vi.po (+628/-0)
debian/po/wo.po (+652/-0)
debian/po/zh_CN.po (+602/-0)
debian/po/zh_TW.po (+637/-0)
debian/rules (+295/-0)
debian/script (+28/-0)
debian/source/format (+1/-0)
debian/syslog2eximlog (+60/-0)
debian/tests/CVE-2010-4344.py (+143/-0)
debian/tests/control (+3/-0)
debian/tests/daemon (+13/-0)
debian/tests/security (+6/-0)
debian/update-exim4defaults (+284/-0)
debian/upstream/signing-key.asc (+777/-0)
debian/watch (+3/-0)
doc/ChangeLog (+7030/-0)
doc/DANE-draft-notes (+11/-0)
doc/Exim3.upgrade (+671/-0)
doc/Exim4.upgrade (+1730/-0)
doc/GnuTLS-FAQ.txt (+410/-0)
doc/NewStuff (+1198/-0)
doc/OptionLists.txt (+1049/-0)
doc/README (+65/-0)
doc/README.SIEVE (+343/-0)
doc/cve-2016-9663 (+95/-0)
doc/dbm.discuss.txt (+320/-0)
doc/exim.8 (+1701/-0)
doc/experimental-spec.txt (+1080/-0)
doc/filter.txt (+1724/-0)
doc/openssl.txt (+117/-0)
doc/spec.txt (+36673/-0)
exim_monitor/EDITME (+179/-0)
exim_monitor/em_StripChart.c (+504/-0)
exim_monitor/em_TextPop.c (+767/-0)
exim_monitor/em_globals.c (+243/-0)
exim_monitor/em_hdr.h (+329/-0)
exim_monitor/em_init.c (+237/-0)
exim_monitor/em_log.c (+410/-0)
exim_monitor/em_main.c (+944/-0)
exim_monitor/em_menu.c (+994/-0)
exim_monitor/em_queue.c (+830/-0)
exim_monitor/em_strip.c (+266/-0)
exim_monitor/em_text.c (+73/-0)
exim_monitor/em_version.c (+50/-0)
exim_monitor/em_xs.c (+45/-0)
scripts/Configure (+10/-0)
scripts/Configure-Makefile (+339/-0)
scripts/Configure-config.h (+60/-0)
scripts/Configure-eximon (+51/-0)
scripts/Configure-os.c (+30/-0)
scripts/Configure-os.h (+51/-0)
scripts/MakeLinks (+132/-0)
scripts/arch-type (+74/-0)
scripts/exim_install (+472/-0)
scripts/lookups-Makefile (+194/-0)
scripts/newer (+21/-0)
scripts/os-type (+164/-0)
scripts/reversion (+124/-0)
scripts/source_checks (+52/-0)
src/EDITME (+1415/-0)
src/acl.c (+4570/-0)
src/aliases.default (+40/-0)
src/auths/Makefile (+45/-0)
src/auths/README (+98/-0)
src/auths/auth-spa.c (+1534/-0)
src/auths/auth-spa.h (+92/-0)
src/auths/call_pam.c (+205/-0)
src/auths/call_pwcheck.c (+120/-0)
src/auths/call_radius.c (+237/-0)
src/auths/check_serv_cond.c (+130/-0)
src/auths/cram_md5.c (+362/-0)
src/auths/cram_md5.h (+32/-0)
src/auths/cyrus_sasl.c (+545/-0)
src/auths/cyrus_sasl.h (+36/-0)
src/auths/dovecot.c (+513/-0)
src/auths/dovecot.h (+28/-0)
src/auths/get_data.c (+47/-0)
src/auths/get_no64_data.c (+47/-0)
src/auths/gsasl_exim.c (+634/-0)
src/auths/gsasl_exim.h (+42/-0)
src/auths/heimdal_gssapi.c (+610/-0)
src/auths/heimdal_gssapi.h (+39/-0)
src/auths/md5.c (+357/-0)
src/auths/plaintext.c (+310/-0)
src/auths/plaintext.h (+32/-0)
src/auths/pwcheck.c (+453/-0)
src/auths/pwcheck.h (+27/-0)
src/auths/spa.c (+377/-0)
src/auths/spa.h (+39/-0)
src/auths/tls.c (+94/-0)
src/auths/tls.h (+30/-0)
src/auths/xtextdecode.c (+57/-0)
src/auths/xtextencode.c (+57/-0)
src/base64.c (+289/-0)
src/blob.h (+15/-0)
src/bmi_spam.c (+470/-0)
src/bmi_spam.h (+22/-0)
src/buildconfig.c (+965/-0)
src/child.c (+520/-0)
src/config.h.defaults (+211/-0)
src/configure.default (+869/-0)
src/convert4r3.src (+1382/-0)
src/convert4r4.src (+2527/-0)
src/crypt16.c (+77/-0)
src/daemon.c (+2112/-0)
src/dane-gnu.c (+21/-0)
src/dane-openssl.c (+1721/-0)
src/dane.c (+50/-0)
src/danessl.h (+47/-0)
src/dbfn.c (+700/-0)
src/dbfunctions.h (+33/-0)
src/dbstuff.h (+786/-0)
src/dcc.c (+512/-0)
src/dcc.h (+16/-0)
src/debug.c (+271/-0)
src/deliver.c (+8592/-0)
src/directory.c (+96/-0)
src/dkim.c (+763/-0)
src/dkim.h (+32/-0)
src/dkim_transport.c (+377/-0)
src/dmarc.c (+638/-0)
src/dmarc.h (+61/-0)
src/dns.c (+1228/-0)
src/drtables.c (+728/-0)
src/dummies.c (+148/-0)
src/enq.c (+122/-0)
src/environment.c (+72/-0)
src/exicyclog.src (+350/-0)
src/exigrep.src (+374/-0)
src/exim.c (+5850/-0)
src/exim.h (+607/-0)
src/exim_checkaccess.src (+181/-0)
src/exim_dbmbuild.c (+510/-0)
src/exim_dbutil.c (+1358/-0)
src/exim_lock.c (+664/-0)
src/eximon.src (+221/-0)
src/eximstats.src (+4246/-0)
src/exinext.src (+262/-0)
src/exipick.src (+1845/-0)
src/exiqgrep.src (+209/-0)
src/exiqsumm.src (+178/-0)
src/exiwhat.src (+142/-0)
src/expand.c (+7998/-0)
src/filter.c (+2601/-0)
src/filtertest.c (+281/-0)
src/functions.h (+546/-0)
src/globals.c (+1558/-0)
src/globals.h (+984/-0)
src/hash.c (+821/-0)
src/hash.h (+79/-0)
src/header.c (+463/-0)
src/host.c (+3360/-0)
src/imap_utf7.c (+211/-0)
src/ip.c (+806/-0)
src/local_scan.c (+64/-0)
src/local_scan.h (+195/-0)
src/log.c (+1446/-0)
src/lookupapi.h (+60/-0)
src/lookups/Makefile (+71/-0)
src/lookups/README (+175/-0)
src/lookups/cdb.c (+513/-0)
src/lookups/dbmdb.c (+287/-0)
src/lookups/dnsdb.c (+611/-0)
src/lookups/dsearch.c (+157/-0)
src/lookups/ibase.c (+585/-0)
src/lookups/ldap.c (+1684/-0)
src/lookups/ldap.h (+13/-0)
src/lookups/lf_check_file.c (+113/-0)
src/lookups/lf_functions.h (+18/-0)
src/lookups/lf_quote.c (+64/-0)
src/lookups/lf_sqlperform.c (+138/-0)
src/lookups/lmdb.c (+160/-0)
src/lookups/lsearch.c (+484/-0)
src/lookups/mysql.c (+505/-0)
src/lookups/nis.c (+137/-0)
src/lookups/nisplus.c (+293/-0)
src/lookups/oracle.c (+631/-0)
src/lookups/passwd.c (+90/-0)
src/lookups/pgsql.c (+510/-0)
src/lookups/redis.c (+458/-0)
src/lookups/spf.c (+121/-0)
src/lookups/sqlite.c (+187/-0)
src/lookups/testdb.c (+103/-0)
src/lookups/whoson.c (+101/-0)
src/lss.c (+142/-0)
src/macro_predef.c (+296/-0)
src/macro_predef.h (+20/-0)
src/macros.h (+995/-0)
src/malware.c (+2123/-0)
src/match.c (+1344/-0)
src/memcheck.h (+277/-0)
src/mime.c (+811/-0)
src/mime.h (+44/-0)
src/moan.c (+773/-0)
src/mytypes.h (+120/-0)
src/os.c (+970/-0)
src/osfunctions.h (+42/-0)
src/parse.c (+2241/-0)
src/pdkim/Makefile (+19/-0)
src/pdkim/README (+9/-0)
src/pdkim/config.h (+4/-0)
src/pdkim/crypt_ver.h (+26/-0)
src/pdkim/pdkim.c (+1838/-0)
src/pdkim/pdkim.h (+323/-0)
src/pdkim/pdkim_hash.h (+38/-0)
src/pdkim/signing.c (+715/-0)
src/pdkim/signing.h (+83/-0)
src/perl.c (+197/-0)
src/queue.c (+1452/-0)
src/rda.c (+1002/-0)
src/readconf.c (+4528/-0)
src/receive.c (+4370/-0)
src/regex.c (+211/-0)
src/retry.c (+932/-0)
src/rewrite.c (+833/-0)
src/rfc2047.c (+352/-0)
src/route.c (+1931/-0)
src/routers/Makefile (+43/-0)
src/routers/README (+57/-0)
src/routers/accept.c (+141/-0)
src/routers/accept.h (+31/-0)
src/routers/dnslookup.c (+468/-0)
src/routers/dnslookup.h (+40/-0)
src/routers/ipliteral.c (+205/-0)
src/routers/ipliteral.h (+34/-0)
src/routers/iplookup.c (+420/-0)
src/routers/iplookup.h (+41/-0)
src/routers/manualroute.c (+493/-0)
src/routers/manualroute.h (+39/-0)
src/routers/queryprogram.c (+559/-0)
src/routers/queryprogram.h (+40/-0)
src/routers/redirect.c (+941/-0)
src/routers/redirect.h (+77/-0)
src/routers/rf_change_domain.c (+85/-0)
src/routers/rf_expand_data.c (+48/-0)
src/routers/rf_functions.h (+31/-0)
src/routers/rf_get_errors_address.c (+131/-0)
src/routers/rf_get_munge_headers.c (+121/-0)
src/routers/rf_get_transport.c (+90/-0)
src/routers/rf_get_ugid.c (+80/-0)
src/routers/rf_lookup_hostlist.c (+252/-0)
src/routers/rf_queue_add.c (+108/-0)
src/routers/rf_self_action.c (+141/-0)
src/routers/rf_set_ugid.c (+44/-0)
src/search.c (+828/-0)
src/setenv.c (+59/-0)
src/sha_ver.h (+42/-0)
src/sieve.c (+3677/-0)
src/smtp_in.c (+5752/-0)
src/smtp_out.c (+699/-0)
src/spam.c (+650/-0)
src/spam.h (+38/-0)
src/spf.c (+142/-0)
src/spf.h (+35/-0)
src/spool_in.c (+950/-0)
src/spool_mbox.c (+247/-0)
src/spool_out.c (+531/-0)
src/srs.c (+230/-0)
src/srs.h (+29/-0)
src/std-crypto.c (+1022/-0)
src/store.c (+580/-0)
src/store.h (+53/-0)
src/string.c (+1720/-0)
src/structs.h (+884/-0)
src/tls-gnu.c (+2635/-0)
src/tls-openssl.c (+3127/-0)
src/tls.c (+361/-0)
src/tlscert-gnu.c (+485/-0)
src/tlscert-openssl.c (+532/-0)
src/tod.c (+225/-0)
src/transport-filter.src (+93/-0)
src/transport.c (+2281/-0)
src/transports/Makefile (+27/-0)
src/transports/README (+41/-0)
src/transports/appendfile.c (+3425/-0)
src/transports/appendfile.h (+99/-0)
src/transports/autoreply.c (+883/-0)
src/transports/autoreply.h (+45/-0)
src/transports/lmtp.c (+806/-0)
src/transports/lmtp.h (+32/-0)
src/transports/pipe.c (+1167/-0)
src/transports/pipe.h (+51/-0)
src/transports/queuefile.c (+272/-0)
src/transports/queuefile.h (+29/-0)
src/transports/smtp.c (+4688/-0)
src/transports/smtp.h (+187/-0)
src/transports/smtp_socks.c (+420/-0)
src/transports/tf_maildir.c (+600/-0)
src/transports/tf_maildir.h (+20/-0)
src/tree.c (+365/-0)
src/utf8.c (+273/-0)
src/valgrind.h (+4797/-0)
src/verify.c (+3865/-0)
src/version.c (+68/-0)
src/version.sh (+4/-0)
util/.gitignore (+2/-0)
util/README (+40/-0)
util/chunking_fixqueue_finalnewlines.pl (+160/-0)
util/cramtest.pl (+60/-0)
util/gen_pkcs3.c (+266/-0)
util/logargs.sh (+26/-0)
util/mkcdb.pl (+93/-0)
util/ocsp_fetch.pl (+84/-0)
util/proxy_protocol_client.pl (+251/-0)
util/ratelimit.pl (+159/-0)
util/unknownuser.sh (+32/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server packageset reviewers Pending
Review via email: mp+356437@code.launchpad.net

Description of the change

The launchpad diff is incorrect, please use git for the review.

Fix a warning in the eximstats tool that could become really annoying when the daily cron job is configured to send out a statistics report.

Bileto ticket: https://bileto.ubuntu.com/#/ticket/3468
PPA: ppa:ci-train-ppa-service/3468

The bug has been updated with the SRU template and has detailed testing instructions.

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Small fix, all formal things LGTM.
Testing instructions are good and work for me to trigger the issue.
WOrks fine with the PPA build that also upgraded fine.

I do not see additional regression potential in this, nice small helpful fix +1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks, tagged and uploaded.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This is in binic-updates, setting MP to merged state

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/Makefile b/Makefile
0new file mode 1006440new file mode 100644
index 0000000..9583062
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,115 @@
1# Top-level makefile for Exim; handles creating a build directory with
2# appropriate links, and then creating and running the main makefile in that
3# directory.
4
5# Copyright (c) University of Cambridge, 1995 - 2017
6# See the file NOTICE for conditions of use and distribution.
7
8# IRIX make uses the shell that is in the SHELL variable, which often defaults
9# to csh, so put this in to make it use the Bourne shell. In systems where
10# /bin/sh is not a Bourne-compatible shell, this line will have to be edited,
11# or "make" must be called with a different SHELL= setting.
12
13SHELL=/bin/sh
14RM_COMMAND=/bin/rm
15
16# If a build name has not been specified by running this make file via a
17# command of the form "make build=xxxx", then determine the name of the
18# operating system and the machine architecture and use that. This does not
19# provide an override for the OS type and architecture type; they still have
20# to be used for the OS-specific files. To override them, you can set the
21# shell variables OSTYPE and ARCHTYPE when running make.
22#
23# EXIM_BUILD_SUFFIX should be used to enable parallel builds on a file
24# system shared among different Linux distros (same os-type, same
25# arch-type). The ../test/runtest script is expected to honour the
26# EXIM_BUILD_SUFFIX when searching the Exim binary.
27# NOTE: EXIM_BUILD_SUFFIX is considered *experimental*.
28
29buildname=$${build:-`$(SHELL) scripts/os-type`-`$(SHELL) scripts/arch-type`}$${EXIM_BUILD_SUFFIX:+.$$EXIM_BUILD_SUFFIX}
30
31# The default target checks for the existence of Local/Makefile, that the main
32# makefile is built and up-to-date, and then it runs it.
33
34all: Local/Makefile configure
35 @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS)
36
37
38# This pair for the convenience of of the Debian maintainers
39exim: Local/Makefile configure
40 @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS) exim
41utils: Local/Makefile configure
42 @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS) utils
43
44
45Local/Makefile:
46 @echo ""
47 @echo "*** Please create Local/Makefile by copying src/EDITME and making"
48 @echo "*** appropriate changes for your site."
49 @echo ""
50 @test ! -d Local && mkdir Local
51 @false
52
53# This is separated off so that "make build-directory" can be obeyed on
54# its own if necessary.
55
56build-directory:
57 @builddir=build-$(buildname); \
58 case "$$builddir" in *UnKnown*) exit 1;; esac; \
59 $(SHELL) -c "test -d $$builddir -a -r $$builddir/version.c || \
60 (mkdir $$builddir; cd $$builddir; $(SHELL) ../scripts/MakeLinks)";
61
62checks:
63 $(SHELL) scripts/source_checks
64
65# The "configure" target ensures that the build directory exists, then arranges
66# to build the main makefile from inside the build directory, by calling the
67# Configure-Makefile script. This does its own dependency checking because of
68# the optional files.
69
70configure: checks build-directory
71 @cd build-$(buildname); \
72 build=$(build) $(SHELL) ../scripts/Configure-Makefile
73
74# The "makefile" target forces a rebuild of the makefile (as opposed to
75# "configure", which doesn't force it).
76
77makefile: build-directory
78 @cd build-$(buildname); $(RM_COMMAND) -f Makefile; \
79 build=$(build) $(SHELL) ../scripts/Configure-Makefile
80
81# The installation commands are kept in a separate script, which expects
82# to be run from inside the build directory.
83
84install: all
85 @cd build-$(buildname); \
86 build=$(build) $(SHELL) ../scripts/exim_install $(INSTALL_ARG)
87
88# Tidy-up targets
89
90clean:; @echo ""; echo '*** "make clean" just removes all .o and .a files'
91 @echo '*** Use "make makefile" to force a rebuild of the makefile'
92 @echo ""
93 cd build-$(buildname); \
94 $(RM_COMMAND) -f *.o lookups/*.o lookups/*.a auths/*.o auths/*.a \
95 routers/*.o routers/*.a transports/*.o transports/*.a \
96 pdkim/*.o pdkim/*.a
97
98clean_exim:; cd build-$(buildname); \
99 $(RM_COMMAND) -f *.o lookups/*.o lookups/*.a auths/*.o auths/*.a \
100 routers/*.o routers/*.a transports/*.o transports/*.a lookups/*.so
101
102distclean:; $(RM_COMMAND) -rf build-* cscope*
103
104cscope.files: FRC
105 echo "-q" > $@
106 echo "-p3" >> $@
107 find src Local OS exim_monitor -name "*.[cshyl]" -print \
108 -o -name "os.[ch]*" -print \
109 -o -name "*akefile*" -print \
110 -o -name config.h.defaults -print \
111 -o -name EDITME -print >> $@
112
113FRC:
114
115# End of top-level makefile
diff --git a/NOTICE b/NOTICE
0new file mode 100644116new file mode 100644
index 0000000..b4a5c40
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,152 @@
1THE EXIM MAIL TRANSFER AGENT
2----------------------------
3
4Copyright (c) 2004 University of Cambridge
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11In addition, for the avoidance of any doubt, permission is granted to
12link this program with OpenSSL or any other library package and to
13(re)distribute the binaries produced as the result of such linking.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23
24
25UNSOLICITED EMAIL
26-----------------
27
28The use, supply or promotion of Exim for the purpose of sending bulk,
29unsolicited electronic mail is incompatible with the basic aims of the program,
30which revolve around the free provision of a service that enhances the quality
31of personal communications. The author of Exim regards indiscriminate
32mass-mailing as an antisocial, irresponsible abuse of the Internet.
33
34
35INCORPORATED CODE
36-----------------
37
38A number of pieces of external code are included in the Exim distribution.
39
40 . Support for the cdb (Constant DataBase) lookup method is provided by code
41 contributed by Nigel Metheringham of Planet Online Ltd. which contains
42 the following statements:
43 _________________________________________________________________________
44
45 Copyright (c) 1998 Nigel Metheringham, Planet Online Ltd
46
47 This program is free software; you can redistribute it and/or modify it
48 under the terms of the GNU General Public License as published by the
49 Free Software Foundation; either version 2 of the License, or (at your
50 option) any later version.
51
52 This code implements Dan Bernstein's Constant DataBase (cdb) spec.
53 Information, the spec and sample code for cdb can be obtained from
54 http://www.pobox.com/~djb/cdb.html. This implementation borrows some code
55 from Dan Bernstein's implementation (which has no license restrictions
56 applied to it).
57 _________________________________________________________________________
58
59 The implementation is completely contained within the code of Exim. It
60 does not link against an external cdb library.
61
62 . Client support for Microsoft's "Secure Password Authentication" is pro-
63 vided by code contributed by Marc Prud'hommeaux. Server support was
64 contributed by Tom Kistner. This includes code taken from the Samba
65 project, which is released under the Gnu GPL.
66
67
68 . Support for calling the Cyrus "pwcheck" and "saslauthd" daemons is
69 provided by code taken from the Cyrus-SASL library and adapted by
70 Alexander S. Sabourenkov. The permission notice appears below, in
71 accordance with the conditions expressed therein.
72
73 _________________________________________________________________________
74
75 Copyright (c) 2001 Carnegie Mellon University. All rights reserved.
76
77 Redistribution and use in source and binary forms, with or without
78 modification, are permitted provided that the following conditions are
79 met:
80
81 1. Redistributions of source code must retain the above copyright
82 notice, this list of conditions and the following disclaimer.
83
84 2. Redistributions in binary form must reproduce the above copyright
85 notice, this list of conditions and the following disclaimer in the
86 documentation and/or other materials provided with the distribution.
87
88 3. The name 'Carnegie Mellon University' must not be used to endorse or
89 promote products derived from this software without prior written
90 permission. For permission or any other legal details, please
91 contact
92
93 Office of Technology Transfer
94 Carnegie Mellon University
95 5000 Forbes Avenue
96 Pittsburgh, PA 15213-3890
97 (412) 268-4387, fax: (412) 268-7395
98 tech-transfer@andrew.cmu.edu
99
100 4. Redistributions of any form whatsoever must retain the following
101 acknowledgment:
102 This product includes software developed by Computing Services at
103 Carnegie Mellon University (http://www.cmu.edu/computing/).
104
105 CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
106 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
107 FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY
108 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
109 RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
110 CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
111 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
112 _________________________________________________________________________
113
114
115 . The Exim Monitor program, which is an X-Window application, includes
116 modified versions of the Athena StripChart and TextPop widgets. This code
117 is copyright by DEC and MIT, and their permission notice appears below,
118 in accordance with the conditions expressed therein.
119
120 _________________________________________________________________________
121
122 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard,
123 Massachusetts, and the Massachusetts Institute of Technology, Cambridge,
124 Massachusetts.
125
126 All Rights Reserved
127
128 Permission to use, copy, modify, and distribute this software and its
129 documentation for any purpose and without fee is hereby granted, provided
130 that the above copyright notice appear in all copies and that both that
131 copyright notice and this permission notice appear in supporting documen-
132 tation, and that the names of Digital or MIT not be used in advertising
133 or publicity pertaining to distribution of the software without specific,
134 written prior permission.
135
136 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
137 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
138 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
139 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
140 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
141 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
142 SOFTWARE.
143 _________________________________________________________________________
144
145
146 . Some of the code to support the use of maildirsize files for maildir
147 deliveries is taken from the Courier Imapd source code. This code is
148 released under the GPL.
149 _________________________________________________________________________
150
151--
152Philip Hazel University of Cambridge Computing Service,
diff --git a/OS/Makefile-Base b/OS/Makefile-Base
0new file mode 100644153new file mode 100644
index 0000000..dcd87c2
--- /dev/null
+++ b/OS/Makefile-Base
@@ -0,0 +1,980 @@
1# This file is the basis of the main makefile for Exim and friends. The
2# makefile at the top level arranges to build the main makefile by calling
3# scripts/Configure-Makefile from within the build directory. This
4# concatenates the configuration settings from Local/Makefile and other,
5# optional, Local/* files at the front of this file, to create Makefile in the
6# build directory.
7#
8# Copyright (c) The Exim Maintainers 2017
9
10SHELL = $(MAKE_SHELL)
11SCRIPTS = ../scripts
12O = ../OS
13EDITME = ../Local/Makefile
14EXIMON_EDITME = ../Local/eximon.conf
15
16# The compiler used for linking is normally the same as the compiler used for
17# compiling. However, by giving it a different name, we can override it from
18# the command line, and this is helpful for certain types of testing.
19
20LNCC = $(CC)
21
22# The compile commands can be very long. To make the output look better,
23# they are not normally echoed in full. To get full echoing, the caller
24# must set FULLECHO='' on the command line and call make with -e. We default
25# FULLECHO to '@' to suppress the full echo. Then define an abbreviation.
26
27FULLECHO = @
28FE = $(FULLECHO)
29
30# The default target double-checks the existence of $(EDITME) and then arranges
31# to touch it if it exists and any of the optional configuration files, which
32# depend on the os or the architecture, have been altered. The same sub-target
33# does the same thing for the eximon configuration file if it exists. Then
34# there is a check that the Makefile (the one built from this file) is
35# up-to-date. Then the os-specific source files and the C configuration file
36# are set up, and finally it goes to the main Exim target.
37
38all: utils exim
39config: $(EDITME) checklocalmake Makefile os.c config.h version.h version.sh macro.c
40
41checklocalmake:
42 @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
43 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
44 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
45 then \
46 touch $(EDITME); \
47 fi
48 @if $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE) $(EXIMON_EDITME) || \
49 $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(ARCHTYPE) $(EXIMON_EDITME) || \
50 $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EXIMON_EDITME); \
51 then \
52 if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
53 fi
54
55$(EDITME):
56 @echo " "
57 @echo "*** Please create Local/Makefile by copying src/EDITME and making"
58 @echo "*** appropriate changes for your site."
59 @echo " "
60 @false
61
62$(EXIMON_EDITME):
63 @echo " "
64 @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
65 @echo "*** appropriate changes for your site."
66 @echo " "
67 @test ! -d ../Local && mkdir ../Local
68 @false
69
70# Check that the local Makefile is up-to-date
71
72Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
73 $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
74 @echo " "
75 @echo "*** Makefile needs rebuilding"
76 @echo "*** Please run \"make makefile\" at top level"
77 @echo " "
78 @false
79
80# Build (link) the os.h file
81
82#os.h: $(SCRIPTS)/Configure-os.h \
83# $(O)/os.h-AIX $(O)/os.h-BSDI $(O)/os.h-cygwin \
84# $(O)/os.h-Darwin $(O)/os.h-DGUX $(O)/os.h-DragonFly \
85# $(O)/os.h-FreeBSD $(O)/os.h-GNU $(O)/os.h-GNUkFreeBSD \
86# $(O)/os.h-GNUkNetBSD $(O)/os.h-HI-OSF \
87# $(O)/os.h-HI-UX $(O)/os.h-HP-UX $(O)/os.h-HP-UX-9 \
88# $(O)/os.h-IRIX $(O)/os.h-IRIX6 $(O)/os.h-IRIX632 \
89# $(O)/os.h-IRIX65 $(O)/os.h-Linux $(O)/os.h-mips \
90# $(O)/os.h-NetBSD $(O)/os.h-NetBSD-a.out \
91# $(O)/os.h-OpenBSD $(O)/os.h-OpenUNIX $(O)/os.h-OSF1 \
92# $(O)/os.h-QNX $(O)/os.h-SCO $(O)/os.h-SCO_SV \
93# $(O)/os.h-SunOS4 $(O)/os.h-SunOS5 $(O)/os.h-SunOS5-hal \
94# $(O)/os.h-ULTRIX $(O)/os.h-UNIX_SV \
95# $(O)/os.h-Unixware7 $(O)/os.h-USG
96# $(SHELL) $(SCRIPTS)/Configure-os.h
97
98os.h: $(SCRIPTS)/Configure-os.h \
99 $(O)/os.h-FreeBSD \
100 $(O)/os.h-Linux \
101 $(O)/os.h-OpenBSD \
102 $(O)/os.h-SunOS5
103 $(SHELL) $(SCRIPTS)/Configure-os.h
104
105# Build the os.c file
106
107#os.c: ../src/os.c \
108# $(SCRIPTS)/Configure-os.c \
109# $(O)/os.c-cygwin $(O)/os.c-GNU $(O)/os.c-HI-OSF \
110# $(O)/os.c-IRIX $(O)/os.c-IRIX6 $(O)/os.c-IRIX632 \
111# $(O)/os.c-IRIX65 $(O)/os.c-Linux $(O)/os.c-OSF1
112# $(SHELL) $(SCRIPTS)/Configure-os.c
113
114os.c: ../src/os.c \
115 $(SCRIPTS)/Configure-os.c \
116 $(O)/os.c-Linux
117 $(SHELL) $(SCRIPTS)/Configure-os.c
118
119# Build the config.h file.
120
121config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
122 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
123
124# Build the builtin-macros data struct
125
126MACRO_HSRC = macro_predef.h os.h globals.h config.h \
127 routers/accept.h routers/dnslookup.h routers/ipliteral.h \
128 routers/iplookup.h routers/manualroute.h routers/queryprogram.h \
129 routers/redirect.h
130
131OBJ_MACRO = macro_predef.o \
132 macro-globals.o macro-readconf.o macro-route.o macro-transport.o macro-drtables.o \
133 macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
134 macro-smtp.o macro-accept.o macro-dnslookup.o macro-ipliteral.o macro-iplookup.o \
135 macro-manualroute.o macro-queryprogram.o macro-redirect.o \
136 macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
137 macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-tls.o\
138 macro-dkim.o
139
140$(OBJ_MACRO): $(MACRO_HSRC)
141
142macro_predef.o : macro_predef.c
143 @echo "$(CC) -DMACRO_PREDEF macro_predef.c"
144 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ macro_predef.c
145macro-globals.o : globals.c
146 @echo "$(CC) -DMACRO_PREDEF globals.c"
147 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ globals.c
148macro-readconf.o : readconf.c
149 @echo "$(CC) -DMACRO_PREDEF readconf.c"
150 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ readconf.c
151macro-route.o : route.c
152 @echo "$(CC) -DMACRO_PREDEF route.c"
153 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ route.c
154macro-transport.o: transport.c
155 @echo "$(CC) -DMACRO_PREDEF transport.c"
156 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transport.c
157macro-drtables.o : drtables.c
158 @echo "$(CC) -DMACRO_PREDEF drtables.c"
159 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ drtables.c
160macro-appendfile.o : transports/appendfile.c
161 @echo "$(CC) -DMACRO_PREDEF transports/appendfile.c"
162 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/appendfile.c
163macro-autoreply.o : transports/autoreply.c
164 @echo "$(CC) -DMACRO_PREDEF transports/autoreply.c"
165 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/autoreply.c
166macro-lmtp.o: transports/lmtp.c
167 @echo "$(CC) -DMACRO_PREDEF transports/lmtp.c"
168 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/lmtp.c
169macro-pipe.o : transports/pipe.c
170 @echo "$(CC) -DMACRO_PREDEF transports/pipe.c"
171 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/pipe.c
172macro-queuefile.o : transports/queuefile.c
173 @echo "$(CC) -DMACRO_PREDEF transports/queuefile.c"
174 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/queuefile.c
175macro-smtp.o : transports/smtp.c
176 @echo "$(CC) -DMACRO_PREDEF transports/smtp.c"
177 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/smtp.c
178macro-accept.o : routers/accept.c
179 @echo "$(CC) -DMACRO_PREDEF routers/accept.c"
180 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/accept.c
181macro-dnslookup.o : routers/dnslookup.c
182 @echo "$(CC) -DMACRO_PREDEF routers/dnslookup.c"
183 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/dnslookup.c
184macro-ipliteral.o : routers/ipliteral.c
185 @echo "$(CC) -DMACRO_PREDEF routers/ipliteral.c"
186 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/ipliteral.c
187macro-iplookup.o : routers/iplookup.c
188 @echo "$(CC) -DMACRO_PREDEF routers/iplookup.c"
189 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/iplookup.c
190macro-manualroute.o : routers/manualroute.c
191 @echo "$(CC) -DMACRO_PREDEF routers/manualroute.c"
192 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/manualroute.c
193macro-queryprogram.o : routers/queryprogram.c
194 @echo "$(CC) -DMACRO_PREDEF routers/queryprogram.c"
195 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/queryprogram.c
196macro-redirect.o : routers/redirect.c
197 @echo "$(CC) -DMACRO_PREDEF routers/redirect.c"
198 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/redirect.c
199macro-auth-spa.o : auths/auth-spa.c
200 @echo "$(CC) -DMACRO_PREDEF auths/auth-spa.c"
201 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/auth-spa.c
202macro-cram_md5.o : auths/cram_md5.c
203 @echo "$(CC) -DMACRO_PREDEF auths/cram_md5.c"
204 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cram_md5.c
205macro-cyrus_sasl.o : auths/cyrus_sasl.c
206 @echo "$(CC) -DMACRO_PREDEF auths/cyrus_sasl.c"
207 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cyrus_sasl.c
208macro-dovecot.o: auths/dovecot.c
209 @echo "$(CC) -DMACRO_PREDEF auths/dovecot.c"
210 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/dovecot.c
211macro-gsasl_exim.o : auths/gsasl_exim.c
212 @echo "$(CC) -DMACRO_PREDEF auths/gsasl_exim.c"
213 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/gsasl_exim.c
214macro-heimdal_gssapi.o: auths/heimdal_gssapi.c
215 @echo "$(CC) -DMACRO_PREDEF auths/heimdal_gssapi.c"
216 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/heimdal_gssapi.c
217macro-plaintext.o : auths/plaintext.c
218 @echo "$(CC) -DMACRO_PREDEF auths/plaintext.c"
219 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/plaintext.c
220macro-spa.o : auths/spa.c
221 @echo "$(CC) -DMACRO_PREDEF auths/spa.c"
222 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/spa.c
223macro-tls.o: auths/tls.c
224 @echo "$(CC) -DMACRO_PREDEF auths/tls.c"
225 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/tls.c
226macro-dkim.o: dkim.c
227 @echo "$(CC) -DMACRO_PREDEF dkim.c"
228 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ dkim.c
229
230macro_predef: $(OBJ_MACRO)
231 @echo "$(LNCC) -o $@"
232 $(FE)$(LNCC) -o $@ $(LFLAGS) $(OBJ_MACRO)
233
234macro.c: macro_predef
235 ./macro_predef > macro.c
236
237# This target is recognized specially by GNU make. It records those targets
238# that do not correspond to files that are being built and which should
239# therefore always be run, even if the files exist. This shouldn't in fact be a
240# problem, but it does no harm. Other make programs will just ignore this.
241
242.PHONY: all config utils \
243 buildauths buildlookups buildpdkim buildrouters \
244 buildtransports checklocalmake clean
245
246
247utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
248 exigrep eximstats exipick exiqgrep exiqsumm \
249 transport-filter.pl convert4r3 convert4r4 \
250 exim_checkaccess \
251 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
252
253
254# Targets for special-purpose configuration header builders
255buildconfig: buildconfig.c
256 @echo "$(CC) buildconfig.c"
257 $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
258
259
260# Target for the exicyclog utility script
261exicyclog: config ../src/exicyclog.src
262 @rm -f exicyclog
263 @. ./version.sh && sed \
264 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
265 -e "/^# /p" \
266 -e "/^# /d" \
267 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
268 -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
269 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
270 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
271 -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
272 -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
273 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
274 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
275 -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
276 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
277 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
278 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
279 -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
280 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
281 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
282 ../src/exicyclog.src > exicyclog-t
283 @mv exicyclog-t exicyclog
284 @chmod a+x exicyclog
285 @echo ">>> exicyclog script built"
286
287# Target for the exinext utility script
288exinext: config ../src/exinext.src
289 @rm -f exinext
290 @. ./version.sh && sed \
291 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
292 -e "/^# /p" \
293 -e "/^# /d" \
294 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
295 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
296 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
297 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
298 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
299 ../src/exinext.src > exinext-t
300 @mv exinext-t exinext
301 @chmod a+x exinext
302 @echo ">>> exinext script built"
303
304# Target for the exiwhat utility script
305exiwhat: config ../src/exiwhat.src
306 @rm -f exiwhat
307 @. ./version.sh && sed \
308 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
309 -e "/^# /p" \
310 -e "/^# /d" \
311 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
312 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
313 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
314 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
315 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
316 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
317 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
318 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
319 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
320 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
321 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
322 ../src/exiwhat.src > exiwhat-t
323 @mv exiwhat-t exiwhat
324 @chmod a+x exiwhat
325 @echo ">>> exiwhat script built"
326
327# Target for the exim_checkaccess utility script
328exim_checkaccess: config ../src/exim_checkaccess.src
329 @rm -f exim_checkaccess
330 @. ./version.sh && sed \
331 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
332 -e "/^# /p" \
333 -e "/^# /d" \
334 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
335 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
336 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
337 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
338 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
339 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
340 ../src/exim_checkaccess.src > exim_checkaccess-t
341 @mv exim_checkaccess-t exim_checkaccess
342 @chmod a+x exim_checkaccess
343 @echo ">>> exim_checkaccess script built"; echo ""
344
345# Target for the Exim monitor start-up script
346eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
347 ../Local/eximon.conf
348 @rm -f eximon
349 $(SHELL) $(SCRIPTS)/Configure-eximon
350 @. ./version.sh && sed \
351 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
352 -e "/^# /p" \
353 -e "/^# /d" \
354 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
355 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
356 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
357 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
358 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
359 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
360 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
361 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
362 ../src/eximon.src >> eximon
363 @echo ">>> eximon script built"; echo ""
364
365# Targets for utilities; these are all Perl scripts that have to get the
366# location of Perl put in them. A few need other things as well.
367
368exigrep: config ../src/exigrep.src
369 @rm -f exigrep
370 @. ./version.sh && sed \
371 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
372 -e "/^# /p" \
373 -e "/^# /d" \
374 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
375 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
376 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
377 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
378 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
379 ../src/exigrep.src > exigrep-t
380 @mv exigrep-t exigrep
381 @chmod a+x exigrep
382 @echo ">>> exigrep script built"
383
384eximstats: config ../src/eximstats.src
385 @rm -f eximstats
386 @. ./version.sh && sed \
387 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
388 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
389 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
390 ../src/eximstats.src > eximstats-t
391 @mv eximstats-t eximstats
392 @chmod a+x eximstats
393 @echo ">>> eximstats script built"
394
395exiqgrep: config ../src/exiqgrep.src
396 @rm -f exiqgrep
397 @. ./version.sh && sed \
398 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
399 -e "/^# /p" \
400 -e "/^# /d" \
401 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
402 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
403 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
404 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
405 ../src/exiqgrep.src > exiqgrep-t
406 @mv exiqgrep-t exiqgrep
407 @chmod a+x exiqgrep
408 @echo ">>> exiqgrep script built"
409
410exiqsumm: config ../src/exiqsumm.src
411 @rm -f exiqsumm
412 @. ./version.sh && sed \
413 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
414 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
415 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
416 ../src/exiqsumm.src > exiqsumm-t
417 @mv exiqsumm-t exiqsumm
418 @chmod a+x exiqsumm
419 @echo ">>> exiqsumm script built"
420
421exipick: config ../src/exipick.src
422 @rm -f exipick
423 @. ./version.sh && sed \
424 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
425 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
426 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
427 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
428 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
429 ../src/exipick.src > exipick-t
430 @mv exipick-t exipick
431 @chmod a+x exipick
432 @echo ">>> exipick script built"
433
434transport-filter.pl: config ../src/transport-filter.src
435 @rm -f transport-filter.pl
436 @. ./version.sh && sed \
437 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
438 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
439 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
440 ../src/transport-filter.src > transport-filter.pl-t
441 @mv transport-filter.pl-t transport-filter.pl
442 @chmod a+x transport-filter.pl
443 @echo ">>> transport-filter.pl script built"
444
445convert4r3: config ../src/convert4r3.src
446 @rm -f convert4r3
447 @. ./version.sh && sed \
448 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
449 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
450 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
451 ../src/convert4r3.src > convert4r3-t
452 @mv convert4r3-t convert4r3
453 @chmod a+x convert4r3
454 @echo ">>> convert4r3 script built"
455
456convert4r4: config ../src/convert4r4.src
457 @rm -f convert4r4
458 @. ./version.sh && sed \
459 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
460 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
461 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
462 ../src/convert4r4.src > convert4r4-t
463 @mv convert4r4-t convert4r4
464 @chmod a+x convert4r4
465 @echo ">>> convert4r4 script built"
466
467
468# These are objects of optional features. They are always compiled, but
469# if the corresponding #defines are not set, they wind up empty and
470# are thrown away by the linker.
471
472OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
473OBJ_EXPERIMENTAL = bmi_spam.o \
474 dane.o \
475 dcc.o \
476 dmarc.o \
477 imap_utf7.o \
478 spf.o \
479 srs.o \
480 utf8.o
481
482# Targets for final binaries; the main one has a build number which is
483# updated each time. We don't bother with that for the auxiliaries.
484
485OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
486
487OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
488 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
489 filtertest.o globals.o dkim.o dkim_transport.o hash.o \
490 header.o host.o ip.o log.o lss.o match.o moan.o \
491 os.o parse.o queue.o \
492 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
493 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
494 std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
495 environment.o macro.o \
496 $(OBJ_LOOKUPS) \
497 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
498 $(OBJ_EXPERIMENTAL)
499
500exim: buildlookups buildauths pdkim/pdkim.a \
501 buildrouters buildtransports \
502 $(OBJ_EXIM) version.o
503 @echo "$(LNCC) -o exim"
504 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
505 routers/routers.a transports/transports.a lookups/lookups.a \
506 auths/auths.a pdkim/pdkim.a \
507 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
508 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
509 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
510 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
511 echo $(STRIP_COMMAND) exim; \
512 $(STRIP_COMMAND) exim; \
513 fi
514 $(EXIM_CHMOD)
515 @echo " "
516 @echo ">>> exim binary built"
517 @echo " "
518
519# The utility for dumping the contents of an exim database
520
521OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
522
523exim_dumpdb: $(OBJ_DUMPDB)
524 @echo "$(LNCC) -o exim_dumpdb"
525 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
526 $(LIBS) $(EXTRALIBS) $(DBMLIB)
527 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
528 echo $(STRIP_COMMAND) exim_dumpdb; \
529 $(STRIP_COMMAND) exim_dumpdb; \
530 fi
531 @echo ">>> exim_dumpdb utility built"
532 @echo " "
533
534# The utility for interrogating/fixing the contents of an exim database
535
536OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
537
538exim_fixdb: $(OBJ_FIXDB) buildauths
539 @echo "$(LNCC) -o exim_fixdb"
540 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
541 auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
542 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
543 echo $(STRIP_COMMAND) exim_fixdb; \
544 $(STRIP_COMMAND) exim_fixdb; \
545 fi
546 @echo ">>> exim_fixdb utility built"
547 @echo " "
548
549# The utility for tidying the contents of an exim database
550
551OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
552
553exim_tidydb: $(OBJ_TIDYDB)
554 @echo "$(LNCC) -o exim_tidydb"
555 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
556 $(LIBS) $(EXTRALIBS) $(DBMLIB)
557 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
558 echo $(STRIP_COMMAND) exim_tidydb; \
559 $(STRIP_COMMAND) exim_tidydb; \
560 fi
561 @echo ">>> exim_tidydb utility built"
562 @echo " "
563
564# The utility for building dbm files
565
566exim_dbmbuild: exim_dbmbuild.o
567 @echo "$(LNCC) -o exim_dbmbuild"
568 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
569 $(LIBS) $(EXTRALIBS) $(DBMLIB)
570 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
571 echo $(STRIP_COMMAND) exim_dbmbuild; \
572 $(STRIP_COMMAND) exim_dbmbuild; \
573 fi
574 @echo ">>> exim_dbmbuild utility built"
575 @echo " "
576
577# The utility for locking a mailbox while messing around with it
578
579exim_lock: exim_lock.c os.h
580 @echo "$(CC) exim_lock.c"
581 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
582 @echo "$(LNCC) -o exim_lock"
583 $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
584 $(LIBS) $(EXTRALIBS)
585 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
586 echo $(STRIP_COMMAND) exim_lock; \
587 $(STRIP_COMMAND) exim_lock; \
588 fi
589 @echo ">>> exim_lock utility built"
590 @echo " "
591
592# The X-based Exim monitor program's binary part. There's a macro for cutting
593# out the modified TextPop module, because some antique link editors cannot
594# handle the fact that it is redefining things that are found later in the
595# Xaw library.
596
597# Object modules that are the unique Eximon modules
598
599MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
600 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
601 em_text.o em_xs.o
602
603# The complete modules list also includes some specially compiled versions of
604# code from the main Exim source tree.
605
606OBJ_MONBIN = util-spool_in.o \
607 util-store.o \
608 util-string.o \
609 util-queue.o \
610 util-tod.o \
611 tree.o \
612 $(MONBIN)
613
614eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
615 ../exim_monitor/em_version.c
616 @echo "$(CC) exim_monitor/em_version.c"
617 $(FE)$(CC) -o em_version.o -c \
618 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
619 @echo "$(LNCC) -o eximon.bin"
620 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
621 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
622 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
623 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
624 echo $(STRIP_COMMAND) eximon.bin; \
625 $(STRIP_COMMAND) eximon.bin; \
626 fi
627 @echo ">>> exim monitor binary built"
628 @echo " "
629
630
631# Compile step for most of the exim modules. HDRS is a list of headers
632# which cause everything to be rebuilt. PHDRS is the same, for the use
633# of routers, transports, and authenticators. I can't find a way of doing this
634# in one. This list is overkill, but it doesn't really take much time to
635# rebuild Exim on a modern computer.
636
637HDRS = blob.h \
638 config.h \
639 dbfunctions.h \
640 dbstuff.h \
641 exim.h \
642 functions.h \
643 globals.h \
644 hash.h \
645 local_scan.h \
646 macros.h \
647 mytypes.h \
648 sha_ver.h \
649 structs.h \
650 os.h
651PHDRS = ../config.h \
652 ../dbfunctions.h \
653 ../dbstuff.h \
654 ../exim.h \
655 ../functions.h \
656 ../globals.h \
657 ../local_scan.h \
658 ../macros.h \
659 ../mytypes.h \
660 ../structs.h \
661 ../os.h
662
663.SUFFIXES: .o .c
664.c.o:; @echo "$(CC) $*.c"
665 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
666
667# Update Exim's version information and build the version object.
668
669version.h version.sh::
670 @../scripts/reversion
671
672cnumber.h: version.h
673
674version.o: $(HDRS) cnumber.h version.h version.c
675
676# This is the dummy module for use by test compiles of individual modules. It
677# contains functions such as log_write() that may be called from bits of Exim
678# in the tested code.
679
680dummies.o: dummies.c
681
682# Compile instructions for perl.o for when EXIM_PERL is set
683
684perl.o: $(HDRS) perl.c
685 @echo "$(PERL_CC) perl.c"
686 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
687
688# Compile instructions for the database utility modules
689
690exim_dumpdb.o: $(HDRS) exim_dbutil.c
691 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
692 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
693 -DCOMPILE_UTILITY \
694 -DEXIM_DUMPDB \
695 -o exim_dumpdb.o exim_dbutil.c
696
697exim_fixdb.o: $(HDRS) exim_dbutil.c
698 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
699 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
700 -DCOMPILE_UTILITY \
701 -DEXIM_FIXDB \
702 -o exim_fixdb.o exim_dbutil.c
703
704exim_tidydb.o: $(HDRS) exim_dbutil.c
705 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
706 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
707 -DCOMPILE_UTILITY \
708 -DEXIM_TIDYDB \
709 -o exim_tidydb.o exim_dbutil.c
710
711# Compile instructions for exim_dbmbuild
712
713exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
714 @echo "$(CC) exim_dbmbuild.c"
715 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
716 -o exim_dbmbuild.o exim_dbmbuild.c
717
718# Utilities use special versions of some modules - typically with debugging
719# calls cut out.
720
721util-spool_in.o: $(HDRS) spool_in.c
722 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
723 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
724
725util-store.o: $(HDRS) store.c
726 @echo "$(CC) -DCOMPILE_UTILITY store.c"
727 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
728
729util-string.o: $(HDRS) string.c
730 @echo "$(CC) -DCOMPILE_UTILITY string.c"
731 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
732
733util-queue.o: $(HDRS) queue.c
734 @echo "$(CC) -DCOMPILE_UTILITY queue.c"
735 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-queue.o queue.c
736
737util-tod.o: $(HDRS) tod.c
738 @echo "$(CC) -DCOMPILE_UTILITY tod.c"
739 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tod.o tod.c
740
741util-os.o: $(HDRS) os.c
742 @echo "$(CC) -DCOMPILE_UTILITY os.c"
743 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
744 -DCOMPILE_UTILITY \
745 -DOS_LOAD_AVERAGE \
746 -DFIND_RUNNING_INTERFACES \
747 -o util-os.o os.c
748
749# The local scan module depends only on its own special header, and is compiled
750# from a source whose location is set by configuration.
751
752local_scan.o: config local_scan.h ../$(LOCAL_SCAN_SOURCE)
753 @echo "$(CC) local_scan.c"
754 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
755
756# Dependencies for the "ordinary" exim modules
757
758acl.o: $(HDRS) acl.c
759base64.o: $(HDRS) mime.h base64.c
760child.o: $(HDRS) child.c
761crypt16.o: $(HDRS) crypt16.c
762daemon.o: $(HDRS) daemon.c
763dbfn.o: $(HDRS) dbfn.c
764debug.o: $(HDRS) debug.c
765deliver.o: $(HDRS) transports/smtp.h deliver.c
766directory.o: $(HDRS) directory.c
767dns.o: $(HDRS) dns.c
768enq.o: $(HDRS) enq.c
769exim.o: $(HDRS) exim.c
770expand.o: $(HDRS) expand.c
771environment.o: $(HDRS) environment.c
772filter.o: $(HDRS) filter.c
773filtertest.o: $(HDRS) filtertest.c
774globals.o: $(HDRS) globals.c
775hash.o: $(HDRS) hash.c
776header.o: $(HDRS) header.c
777host.o: $(HDRS) host.c
778ip.o: $(HDRS) ip.c
779log.o: $(HDRS) log.c
780lss.o: $(HDRS) lss.c
781match.o: $(HDRS) match.c
782moan.o: $(HDRS) moan.c
783os.o: $(HDRS) $(OS_C_INCLUDES) os.c
784parse.o: $(HDRS) parse.c
785queue.o: $(HDRS) queue.c
786rda.o: $(HDRS) rda.c
787readconf.o: $(HDRS) readconf.c
788receive.o: $(HDRS) receive.c
789retry.o: $(HDRS) retry.c
790rewrite.o: $(HDRS) rewrite.c
791rfc2047.o: $(HDRS) rfc2047.c
792route.o: $(HDRS) route.c
793search.o: $(HDRS) search.c
794sieve.o: $(HDRS) sieve.c
795smtp_in.o: $(HDRS) smtp_in.c
796smtp_out.o: $(HDRS) smtp_out.c
797spool_in.o: $(HDRS) spool_in.c
798spool_out.o: $(HDRS) spool_out.c
799std-crypto.o: $(HDRS) std-crypto.c
800store.o: $(HDRS) store.c
801string.o: $(HDRS) string.c
802tls.o: $(HDRS) tls.c \
803 tls-gnu.c tlscert-gnu.c \
804 tls-openssl.c tlscert-openssl.c
805tod.o: $(HDRS) tod.c
806transport.o: $(HDRS) transport.c
807tree.o: $(HDRS) tree.c
808verify.o: $(HDRS) transports/smtp.h verify.c
809dkim.o: $(HDRS) pdkim/pdkim.h dkim.c
810dkim_transport.o: $(HDRS) dkim_transport.c
811
812# Dependencies for WITH_CONTENT_SCAN modules
813
814malware.o: $(HDRS) malware.c
815mime.o: $(HDRS) mime.h mime.c
816regex.o: $(HDRS) regex.c
817spam.o: $(HDRS) spam.c
818spool_mbox.o: $(HDRS) spool_mbox.c
819
820
821# Dependencies for EXPERIMENTAL_* modules
822
823bmi_spam.o: $(HDRS) bmi_spam.c
824dane.o: $(HDRS) dane.c dane-gnu.c dane-openssl.c
825dcc.o: $(HDRS) dcc.h dcc.c
826dmarc.o: $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
827imap_utf7.o: $(HDRS) imap_utf7.c
828spf.o: $(HDRS) spf.h spf.c
829srs.o: $(HDRS) srs.h srs.c
830utf8.o: $(HDRS) utf8.c
831
832# The module containing tables of available lookups, routers, auths, and
833# transports must be rebuilt if any of them are. However, because the makefiles
834# for the drivers are always run, we don't actually put the dependencies here,
835# because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
836# drtables.o even though the .a files haven't in fact been updated. Instead
837# it is arranged that the lower-level makefiles remove drtables.o when they
838# rebuild the .a files.
839
840drtables.o: $(HDRS) drtables.c
841
842# We depend upon object files built as part of building the lookups library
843# When using parallel make, we don't have the dependency to force building
844# in the sub-directory unless we force that dependency:
845
846$(OBJ_LOOKUPS): buildlookups
847
848# The exim monitor's private modules - the sources live in a private
849# subdirectory. The final binary combines the private modules with some
850# modules from the main exim binary.
851
852em_StripChart.o: ../exim_monitor/em_StripChart.c
853em_TextPop.o: ../exim_monitor/em_TextPop.c
854em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
855em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
856em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
857em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
858em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
859em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
860em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
861em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
862em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
863em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
864$(MONBIN): $(HDRS)
865 @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
866 $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
867 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
868
869
870# Targets for the various libraries that Exim uses.
871
872# The lookups library.
873
874buildlookups: config
875 @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
876 CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
877 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
878 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
879 @echo " "
880
881# The routers library.
882
883buildrouters: config
884 @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
885 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
886 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
887 @echo " "
888
889# The transports library.
890
891buildtransports: config
892 @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
893 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
894 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
895 @echo " "
896
897# The library of authorization modules
898
899buildauths: config
900 @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
901 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
902 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
903 @echo " "
904
905# The PDKIM library
906
907buildpdkim: pdkim/pdkim.a
908pdkim/pdkim.a: config
909 @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
910 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
911 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
912 @echo " "
913
914# The "clean", "install", and "makefile" targets just pass themselves back to
915# the main Exim makefile. These targets will be obeyed only if "make" is obeyed
916# for them in the build directory.
917
918clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
919
920# Targets for building stand-alone testing programs for basic testing of
921# some of the building blocks. These are not integrated with the makefile-
922# building targets. If you change something that is going to cause the
923# makefile to be rebuilt, you must run "make makefile" before running one
924# of these.
925
926# The testing programs use different versions of some modules - usually
927# with bits cut out that are not relevant to the test in hand. For those
928# that are used by several tests, we use a different name.
929
930sa-globals.o: $(HDRS) globals.c
931 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
932
933sa-os.o: $(HDRS) os.c
934 $(CC) -c $(CFLAGS) $(INCLUDE) \
935 -DFIND_RUNNING_INTERFACES \
936 -o sa-os.o os.c
937
938# These are the test targets themselves
939
940test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
941 string.o tod.o version.o utf8.o
942 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
943 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
944 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
945 dummies.o sa-globals.o sa-os.o store.o string.o \
946 tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
947 rm -f dbfn.o store.o
948
949test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
950 store.o string.o tod.o tree.o
951 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
952 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
953 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
954 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
955 $(LNCC) -o test_host $(LFLAGS) \
956 host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
957 tod.o tree.o $(LIBS) $(LIBRESOLV)
958 rm -f child.o dummies.o host.o dns.o
959
960test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
961 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
962 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
963 sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
964 rm -f os.o
965
966test_parse: config.h parse.c dummies.o sa-globals.o \
967 store.o string.o tod.o version.o utf8.o
968 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
969 $(LNCC) -o test_parse $(LFLAGS) parse.o \
970 dummies.o sa-globals.o store.o string.o tod.o version.o \
971 utf8.o $(LDFLAGS)
972 rm -f parse.o
973
974test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
975 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
976 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
977 dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
978 rm -f string.o
979
980# End
diff --git a/OS/Makefile-Default b/OS/Makefile-Default
0new file mode 100644981new file mode 100644
index 0000000..b3990fe
--- /dev/null
+++ b/OS/Makefile-Default
@@ -0,0 +1,321 @@
1##################################################
2# The Exim mail transport agent #
3##################################################
4
5# Generic default make file containing settings that relate to the OS or
6# to selectable features within the OS. The configuration options for Exim
7# itself live in Local/Makefile, which is constructed by editing src/EDITME.
8
9# These settings are basic defaults which may be overridden, either by the
10# generic OS-specific files, or by site-specific files. Do not edit this file.
11# Instead, edit or create suitable OS-specific and/or site specific files.
12# See the manual for details.
13
14
15# MAKE_SHELL contains the name of the shell to be used for executing commands
16# from the make files. Normally /bin/sh should be used.
17
18MAKE_SHELL=/bin/sh
19
20
21# BASENAME_COMMAND contains the path to the "basename" command, which varies
22# from OS to OS. This is used when building the Exim monitor script only. (See
23# also HOSTNAME_COMMAND.) If BASENAME_COMMAND is set to "look_for_it" then the
24# script checks for /usr/bin/basename and /bin/basename, and if neither is
25# found, it uses /usr/ucb/basename. This copes with Solaris 2 and Linux, both
26# of which come in different versions.
27
28BASENAME_COMMAND=/usr/bin/basename
29
30
31# If you set STRIP_COMMAND to the path of the "strip" command, it will be run
32# on every binary that is built. It is left unset by default, which leaves
33# the binaries unstripped.
34
35# STRIP_COMMAND=/usr/bin/strip
36
37
38# Some of the following commands live in different places in different OS. We
39# include them all here for generality.
40
41CHOWN_COMMAND=/usr/bin/chown
42CHGRP_COMMAND=/usr/bin/chgrp
43CHMOD_COMMAND=/usr/bin/chmod
44MV_COMMAND=/bin/mv
45RM_COMMAND=/bin/rm
46TOUCH_COMMAND=/usr/bin/touch
47
48
49# Some operating systems have different ways of building libraries of
50# functions. This macro defines the command to do this, defaulting to
51# the "ar" command with options "cq".
52
53AR=ar cq
54
55
56# Not all operating systems have the iconv() function. Those that do have
57#
58# HAVE_ICONV=yes
59#
60# in their OS-specific Makefiles. On those that don't it is possible to
61# install an independent implementation of iconv(). If you've done this,
62# add "HAVE_ICONV=yes" to your Local/Makefile.
63
64
65# Perl is not necessary for running Exim itself, except when EXIM_PERL
66# is set to cause Perl embedding. However, some Perl utilities are provided
67# for processing the logs. Perl 5 is assumed.
68
69PERL_COMMAND=/usr/bin/perl
70
71
72# CC contains the name of the C compiler to be used.
73
74CC=gcc
75
76
77# CFLAGS contains flags to be passed to the compiler. Nothing is defaulted
78# here; instead each OS-dependent Makefile contains a default setting.
79
80# CFLAGS=-O
81
82
83# LFLAGS contains flags to be passed to the link editor. Nothing is defaulted
84# here; instead each OS-dependent Makefile contains a default setting if one
85# is needed.
86
87# LFLAGS=
88
89
90# PCRE_LIBS contains the library to be linked for PCRE
91
92PCRE_LIBS=-lpcre
93
94
95# LIBS and EXTRALIBS contain library settings that are used on linking
96# commands to build binaries. The OS-dependent Makefile may contain a default
97# setting for LIBS, leaving EXTRALIBS available for adding further libraries
98# that are required for optional extras.
99
100# LIBS=
101# EXTRALIBS=
102
103
104# LIBS_EXIM and EXTRALIBS_EXIM contain library settings that are used
105# only when linking the Exim binary. They are not used for other binaries.
106# One possible use is for the TCP wrappers library.
107
108# LIBS_EXIM=
109# EXTRALIBS_EXIM=
110
111
112# LIBS_EXIMON and EXTRALIBS_EXIMON contain library settings that are
113# used only when linking the Exim monitor binary. They are not used for
114# other binaries.
115
116# LIBS_EXIMON=
117# EXTRALIBS_EXIMON=
118
119
120# The error name for quota exceeded varies among operating systems, and
121# even, unfortunately, in different versions of the same operating system.
122# EDQUOT was not in Sys V, but is in SPEC 1170, apparently. It was used
123# in SunOS4, but got taken out for SunOS5, where ENOSPC was given if a quota
124# was exceeded. However, it got put back into SunOS5 with a patch to 5.4 in
125# order to comply with SPEC 1170. Thus even different patch levels of the same
126# system (SunOS5) may use different numbers.
127#
128# If you don't have quotas or are not interested in handling quota errors
129# specially, just set this variable to 0. If it is not set, it defaults to
130# EDQUOT if that is defined for the OS; otherwise it defaults to ENOSPC.
131
132# ERRNO_QUOTA=EDQUOT
133
134
135# The exiwhat utility script finds all the processes running Exim, and sends
136# them a SIGUSR1 signal to get them to write their status to a file. There are
137# two ways in which this can be done:
138#
139# (1) If the OS has a command to find processes and signal them, that can be
140# used. Linux has "killall"; Solaris has "pkill". (Note: "killall" on Solaris
141# does something very different - and disastrous.) The following are set in the
142# OS-specific Makefiles for those OS where this can be done:
143
144# EXIWHAT_MULTIKILL_CMD=
145# EXIWHAT_MULTIKILL_ARG=
146
147# (2) For other operating systems, exiwhat calls the ps command and egreps the
148# output in order to find all the processes running Exim. The arguments for the
149# various commands needed to do this vary from OS to OS. These defaults work on
150# Solaris 2, HPUX, and IRIX. The OS-specific Makefiles have different versions
151# for other systems, and you can override with your own requirements in your
152# private Makefiles in the Local directory. The most commonly found
153# alternatives are -ax instead of -e for the ps argument, and / instead of a
154# blank before the name exim for the egrep argument on systems whose ps output
155# shows the full path name. The quotes for the egrep argument are specified
156# here so that leading white space can be used. This value should always be
157# given in single quotes.
158
159EXIWHAT_PS_CMD=/bin/ps
160EXIWHAT_PS_ARG=-e
161EXIWHAT_EGREP_ARG=' exim( |$$|-)'
162
163# For both kinds of exiwhat usage, the next setting specifies the signal that
164# is sent.
165
166EXIWHAT_KILL_SIGNAL=-USR1
167
168
169# IPv6 is gradually spreading more and more widely. Most operating systems seem
170# to support it nowadays. If you set this option, IPv6 support will be included
171# in the Exim binary. As well as the basic enabling option, there are
172# parameters for include and library directories that may be needed for IPv6 on
173# some systems, where the support is not yet in the standard library.
174
175# HAVE_IPV6=YES
176# IPV6_INCLUDE=-I /usr/ipv6/include
177# IPV6_LIBS=-L/usr/ipv6/libs -linet6
178
179# Exim uses the function getaddrinfo() for converting IPv6 addresses in text
180# form to binary. Apparently some operating systems do not support this, or not
181# correctly, and require the use of the function inet_pton() instead. The
182# following setting enables this. Note, however, the inet_pton() has reduced
183# functionality compared with getaddrinfo(). In particular, it does not
184# recognize the percent convention for identifying scopes (interfaces) that is
185# used by some operating systems.
186
187# IPV6_USE_INET_PTON=yes
188
189# HOSTNAME_COMMAND contains the path to the "hostname" command, which varies
190# from OS to OS. This is used when building the Exim monitor script only. (See
191# also BASENAME_COMMAND.) If HOSTNAME_COMMAND is set to "look_for_it" then the
192# script checks for /usr/bin/hostname and /bin/hostname, and if neither is
193# found, it uses /usr/ucb/basename. This copes with Solaris 2, which comes in
194# different versions.
195
196HOSTNAME_COMMAND=/bin/hostname
197
198
199# INCLUDE contains arbitrary include parameters that you may need to use
200# when building exim. It is added to every compile command.
201
202# INCLUDE=-I /some/special/include-directory
203
204
205# Some OS require a separate library to be quoted when linking programs that
206# call name resolver functions. This can be set in LIBRESOLV, which is left
207# unset here, but is set is some of the OS-specific Makefiles.
208
209# LIBRESOLV=
210
211
212# Additional libraries and include directories may be required for some
213# lookup styles, e.g. LDAP or SQL. LOOKUP_LIBS is included only on the
214# command for linking Exim itself, not on any auxiliary programs. You
215# don't need to set LOOKUP_INCLUDE if the relevant directories are already
216# specified in INCLUDE.
217
218# LOOKUP_INCLUDE=-I /usr/local/ldap/include -I /usr/local/sql/include
219# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber
220
221
222# RANLIB should be set to something that does nothing on systems that do not
223# have the ranlib command or do not need to run it on library files.
224
225RANLIB=ranlib
226
227
228# EXIM_CHMOD is available to specify a command that is automatically applied
229# to the Exim binary immediately it is compiled. (I find this useful when
230# building test versions.)
231
232EXIM_CHMOD=@true
233
234
235# LOCAL_SCAN_SOURCE defines the file in which the function local_scan() is
236# defined. This provides the administrator with a hook for including C code
237# for scanning incoming mails. The path that is defined must be relative to
238# the Exim distribution directory. For example
239
240# LOCAL_SCAN_SOURCE=Local/local_scan.c
241
242# The default setting points to a template function that doesn't actually do
243# any scanning, but just accepts the message.
244
245LOCAL_SCAN_SOURCE=src/local_scan.c
246
247# If you want to specify options for your local_scan() that can be set from
248# the main Exim configuration file, you need to uncomment the following line,
249# and then provide a table of options in your local_scan() source, as described
250# in the reference manual.
251
252# LOCAL_SCAN_HAS_OPTIONS=yes
253
254
255#############################################################################
256# The following are all concerned with configuring the way Exim handles its
257# database (hints) and other dbm files.
258
259# Some systems require a separate library to be supplied when linking programs
260# that make use of DBM library calls. This can be set in DBMLIB, which is unset
261# by default, but is set in some of the OS-specific Makefiles. Setting it in
262# your Local/Makefile will override any other setting.
263
264# DBMLIB=
265
266
267# When Exim is attempting to lock one of its database (hints) files, it
268# applies a timeout which can be altered here.
269
270# EXIMDB_LOCK_TIMEOUT=60
271
272
273# By default, Exim uses traditional ndbm function calls to handle its indexed
274# hints databases. On systems that have Berkeley db installed, this still
275# works via the compatibility interface. However, by defining USE_DB you can
276# make it use native db function calls.
277
278# USE_DB=YES
279
280# Similarly, if you are using gdbm, Exim will by default use the ndbm
281# compatibility interface. However, by defining USE_GDBM you can make it
282# use the native gdbm function calls.
283
284# USE_GDBM=YES
285
286
287#############################################################################
288# The following definitions are relevant only when compiling the Exim monitor
289# program, which requires an X11 display. See the variable EXIM_MONITOR in
290# src/EDITME for how to suppress this compilation.
291
292# X11 contains the location of the X11 libraries and include files.
293
294X11=/usr/X11R6
295
296# XINCLUDE contains options for header inclusion when compiling functions
297# that call X11 functions.
298
299XINCLUDE=-I$(X11)/include
300
301# XLFLAGS contains flags to be passed to the linker when linking the monitor.
302
303XLFLAGS=-L$(X11)/lib
304
305# X11_LD_LIB contains the name of the X11 library that is to be added to
306# LD_LIBRARY_PATH when running the monitor program.
307
308X11_LD_LIB=$(X11)/lib
309
310# A modified version of the Athena TextPop module is supplied with Exim. The
311# modification is to remove the "replace" part of the "search and replace"
312# operation because it isn't wanted. TextPop is only one of a number of
313# modules that make up the Text widget. Some antique link editors cannot handle
314# the case of a replacement module for one of a set of modules. To allow
315# the monitor to be linked in such cases, set the value of EXIMON_TEXTPOP
316# to be empty. The search operations will then contain a useless "replace"
317# option, which is untidy, but does no harm.
318
319EXIMON_TEXTPOP=em_TextPop.o
320
321# End
diff --git a/OS/Makefile-FreeBSD b/OS/Makefile-FreeBSD
0new file mode 100644322new file mode 100644
index 0000000..7c6c064
--- /dev/null
+++ b/OS/Makefile-FreeBSD
@@ -0,0 +1,54 @@
1# Exim: OS-specific make file for FreeBSD
2# There's no setting of CFLAGS here, to allow the system default
3# for "make" to be the default.
4
5CHOWN_COMMAND=/usr/sbin/chown
6STRIP_COMMAND=/usr/bin/strip
7CHMOD_COMMAND=/bin/chmod
8
9# FreeBSD Ports no longer insert compatibility symlinks into /usr/bin for
10# scripting languages which traditionally have had them.
11PERL_COMMAND=/usr/local/bin/perl
12
13HAVE_SA_LEN=YES
14
15# crypt() is in a separate library
16LIBS=-lcrypt -lm -lutil
17
18# Dynamically loaded modules need to be built with -fPIC
19CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
20
21# FreeBSD always ships with Berkeley DB
22USE_DB=yes
23
24# This code for building outside ports suggested by Richard Clayton
25.ifdef X11BASE
26X11=${X11BASE}
27.elifdef LOCALBASE
28X11=$(LOCALBASE)
29.else
30X11=/usr/local
31.endif
32
33# nb: FreeBSD is entirely elf; objformat was removed prior to FreeBSD 7
34# http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/objformat/Attic/objformat.c
35# deleted Jan 2007.
36#
37# So if this fails, you're on an ancient unsupported FreeBSD release *and*
38# running GUI software, which seems both unusual and unwise.
39#
40# http://www.freebsd.org/doc/handbook/binary-formats.html suggests that the
41# switch to default to ELF came with FreeBSD 3. elf(5) claims ELF support
42# introduced in FreeBSD 2.2.6.
43#
44XINCLUDE=-I$(X11)/include
45XLFLAGS=-L$(X11)/lib -Wl,-rpath,${X11}/lib
46X11_LD_LIB=$(X11)/lib
47
48EXIWHAT_PS_ARG=-ax
49EXIWHAT_EGREP_ARG='/exim( |$$)'
50EXIWHAT_MULTIKILL_CMD='killall -m'
51EXIWHAT_MULTIKILL_ARG='^exim($$|-[0-9.]+-[0-9]+$$)'
52EXIWHAT_KILL_SIGNAL=-USR1
53
54# End
diff --git a/OS/Makefile-Linux b/OS/Makefile-Linux
0new file mode 10064455new file mode 100644
index 0000000..990f884
--- /dev/null
+++ b/OS/Makefile-Linux
@@ -0,0 +1,36 @@
1# Exim: OS-specific make file for Linux. This is for modern Linuxes,
2# which use libc6.
3#
4# For Linux, we assume GNU Make; at time of writing, the only extension
5# used is ?= which is actually portable to other maintained Make variants,
6# just is not POSIX.
7
8HAVE_ICONV=yes
9
10BASENAME_COMMAND=look_for_it
11CHOWN_COMMAND=look_for_it
12CHGRP_COMMAND=look_for_it
13CHMOD_COMMAND=look_for_it
14
15# Preserve CFLAGS and CFLAGS_DYNAMIC from the caller/environment
16CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
17CFLAGS_DYNAMIC ?= -shared -rdynamic
18
19DBMLIB = -ldb
20USE_DB = yes
21
22LIBS = -lnsl -lcrypt -lm
23LIBRESOLV = -lresolv
24
25X11=/usr/X11R6
26XINCLUDE=-I$(X11)/include
27XLFLAGS=-L$(X11)/lib
28X11_LD_LIB=$(X11)/lib
29
30EXIWHAT_PS_ARG=ax
31EXIWHAT_EGREP_ARG='/exim( |$$)'
32EXIWHAT_MULTIKILL_CMD=killall
33EXIWHAT_MULTIKILL_ARG=exim
34EXIWHAT_KILL_SIGNAL=-USR1
35
36# End
diff --git a/OS/Makefile-OpenBSD b/OS/Makefile-OpenBSD
0new file mode 10064437new file mode 100644
index 0000000..1022abb
--- /dev/null
+++ b/OS/Makefile-OpenBSD
@@ -0,0 +1,28 @@
1# Exim: OS-specific make file for OpenBSD
2
3CHOWN_COMMAND=/usr/sbin/chown
4CHGRP_COMMAND=/usr/sbin/chgrp
5CHMOD_COMMAND=/bin/chmod
6
7CFLAGS=-O2 -Wall
8
9LIBS=-lm
10
11HAVE_SA_LEN=YES
12
13X11=/usr/X11R6
14XINCLUDE=-I$(X11)/include
15XLFLAGS=-L$(X11)/lib
16
17EXIWHAT_MULTIKILL_CMD=pkill
18EXIWHAT_MULTIKILL_ARG='exim( |$$|-)'
19EXIWHAT_PS_ARG=-ax
20EXIWHAT_EGREP_ARG='/exim( |$$)'
21EXIWHAT_KILL_SIGNAL=-USR1
22
23HAVE_IPV6=YES
24
25# OpenBSD always ships with Berkeley DB
26USE_DB=yes
27
28# End
diff --git a/OS/Makefile-SunOS5 b/OS/Makefile-SunOS5
0new file mode 10064429new file mode 100644
index 0000000..568e99f
--- /dev/null
+++ b/OS/Makefile-SunOS5
@@ -0,0 +1,24 @@
1# Exim: OS-specific make file for SunOS5
2
3CFLAGS=-O
4
5HAVE_ICONV=yes
6
7BASENAME_COMMAND=look_for_it
8HOSTNAME_COMMAND=look_for_it
9
10RANLIB=@true
11LIBS=-lsocket -lnsl -lkstat -lm
12LIBRESOLV=-lresolv
13
14EXIWHAT_MULTIKILL_CMD=pkill
15EXIWHAT_MULTIKILL_ARG='exim( |$$|-)'
16
17X11=/usr/openwin
18XINCLUDE=-I$(X11)/include
19XLFLAGS=-L$(X11)/lib -R$(X11)/lib
20X11LIB=$(X11)/lib
21
22OS_C_INCLUDES=setenv.c
23
24# End
diff --git a/OS/eximon.conf-Default b/OS/eximon.conf-Default
0new file mode 10064425new file mode 100644
index 0000000..2f874ef
--- /dev/null
+++ b/OS/eximon.conf-Default
@@ -0,0 +1,41 @@
1# Exim: Default settings for the eximon script which fires up the Exim monitor.
2# These can be overridden by OS-specific scripts and local installation
3# scripts, and also at run time by shell variables.
4
5# The name of the eximon binary, usually the same as the eximon script,
6# with .bin stuck on the end.
7
8EXIMON_BINARY="${EXIMON_BINARY-$0.bin}"
9
10# The remaining parameters are values likely to be changed to suit the
11# user's taste. They are documented in the EDITME file.
12
13WINDOW_TITLE=${EXIMON_WINDOW_TITLE-'"${hostname} eximon"'}
14
15ACTION_OUTPUT=${EXIMON_ACTION_OUTPUT-no}
16ACTION_QUEUE_UPDATE=${EXIMON_ACTION_QUEUE_UPDATE-yes}
17BODY_MAX=${EXIMON_BODY_MAX-20000}
18LOG_DEPTH=${EXIMON_LOG_DEPTH-300}
19LOG_WIDTH=${EXIMON_LOG_WIDTH-${EXIMON_WIDTH-950}}
20LOG_BUFFER=${EXIMON_LOG_BUFFER-20K}
21LOG_FONT=${EXIMON_LOG_FONT--misc-fixed-medium-r-normal-*-14-140-*-*-*-*-iso8859-1}
22LOG_STRIPCHARTS='/ <= /in/
23 / => /out/
24 / => .+ R=local/local/
25 / => .+ T=[^ ]*smtp/smtp/'
26MENU_EVENT=${EXIMON_MENU_EVENT-'Shift<Btn1Down>'}
27MIN_HEIGHT=${EXIMON_MIN_HEIGHT-162}
28MIN_WIDTH=${EXIMON_MIN_WIDTH-103}
29QUEUE_DEPTH=${EXIMON_QUEUE_DEPTH-200}
30QUEUE_WIDTH=${EXIMON_QUEUE_WIDTH-${EXIMON_WIDTH-950}}
31QUEUE_FONT=${EXIMON_QUEUE_FONT-${LOG_FONT}}
32QUEUE_MAX_ADDRESSES=${EXIMON_QUEUE_MAX_ADDRESSES-10}
33QUEUE_INTERVAL=${EXIMON_QUEUE_INTERVAL-300}
34QUEUE_STRIPCHART_NAME=${EXIMON_QUEUE_STRIPCHART_NAME-queue}
35SIZE_STRIPCHART=${EXIMON_SIZE_STRIPCHART}
36SIZE_STRIPCHART_NAME=${EXIMON_SIZE_STRIPCHART_NAME}
37START_SMALL=${EXIMON_START_SMALL-no}
38STRIPCHART_INTERVAL=${EXIMON_STRIPCHART_INTERVAL-60}
39TEXT_DEPTH=${EXIMON_TEXT_DEPTH-200}
40
41# End
diff --git a/OS/os.Configuring b/OS/os.Configuring
0new file mode 10064442new file mode 100644
index 0000000..465bc26
--- /dev/null
+++ b/OS/os.Configuring
@@ -0,0 +1,215 @@
1Configuring Exim for different Operating Systems
2------------------------------------------------
3
4These notes describe the way in which Exim is configured at the C program level
5for different operating systems. The normal configuration options that apply
6independently of the operating system are specified by creating files in the
7Local directory, as described in chapter 4 of the manual.
8
9These notes cover the os.* files in the OS directory, and contain information
10for people who want to port the program to some new OS, or to modify the
11configuration for an existing port. If you are just wanting to compile Exim on
12a system that it already knows about, you do not need to read further unless
13there are problems.
14
15The os.c-<ostype> files
16-----------------------
17
18There may be an os.c-<ostype> file for each operating system, but for many of
19them it is not necessary. No error occurs is there isn't one. There is a
20generic file called os.c which contains code that is common to two or more OS
21for setting a restarting or a non-restarting signal, for computing the load
22average, and for finding all the network interface addresses. A few OS have
23their own individual code for one or more of these. When they do, the code is
24put into an os.c-<ostype> file, which also defines a macro such as
25OS_RESTARTING_SIGNAL (for example) to cut out the common code in the generic
26os.c.
27
28The os.h-<ostype> files
29-----------------------
30
31For each OS that Exim knows about, there is an os.h-<ostype> file, where
32<ostype> is the OS name. The relevant file is included as a C header file for
33all Exim compilation by pointing a symbolic link called os.h at it from the
34build directory. The settings are as follows:
35
36The select() function
37---------------------
38
39There is a difference in the data type for the second argument to the select()
40function in some OS. The macro SELECT_ARG2_TYPE can be used to define the type.
41If it is not defined in os.h, then it is defaulted to fs_set in exim.h.
42
43The dn_expand() function
44------------------------
45
46There is a difference in the data type for the fourth argument to the
47dn_expand() function in some OS. The macro DN_EXPAND_ARG4_TYPE can be used to
48define the type. If it is not defined in os.h, then it is defaulted to char *
49in exim.h.
50
51The h_errno variable
52--------------------
53
54If NEED_H_ERRNO is defined, then a definition of the form
55
56extern int h_errno
57
58is included in the compiled code of Exim.
59
60The strerror() function
61-----------------------
62
63Most systems provide the ANSI standard strerror() function; older systems may
64instead have an errlist[] variable in which to look up error texts. Defining
65STRERROR_FROM_ERRLIST causes Exim to build its own strerror() function that
66mimics the ANSI function by lookup up the error code in errlist.
67
68Truncating files
69----------------
70
71The fcntl() option for truncating the length of a file is called F_FREESP in
72most systems; in some, however, it is called O_TRUNC. Some os.h files define
73F_FREESP to be O_TRUNC for this reason.
74
75Finding local interfaces
76------------------------
77
78The SIOCGIFCONF ioctl for finding local interfaces behaves differently on BSD
79systems. It returns a vector of ifreq blocks containing sockaddr structures
80that can be longer than their sizeof definition, making the returned ifreq
81blocks longer than their sizeof definitions. BSD sockaddrs structures contain
82an sa_len field giving the actual size. To cope with difference, there is a
83macro called HAVE_SA_LEN. If it is defined, code that works on BSD systems is
84used. Otherwise, the objects returned by SIOCGIFCONF are assumed to be of
85length sizeof(struct ifreq).
86
87On some operating systems, the SIOCGIFCONF ioctl returns the IP addresses
88with the list of interfaces, and there is no need to call SIOCGIFADDR for each
89individual address. Mostly, making the second call does no harm, but on Linux
90when there are IP aliases, it causes things to go wrong. This also happens on
91BSDI and GNU Hurd. Therefore, there is now a macro to cut it out, called
92SIOCGIFCONF_GIVES_ADDR.
93
94Note that, if IPv6 support is configured, Exim cannot find the IPv6 addresses
95on local interfaces by itself. You need to set the local_interfaces option in
96this situation.
97
98Computing load averages
99-----------------------
100
101There are several different ways that load averages are computed. One-off code
102is put in the os.c-<ostype>, but several OS use similar methods, and these
103are coded in the generic os.c, using a number of parameters to make variations
104between OS.
105
106Sometimes the load average is not available to unprivileged callers. If
107LOAD_AVG_NEEDS_ROOT is set, Exim ensures that it is root before trying to
108obtain a load average value.
109
110(1) If HAVE_BSD_GETLOADAVG is defined, Exim uses a simple call to the
111getloadavg() function.
112
113(2) If HAVE_KSTAT is defined, Exim uses the kstat package as found in Solaris 2
114(but nowhere else as yet). It uses some supplementary definitions:
115
116 LOAD_AVG_KSTAT the kstat to use
117 LOAD_AVG_KSTAT_MODULE the module to access
118 LOAD_AVG_KSTAT_SYMBOL the symbol containing the value we want
119 LOAD_AVG_KSTAT_FIELD the field identity
120
121(3) If HAVE_DEV_KMEM is defined, Exim reads load average values from the
122/dev/kmem device. It uses some supplementary definitions:
123
124 LOAD_AVG_TYPE the data type
125 LOAD_AVG_SYMBOL the symbol to look up
126 KERNEL_PATH the name of the kernel
127 FSCALE a scaling factor
128
129Sometimes FSCALE is defined in system headers so need not be defined in the
130os.h-<ostype> file.
131
132Glibc systems and IP options
133----------------------------
134
135The code for inspecting IP options is the same in all OS except for systems
136using glibc (e.g. Linux), which uses a different structure to return data from
137getsockopt(). To handle this, there is a macro called
138
139 GLIBC_IP_OPTIONS
140
141which should be set for Linux (in os.h-Linux) and any other operating system
142that uses glibc.
143
144Options for statvfs()
145---------------------
146
147The following settings apply to the compilation of the Exim monitor as well as
148to the main Exim binary.
149
150#undefine HAVE_STATFS
151
152Exim has options for checking the amount of space in the spool partition
153before accepting a message, and the monitor has the ability to display a
154stripchart of the percentage fullness of a particular disc partition, usually
155/var/spool/mail. The standard way of finding out the data is to call the
156statvfs() function, but some operating systems use statfs() and some may not
157have the ability at all. The Exim code uses STATVFS() for this function and
158this gets defined appropriately. HAVE_STATFS is defined before including the
159os.h file; undefining it suppresses the code for checking a partition in the
160main binary, and for monitoring disc partition in the monitor.
161
162When HAVE_STATFS is defined, the distinction between statvfs() and statfs() is
163made by checking HAVE_SYS_STATVFS_H. If it is defined, then sys/statvfs.h is
164included. Otherwise, STATVFS() is defined as a macro for statfs(), and some
165further includes are done, according to the following definitions:
166
167#define HAVE_SYS_MOUNT_H
168#define HAVE_VFS_H
169
170Each of those definitions causes the inclusion of the corresponding system
171header file in the Exim monitor compilation. For example, the first one causes
172
173#include <sys/mount.h>
174
175to be obeyed. Different systems may require different combinations of these
176headers.
177
178The sys/resource.h header
179-------------------------
180
181One OS does not have the sys/resource.h header. If NO_SYS_RESOURCE_H is defined
182in an os.h-<ostype> file, then the #include for this header is skipped in
183exim.h.
184
185Support for login_cap functions
186-------------------------------
187
188Some of the BSD systems support functions for controlling the resources that
189user processes can use (e.g. login_getpwclass). If HAVE_SETCLASSRESOURCES is
190defined, Exim supports this feature for running pipe deliveries, using the
191setclassresources() function.
192
193The crypt_h header
194------------------
195
196Some OS require crypt.h to be included to get a prototype for the crypt()
197function. This is needed only when compiling with AUTH support. If CRYPT_H is
198defined, then this header is included.
199
200mmap() support
201--------------
202
203The CDB support includes the option of handling file operations by using
204mmap()/munmap(). This gives a reasonable performance increase which will
205probably scale over multiple processes (since the files are mapped read-only
206shared). The vast majority of modern operating systems will support mmap
207(certainly in the simplified way that it is being used here). For example any
208BSD 4.x derived or POSIX compliant system will support it, as will pretty much
209any system using dynamically shared link libraries.
210
211If the OS is believed to support mmap() then the symbol HAVE_MMAP is defined.
212Not all systems that support mmap will have had their config files updated to
213reflect this. Currently Linux, Sun, BSD and SGI/mips systems have been updated.
214
215*** End ***
diff --git a/OS/os.c-FreeBSD b/OS/os.c-FreeBSD
0new file mode 100644216new file mode 100644
index 0000000..715a9ed
--- /dev/null
+++ b/OS/os.c-FreeBSD
@@ -0,0 +1,24 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) Jeremy Harris 2017 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* FreeBSD-specific code. This is concatenated onto the generic
9src/os.c file. */
10
11
12/*************
13* Sendfile *
14*************/
15
16ssize_t
17os_sendfile(int out, int in, off_t * off, size_t cnt)
18{
19off_t written;
20return sendfile(in, out, *off, cnt, NULL, &written, 0) < 0
21 ? (ssize_t) -1 : (ssize_t) written;
22}
23
24/* End of os.c-Linux */
diff --git a/OS/os.c-Linux b/OS/os.c-Linux
0new file mode 10064425new file mode 100644
index 0000000..a10bc7d
--- /dev/null
+++ b/OS/os.c-Linux
@@ -0,0 +1,165 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 1997 - 2017 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* Linux-specific code. This is concatenated onto the generic
9src/os.c file. */
10
11
12/*************************************************
13* Load average computation *
14*************************************************/
15
16/*Linux has an apparently unique way of getting the load average, so we provide
17a unique function here, and define OS_LOAD_AVERAGE to stop src/os.c trying to
18provide the function. However, when compiling os.c for utilities, we may not
19want this at all, so check that it isn't set first. */
20
21#if !defined(OS_LOAD_AVERAGE) && defined(__linux__)
22#define OS_LOAD_AVERAGE
23
24/* Linux has 2 ways of returning load average:
25
26 (1) Do a read on /proc/loadavg
27 (2) Use the sysinfo library function and syscall
28
29The latter is simpler but in Linux 2.0 - 2.2 (and probably later releases) is
30exceptionally slow - 10-50ms per call is not unusual and about 100x slow the
31first method. This cripples high performance mail servers by increasing CPU
32utilisation by 3-5x.
33
34In Exim's very early days, it used the 1st method. Later, it switched to the
352nd method. Now it tries the 1st method and falls back to the 2nd if /proc is
36unavailable. */
37
38#include <sys/sysinfo.h>
39
40static int
41linux_slow_getloadavg(void)
42{
43struct sysinfo s;
44double avg;
45if (sysinfo(&s) < 0) return -1;
46avg = (double) (s.loads[0]) / (1<<SI_LOAD_SHIFT);
47return (int)(avg * 1000.0);
48}
49
50int
51os_getloadavg(void)
52{
53char buffer[40];
54double avg;
55int count;
56int fd = open ("/proc/loadavg", O_RDONLY);
57if (fd == -1) return linux_slow_getloadavg();
58count = read (fd, buffer, sizeof(buffer));
59(void)close (fd);
60if (count <= 0) return linux_slow_getloadavg();
61count = sscanf (buffer, "%lf", &avg);
62if (count < 1) return linux_slow_getloadavg();
63return (int)(avg * 1000.0);
64}
65#endif /* OS_LOAD_AVERAGE */
66
67
68
69
70
71/*************************************************
72* Finding interface addresses *
73*************************************************/
74
75/* This function is not required for utilities; we cut it out if
76FIND_RUNNING_INTERFACES is already defined. */
77
78#ifndef FIND_RUNNING_INTERFACES
79
80/* This code, contributed by Jason Gunthorpe, appears to be the current
81way of finding IPv6 interfaces in Linux. It first calls the common function in
82order to find IPv4 interfaces, then grobbles around to find the others. Jason
83said, "This is so horrible, don't look. Slightly ripped from net-tools
84ifconfig." It gets called by virtue of os_find_running_interfaces being defined
85as a macro for os_find_running_interfaces_linux in the os.h-Linux file. */
86
87ip_address_item *
88os_find_running_interfaces_linux(void)
89{
90ip_address_item *yield = NULL;
91
92#if HAVE_IPV6
93ip_address_item *last = NULL;
94ip_address_item *next;
95char addr6p[8][5];
96unsigned int plen, scope, dad_status, if_idx;
97char devname[20+1];
98FILE *f;
99#endif
100
101yield = os_common_find_running_interfaces();
102
103#if HAVE_IPV6
104
105/* Open the /proc file; give up if we can't. */
106
107if ((f = fopen("/proc/net/if_inet6", "r")) == NULL) return yield;
108
109/* Pick out the data from within the file, and add it on to the chain */
110
111last = yield;
112if (last != NULL) while (last->next != NULL) last = last->next;
113
114while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
115 addr6p[0], addr6p[1], addr6p[2], addr6p[3],
116 addr6p[4], addr6p[5], addr6p[6], addr6p[7],
117 &if_idx, &plen, &scope, &dad_status, devname) != EOF)
118 {
119 struct sockaddr_in6 addr;
120
121 /* This data has to survive for ever, so use malloc. */
122
123 next = store_malloc(sizeof(ip_address_item));
124 next->next = NULL;
125 next->port = 0;
126 sprintf(CS next->address, "%s:%s:%s:%s:%s:%s:%s:%s",
127 addr6p[0], addr6p[1], addr6p[2], addr6p[3],
128 addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
129
130 /* Normalize the representation */
131
132 inet_pton(AF_INET6, CS next->address, &addr.sin6_addr);
133 inet_ntop(AF_INET6, &addr.sin6_addr, CS next->address, sizeof(next->address));
134
135 if (yield == NULL) yield = last = next; else
136 {
137 last->next = next;
138 last = next;
139 }
140
141 DEBUG(D_interface)
142 debug_printf("Actual local interface address is %s (%s)\n", last->address,
143 devname);
144 }
145fclose(f);
146#endif /* HAVE_IPV6 */
147
148return yield;
149}
150
151#endif /* FIND_RUNNING_INTERFACES */
152
153
154/*************
155* Sendfile *
156*************/
157#include <sys/sendfile.h>
158
159ssize_t
160os_sendfile(int out, int in, off_t * off, size_t cnt)
161{
162return sendfile(out, in, off, cnt);
163}
164
165/* End of os.c-Linux */
diff --git a/OS/os.c-SunOS5 b/OS/os.c-SunOS5
0new file mode 100644166new file mode 100644
index 0000000..1624869
--- /dev/null
+++ b/OS/os.c-SunOS5
@@ -0,0 +1,16 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2016 */
6/* Copyright (c) Jeremy Harris 2016 */
7/* See the file NOTICE for conditions of use and distribution. */
8
9/* Solaris-specific code. This is concatenated onto the generic
10src/os.c file. */
11
12#if defined(MISSING_UNSETENV_3) && !defined(COMPILE_UTILITY)
13# include "setenv.c"
14#endif
15
16/* End of os.c-SunOS5 */
diff --git a/OS/os.h-FreeBSD b/OS/os.h-FreeBSD
0new file mode 10064417new file mode 100644
index 0000000..8b1af39
--- /dev/null
+++ b/OS/os.h-FreeBSD
@@ -0,0 +1,68 @@
1/* Exim: OS-specific C header file for FreeBSD */
2/* Copyright (c) University of Cambridge 2017 */
3/* See the file NOTICE for conditions of use and distribution. */
4
5
6#include <sys/types.h>
7
8#define HAVE_BSD_GETLOADAVG
9#define HAVE_SETCLASSRESOURCES
10#define HAVE_MMAP
11#define HAVE_SYS_MOUNT_H
12#define SIOCGIFCONF_GIVES_ADDR
13#define HAVE_SRANDOMDEV
14#define HAVE_ARC4RANDOM
15
16typedef struct flock flock_t;
17
18/* iconv arg2 type: libiconv in Ports uses "const char* * inbuf" and was
19 * traditionally the only approach available. The iconv functionality
20 * in libc is "char ** restrict src".
21 *
22 * <https://www.freebsd.org/doc/en/books/porters-handbook/using-iconv.html>
23 * says that libc has iconv since 2013, in 10-CURRENT. FreeBSD man-pages
24 * shows it included in 10.0-RELEASE. Writing this in 2017, 10.3 is the
25 * oldest supported release, so we should assume non-libiconv by default.
26 * (Actually, people still using old releases past EOL; we shouldn't support
27 * them but I don't want to deal with howls of complaints because we dare
28 * to not support the unsupported, so guard this on FreeBSD 10+)
29 *
30 * Thus we no longer override iconv.
31 *
32 * However, if libiconv is installed, and anything adds /usr/local/include
33 * to include-path (likely) then we'll get that. So define a variable
34 * which makes the libiconv try to not interfere with OS iconv.
35 */
36#if __FreeBSD__ >= 10
37# define LIBICONV_PLUG
38#endif
39/* for more specific version constraints, include <sys/param.h> and look at
40 * __FreeBSD_version */
41
42
43/* When using DKIM, setting OS_SENDFILE can increase
44performance on outgoing mail a bit. */
45
46#define OS_SENDFILE
47extern ssize_t os_sendfile(int, int, off_t *, size_t);
48
49
50/*******************/
51
52/* TCP_FASTOPEN support. There does not seems to be a
53MSG_FASTOPEN defined yet... */
54#define EXIM_TFO_PROBE
55
56#include <netinet/tcp.h> /* for TCP_FASTOPEN */
57#include <sys/socket.h> /* for MSG_FASTOPEN */
58#if defined(TCP_FASTOPEN) && !defined(MSG_FASTOPEN)
59# define MSG_FASTOPEN 0x20000000
60#endif
61
62/* for TCP state-variable values, for TFO logging */
63#include <netinet/tcp_fsm.h>
64#define TCP_SYN_RECV TCPS_SYN_RECEIVED
65
66/*******************/
67
68/* End */
diff --git a/OS/os.h-Linux b/OS/os.h-Linux
0new file mode 10064469new file mode 100644
index 0000000..88c4d91
--- /dev/null
+++ b/OS/os.h-Linux
@@ -0,0 +1,88 @@
1/* Exim: OS-specific C header file for Linux */
2/* Copyright (c) University of Cambridge 2017 */
3/* See the file NOTICE for conditions of use and distribution. */
4
5
6/* Some old systems we've received bug-reports for have a <limits.h> which
7does not pull in <features.h>. Best to just pull it in now and have done
8with the issue. */
9
10#include <features.h>
11#include <sys/types.h>
12
13
14#define CRYPT_H
15#define GLIBC_IP_OPTIONS
16#define HAVE_MMAP
17#define HAVE_BSD_GETLOADAVG
18#define HAVE_SYS_STATVFS_H
19#define NO_IP_VAR_H
20#define SIG_IGN_WORKS
21
22/* When using DKIM, setting OS_SENDFILE can increase
23performance on outgoing mail a bit. Note: With older glibc versions
24this setting will conflict with the _FILE_OFFSET_BITS=64 setting
25defined as part of the Linux CFLAGS. As of 2017 those are declared
26to be too old to build by default. */
27
28#define OS_SENDFILE
29extern ssize_t os_sendfile(int, int, off_t *, size_t);
30
31#define F_FREESP O_TRUNC
32typedef struct flock flock_t;
33
34#define os_strsignal strsignal
35#define OS_STRSIGNAL
36
37#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD_kernel__)
38# define SIOCGIFCONF_GIVES_ADDR
39# define HAVE_SYS_MOUNT_H
40#endif
41
42#if defined(__linux__)
43
44/* Some versions of Linux need explicit sync-ing of directories as well as
45files. This setting requests that. If the directory is on NFS, it may not
46be possible to sync it - in that case, Exim now should ignore the error. But
47if you have problems in that area, try undefining this. But be aware that you
48may be in a situation where files are not being properly "committed to stable
49storage" as quickly as Exim thinks they are. */
50
51#define NEED_SYNC_DIRECTORY
52
53#define os_find_running_interfaces os_find_running_interfaces_linux
54
55/* Need a prototype for the Linux-specific function. The structure hasn't
56been defined yet, so we need to pre-declare it. */
57
58struct ip_address_item;
59extern struct ip_address_item *os_find_running_interfaces_linux(void);
60
61#endif /* __linux__ */
62
63/* Some folks running "unusual" setups with very old libc environments have
64found that _GNU_SOURCE=1 before <features.h> is not sufficient to define some
65constants needed for 64-bit arithmetic. If you encounter build errors based
66on LLONG_MIN being undefined and various other escape hatches have not helped,
67then change the 0 to 1 in the next block. */
68
69#if 0
70# define LLONG_MIN LONG_LONG_MIN
71# define LLONG_MAX LONG_LONG_MAX
72#endif
73
74#if _POSIX_C_SOURCE >= 200809L || _ATFILE_SOUCE
75# define EXIM_HAVE_OPENAT
76#endif
77
78/* TCP Fast Open support */
79
80#include <netinet/tcp.h> /* for TCP_FASTOPEN */
81#include <sys/socket.h> /* for MSG_FASTOPEN */
82#if defined(TCP_FASTOPEN) && !defined(MSG_FASTOPEN)
83# define MSG_FASTOPEN 0x20000000
84#endif
85#define EXIM_HAVE_TCPI_UNACKED
86
87
88/* End */
diff --git a/OS/os.h-OpenBSD b/OS/os.h-OpenBSD
0new file mode 10064489new file mode 100644
index 0000000..81ed487
--- /dev/null
+++ b/OS/os.h-OpenBSD
@@ -0,0 +1,56 @@
1/* Exim: OS-specific C header file for OpenBSD */
2/* Copyright (c) University of Cambridge 2017 */
3/* See the file NOTICE for conditions of use and distribution. */
4
5
6#define HAVE_BSD_GETLOADAVG
7#define HAVE_MMAP
8#define HAVE_SYS_MOUNT_H
9#define SIOCGIFCONF_GIVES_ADDR
10#define HAVE_ARC4RANDOM
11/* In May 2014, OpenBSD 5.5 was released which cleaned up the arc4random_* API
12 which removed the arc4random_stir() function. Set NOT_HAVE_ARC4RANDOM_STIR
13 if the version released is past that point. */
14#include <sys/param.h>
15#if OpenBSD >= 201405
16# define NOT_HAVE_ARC4RANDOM_STIR
17#endif
18
19typedef struct flock flock_t;
20
21#define os_strsignal strsignal
22#define OS_STRSIGNAL
23
24typedef struct __res_state *res_state;
25
26/* default is non-const */
27#define ICONV_ARG2_TYPE const char **
28
29#ifndef EPROTO
30# define EPROTO 71
31#endif
32
33/* We need to force this; the automatic in buildconfig.c gets %ld */
34#ifdef OFF_T_FMT
35# undef OFF_T_FMT
36# undef LONGLONG_T
37#endif
38#define OFF_T_FMT "%lld"
39#define LONGLONG_T long long int
40
41#ifdef PID_T_FMT
42# undef PID_T_FMT
43#endif
44#define PID_T_FMT "%d"
45
46#ifdef INO_T_FMT
47# undef INO_T_FMT
48#endif
49#define INO_T_FMT "%llu"
50
51#ifdef TIME_T_FMT
52# undef TIME_T_FMT
53#endif
54#define TIME_T_FMT "%lld"
55
56/* End */
diff --git a/OS/os.h-SunOS5 b/OS/os.h-SunOS5
0new file mode 10064457new file mode 100644
index 0000000..dfbd8f1
--- /dev/null
+++ b/OS/os.h-SunOS5
@@ -0,0 +1,51 @@
1/* Exim: OS-specific C header file for SunOS5 aka Solaris */
2
3#define CRYPT_H
4#define HAVE_MMAP
5#define HAVE_SYS_STATVFS_H
6#define F_FAVAIL f_favail
7#define SIOCGIFCONF_GIVES_ADDR
8
9#define HAVE_GETIPNODEBYNAME 1
10#define HAVE_GETIPNODEBYADDR 1
11
12#define HAVE_KSTAT
13#define LOAD_AVG_KSTAT "system_misc"
14#define LOAD_AVG_KSTAT_MODULE "unix"
15#define LOAD_AVG_SYMBOL "avenrun_1min"
16#define LOAD_AVG_FIELD value.ui32
17
18#define os_strsignal strsignal
19#define OS_STRSIGNAL
20
21/* This is needed for some early Solaris releases, but causes trouble
22in the current ones, so it is out by default. */
23
24/* #define EXIM_SOCKLEN_T size_t */
25
26/* This is different from Linux and all other PAM implementations,
27it seems. */
28
29#define PAM_CONVERSE_ARG2_TYPE struct pam_message
30
31
32/* default is non-const */
33#define ICONV_ARG2_TYPE const char **
34
35#if _POSIX_C_SOURCE < 200112L
36# define MISSING_UNSETENV_3
37#endif
38
39
40/* SunOS5 doesn't accept getcwd(NULL, 0) to auto-allocate
41a buffer */
42
43#define OS_GETCWD
44
45
46#ifndef MIN
47# define MIN(a,b) (((a)<(b))?(a):(b))
48# define MAX(a,b) (((a)>(b))?(a):(b))
49#endif
50
51/* End */
diff --git a/OS/unsupported/Makefile-AIX b/OS/unsupported/Makefile-AIX
0new file mode 10064452new file mode 100644
index 0000000..fc32aa2
--- /dev/null
+++ b/OS/unsupported/Makefile-AIX
@@ -0,0 +1,28 @@
1# Exim: OS-specific make file for AIX
2# Written by Nick Waterman (nick@cimio.co.uk)
3# Modified by PH following a message from Mike Meredith
4
5# Note that the output of uname -m is probably not what Philip expected,
6# so you might end up with more build-AIX-random_number directories than
7# you expected if you have too many AIX boxes, but it seems to work... I
8# blame IBM.
9
10# Note that nowadays you have to pay extra for a cc compiler with AIX!
11
12CC=gcc
13
14# This needs to be in here rather than os.h-AIX because of regexp stuff.
15# basically strchr is a #define, which means "extern char *strchr()"
16# ruins things. __STR31__ seems to get around this by magic. The AIX
17# include files are quite a confusing maze.
18# Mike M says this is not necessary any more; possibly this is related to
19# using gcc. Commented out by PH.
20#CFLAGS = -D__STR31__
21
22CFLAGS = -mcpu=power4 -maix64 -O3
23
24# Needed for vfork() and vfork() only?
25
26LIBS = -lbsd -lm
27
28# End
diff --git a/OS/unsupported/Makefile-BSDI b/OS/unsupported/Makefile-BSDI
0new file mode 10064429new file mode 100644
index 0000000..d56aa9b
--- /dev/null
+++ b/OS/unsupported/Makefile-BSDI
@@ -0,0 +1,21 @@
1# Exim: OS-specific make file for BSDI aka BSD/OS. Its antique link editor
2# cannot handle the TextPop overriding.
3
4CFLAGS=-O
5CHOWN_COMMAND=/usr/sbin/chown
6
7HAVE_SA_LEN=YES
8
9X11=/usr/X11
10XINCLUDE=-I$(X11)/include
11XLFLAGS=-L$(X11)/lib
12X11_LD_LIB=$(X11)/lib
13
14LIBS_EXIMON=-lSM -lICE -lipc -lm
15EXIMON_TEXTPOP=
16
17EXIWHAT_PS_ARG=-ax
18EXIWHAT_EGREP_ARG='/exim( |$$)'
19EXIWHAT_KILL_SIGNAL=-USR1
20
21# End
diff --git a/OS/unsupported/Makefile-CYGWIN b/OS/unsupported/Makefile-CYGWIN
0new file mode 10064422new file mode 100644
index 0000000..006e9fe
--- /dev/null
+++ b/OS/unsupported/Makefile-CYGWIN
@@ -0,0 +1,113 @@
1# OS-specific file for Cygwin.
2
3# This file provided by Pierre A. Humblet <Pierre.Humblet@ieee.org>
4
5HAVE_IPV6 = yes
6HAVE_ICONV = yes
7# Use c99 to have %z
8CFLAGS= -g -Wall -std=c99 -U __STRICT_ANSI__
9LIBS= -lcrypt -lresolv
10LIBS_EXIM= -liconv
11EXIWHAT_PS_ARG=-as
12EXIWHAT_KILL_SIGNAL=-USR1
13EXIWHAT_EGREP_ARG='/(EXIM|exim)[0-9. -]*$$'
14
15DBMLIB=-lgdbm
16USE_GDBM=YES
17
18# Some OS add a suffix to executables
19EXE = .exe
20
21# To add a resource file with an icon
22LIBS_EXIM +=../Local/exim_res.o
23
24# To produce a linker map
25#LIBS_EXIM+=-Wl,-Map,Exim.Map
26
27
28##################################################
29# The following is normally set in local/Makefile.
30# Makefile.cygwin provides defaults with which the
31# precompiled version is built
32##################################################
33
34BIN_DIRECTORY=/usr/bin
35CONFIGURE_FILE=/etc/exim.conf
36EXIM_USER=18 # This changes if user exim exists
37EXIM_GROUP=544 # Administrators
38SPOOL_DIRECTORY=/var/spool/exim
39LOG_FILE_PATH=/var/log/exim/exim_%s.log
40TIMEZONE_DEFAULT = ""
41
42AUTH_CRAM_MD5=yes
43AUTH_PLAINTEXT=yes
44AUTH_SPA=yes
45
46SUPPORT_TLS=yes
47TLS_LIBS=-lssl -lcrypto
48
49ROUTER_ACCEPT=yes
50ROUTER_DNSLOOKUP=yes
51ROUTER_IPLITERAL=yes
52ROUTER_MANUALROUTE=yes
53ROUTER_QUERYPROGRAM=yes
54ROUTER_REDIRECT=yes
55
56TRANSPORT_APPENDFILE=yes
57TRANSPORT_AUTOREPLY=yes
58TRANSPORT_PIPE=yes
59TRANSPORT_SMTP=yes
60
61SUPPORT_MAILDIR=yes
62SUPPORT_MAILSTORE=yes
63SUPPORT_MBX=yes
64
65LOOKUP_DBM=yes
66LOOKUP_LSEARCH=yes
67
68# LOOKUP_CDB=yes
69LOOKUP_DNSDB=yes
70LOOKUP_DSEARCH=yes
71LOOKUP_LDAP=yes
72# LOOKUP_MYSQL=yes
73# LOOKUP_NIS=yes
74# LOOKUP_NISPLUS=yes
75# LOOKUP_ORACLE=yes
76LOOKUP_PASSWD=yes
77# LOOKUP_PGSQL=yes
78# LOOKUP_WHOSON=yes
79
80LDAP_LIB_TYPE=OPENLDAP2
81LOOKUP_LIBS=-lldap -llber
82
83WITH_CONTENT_SCAN=yes
84
85# It is important to define these variables but the values are always overridden
86CONFIGURE_OWNER=18
87CONFIGURE_GROUP=544
88
89EXICYCLOG_MAX=10
90
91COMPRESS_COMMAND=/usr/bin/gzip
92COMPRESS_SUFFIX=gz
93ZCAT_COMMAND=/usr/bin/zcat
94
95# EXIM_PERL=perl.o
96
97# Comment the two lines below if you do not have PAM, e.g. from
98# ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/porters/Humblet_Pierre_A
99SUPPORT_PAM=yes
100CFLAGS += -DINCLUDE_PAM -I ../pam -I ../../pam
101
102# All modes are in octal and must start with 0
103EXIMDB_DIRECTORY_MODE = 01777
104EXIMDB_MODE = 0666
105EXIMDB_LOCKFILE_MODE = 0666
106INPUT_DIRECTORY_MODE = 01777
107LOG_DIRECTORY_MODE = 01777
108LOG_MODE = 0666
109MSGLOG_DIRECTORY_MODE = 01777
110SPOOL_DIRECTORY_MODE = 01777
111SPOOL_MODE = 0600
112
113# End
diff --git a/OS/unsupported/Makefile-DGUX b/OS/unsupported/Makefile-DGUX
0new file mode 100644114new file mode 100644
index 0000000..667c63f
--- /dev/null
+++ b/OS/unsupported/Makefile-DGUX
@@ -0,0 +1,32 @@
1# Exim: OS-specific make file for DGUX
2#
3# Written by Ken Bailey (K.Bailey@rbgkew.org.uk) Feb 1998
4# on dgux R4.11MU04 generic AViiON mc88100
5# with no X
6
7# Minor tidies to remove settings that are actually the default,
8# in line with the style of other system files - PH.
9
10BASENAME_COMMAND=/bin/basename
11CHOWN_COMMAND=/bin/chown
12CHGRP_COMMAND=/bin/chgrp
13CHMOD_COMMAND=/bin/chmod
14
15# PERL
16# Perl is not necessary for running Exim itself, but some Perl utilities
17# are provided for processing the logs. Perl 5 is assumed.
18# DG ship perl version 4.036 in /bin/perl so need to use locally installed perl
19
20PERL_COMMAND=/usr/local/bin/perl
21
22# dg's version of gcc likes O2
23
24CFLAGS=-O2
25
26RANLIB=@true
27LIBS=-lsocket -lnsl -lm
28LIBRESOLV=-lresolv
29DBMLIB=-ldbm
30
31# End
32
diff --git a/OS/unsupported/Makefile-Darwin b/OS/unsupported/Makefile-Darwin
0new file mode 10064433new file mode 100644
index 0000000..be0d952
--- /dev/null
+++ b/OS/unsupported/Makefile-Darwin
@@ -0,0 +1,29 @@
1# Exim: OS-specific make file for Darwin (Mac OS X).
2
3CC=cc
4
5BASENAME_COMMAND=look_for_it
6CHOWN_COMMAND=/usr/sbin/chown
7CHMOD_COMMAND=/bin/chmod
8
9HAVE_SA_LEN=YES
10
11# Removed -DBIND_8_COMPAT for 4.61
12# CFLAGS=-O -no-cpp-precomp -DBIND_8_COMPAT
13
14CFLAGS=-O -no-cpp-precomp
15LIBRESOLV=-lresolv
16
17USE_DB = yes
18DBMLIB =
19
20X11=/usr/X11R6
21XINCLUDE=-I$(X11)/include
22XLFLAGS=-L$(X11)/lib
23X11_LD_LIB=$(X11)/lib
24
25EXIWHAT_PS_ARG=ax
26EXIWHAT_EGREP_ARG='/exim( |$$)'
27EXIWHAT_KILL_SIGNAL=-USR1
28
29# End
diff --git a/OS/unsupported/Makefile-DragonFly b/OS/unsupported/Makefile-DragonFly
0new file mode 10064430new file mode 100644
index 0000000..c49c59f
--- /dev/null
+++ b/OS/unsupported/Makefile-DragonFly
@@ -0,0 +1,31 @@
1# Exim: OS-specific make file for DragonFly
2# There's no setting of CFLAGS here, to allow the system default
3# for "make" to be the default.
4
5CHOWN_COMMAND=/usr/sbin/chown
6CHMOD_COMMAND=/bin/chmod
7
8HAVE_SA_LEN=YES
9
10# crypt() is in a separate library
11LIBS=-lcrypt -lm
12
13# DragonFly always ships with Berkeley DB
14USE_DB=yes
15
16# X11 may be under /usr/pkg/xorg/ for example.
17# X11=/usr/X11R6
18X11=$(X11BASE)
19
20XINCLUDE=-I$(X11)/include
21XLFLAGS=-L$(X11)/lib
22XLFLAGS+=-Wl,-rpath,${X11BASE}/lib
23X11_LD_LIB=$(X11)/lib
24
25EXIWHAT_PS_ARG=-ax
26EXIWHAT_EGREP_ARG='/exim( |$$)'
27EXIWHAT_MULTIKILL_CMD='killall -m'
28EXIWHAT_MULTIKILL_ARG='^exim($$|-[0-9.]+-[0-9]+$$)'
29EXIWHAT_KILL_SIGNAL=-USR1
30
31# End
diff --git a/OS/unsupported/Makefile-GNU b/OS/unsupported/Makefile-GNU
0new file mode 10064432new file mode 100644
index 0000000..e464341
--- /dev/null
+++ b/OS/unsupported/Makefile-GNU
@@ -0,0 +1,29 @@
1# Exim: OS-specific make file for GNU and variants.
2
3HAVE_ICONV=yes
4
5BASENAME_COMMAND=look_for_it
6CHOWN_COMMAND=look_for_it
7CHGRP_COMMAND=look_for_it
8CHMOD_COMMAND=look_for_it
9
10CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
11
12DBMLIB = -ldb
13USE_DB = yes
14
15LIBS = -lnsl -lcrypt -lm
16LIBRESOLV = -lresolv
17
18X11=/usr/X11R6
19XINCLUDE=-I$(X11)/include
20XLFLAGS=-L$(X11)/lib
21X11_LD_LIB=$(X11)/lib
22
23EXIWHAT_PS_ARG=ax
24EXIWHAT_EGREP_ARG='/exim( |$$)'
25EXIWHAT_MULTIKILL_CMD=killall
26EXIWHAT_MULTIKILL_ARG=exim
27EXIWHAT_KILL_SIGNAL=-USR1
28
29# End
diff --git a/OS/unsupported/Makefile-GNUkFreeBSD b/OS/unsupported/Makefile-GNUkFreeBSD
0new file mode 10064430new file mode 100644
index 0000000..8019281
--- /dev/null
+++ b/OS/unsupported/Makefile-GNUkFreeBSD
@@ -0,0 +1,29 @@
1# Exim: OS-specific make file for GNU and variants.
2
3HAVE_ICONV=yes
4
5BASENAME_COMMAND=look_for_it
6CHOWN_COMMAND=look_for_it
7CHGRP_COMMAND=look_for_it
8CHMOD_COMMAND=look_for_it
9
10CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
11
12DBMLIB = -ldb
13USE_DB = yes
14
15LIBS = -lnsl -lcrypt -lm
16LIBRESOLV = -lresolv
17
18X11=/usr/X11R6
19XINCLUDE=-I$(X11)/include
20XLFLAGS=-L$(X11)/lib
21X11_LD_LIB=$(X11)/lib
22
23EXIWHAT_PS_ARG=ax
24EXIWHAT_EGREP_ARG='/exim( |$$)'
25EXIWHAT_MULTIKILL_CMD=killall
26EXIWHAT_MULTIKILL_ARG=exim4
27EXIWHAT_KILL_SIGNAL=-USR1
28
29# End
diff --git a/OS/unsupported/Makefile-GNUkNetBSD b/OS/unsupported/Makefile-GNUkNetBSD
0new file mode 10064430new file mode 100644
index 0000000..8019281
--- /dev/null
+++ b/OS/unsupported/Makefile-GNUkNetBSD
@@ -0,0 +1,29 @@
1# Exim: OS-specific make file for GNU and variants.
2
3HAVE_ICONV=yes
4
5BASENAME_COMMAND=look_for_it
6CHOWN_COMMAND=look_for_it
7CHGRP_COMMAND=look_for_it
8CHMOD_COMMAND=look_for_it
9
10CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
11
12DBMLIB = -ldb
13USE_DB = yes
14
15LIBS = -lnsl -lcrypt -lm
16LIBRESOLV = -lresolv
17
18X11=/usr/X11R6
19XINCLUDE=-I$(X11)/include
20XLFLAGS=-L$(X11)/lib
21X11_LD_LIB=$(X11)/lib
22
23EXIWHAT_PS_ARG=ax
24EXIWHAT_EGREP_ARG='/exim( |$$)'
25EXIWHAT_MULTIKILL_CMD=killall
26EXIWHAT_MULTIKILL_ARG=exim4
27EXIWHAT_KILL_SIGNAL=-USR1
28
29# End
diff --git a/OS/unsupported/Makefile-HI-OSF b/OS/unsupported/Makefile-HI-OSF
0new file mode 10064430new file mode 100644
index 0000000..da3d487
--- /dev/null
+++ b/OS/unsupported/Makefile-HI-OSF
@@ -0,0 +1,8 @@
1# Exim: OS-specific make file for HI-OSF/1-MJ and HI-UX/MPP
2
3CC=cc
4CFLAGS=-O
5RANLIB=@true
6EXIWHAT_EGREP_ARG='/exim( |$$)'
7
8# End
diff --git a/OS/unsupported/Makefile-HI-UX b/OS/unsupported/Makefile-HI-UX
0new file mode 1006449new file mode 100644
index 0000000..870ee84
--- /dev/null
+++ b/OS/unsupported/Makefile-HI-UX
@@ -0,0 +1,12 @@
1# Exim: OS-specific make file for HI-UX
2
3CC=cc -Aa -D_HIUX_SOURCE
4HAVE_SETRESUID=YES
5HAVE_SETEUID=NO
6XINCLUDE=-I/usr/include/X11R5
7XLFLAGS=-L/usr/lib/X11R5
8DBMLIB = -lndbm
9NEED_H_ERRNO=1
10RANLIB=@true
11
12# End
diff --git a/OS/unsupported/Makefile-HP-UX b/OS/unsupported/Makefile-HP-UX
0new file mode 10064413new file mode 100644
index 0000000..ea35144
--- /dev/null
+++ b/OS/unsupported/Makefile-HP-UX
@@ -0,0 +1,27 @@
1# Exim: OS-specific make file for HP-UX later than 9
2
3# HP ANSI C compiler
4#CC=cc
5#CFLAGS=+O2 +Onolimit -z -D_XOPEN_SOURCE_EXTENDED
6# Users of the A.06.00 compiler might need to use +O1 rather than +O2 as
7# there have been some problems reported with this compiler with +O2 set.
8
9# gcc
10CFLAGS=-O -D_XOPEN_SOURCE_EXTENDED
11LDFLAGS=-Wl,-z
12LIBS=-lm
13
14BASENAME_COMMAND=/bin/basename
15HAVE_ICONV=yes
16HAVE_SETRESUID=YES
17HAVE_SETEUID=NO
18XINCLUDE=-I/usr/include/X11R6 -I/usr/contrib/X11R6/include
19XLFLAGS=-L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib
20X11_LD_LIB=/usr/contrib/X11R6/lib
21EXIMON_TEXTPOP=
22DBMLIB=-lndbm
23RANLIB=@true
24
25OS_C_INCLUDES=setenv.c
26
27# End
diff --git a/OS/unsupported/Makefile-HP-UX-9 b/OS/unsupported/Makefile-HP-UX-9
0new file mode 10064428new file mode 100644
index 0000000..1530009
--- /dev/null
+++ b/OS/unsupported/Makefile-HP-UX-9
@@ -0,0 +1,15 @@
1# Exim: OS-specific make file for HP-UX 9
2
3CFLAGS=-O
4BASENAME_COMMAND=/bin/basename
5HAVE_ICONV=yes
6HAVE_SETRESUID=YES
7HAVE_SETEUID=NO
8XINCLUDE=-I/usr/include/X11R5
9XLFLAGS=-L/usr/lib/X11R5 -L/usr/contrib/X11R5/lib
10X11_LD_LIB=/usr/contrib/X11R5/lib
11EXIMON_TEXTPOP=
12DBMLIB=-lndbm
13RANLIB=@true
14
15# End
diff --git a/OS/unsupported/Makefile-IRIX b/OS/unsupported/Makefile-IRIX
0new file mode 10064416new file mode 100644
index 0000000..7b95783
--- /dev/null
+++ b/OS/unsupported/Makefile-IRIX
@@ -0,0 +1,12 @@
1# Exim: OS-specific make file for IRIX
2
3HAVE_ICONV=yes
4BASENAME_COMMAND=/sbin/basename
5HOSTNAME_COMMAND=/usr/bsd/hostname
6CFLAGS=-OPT:Olimit=1500
7LIBS=-lmld -lm
8XINCLUDE=-I/usr/include/X11
9vfork=fork
10RANLIB=@true
11
12# End
diff --git a/OS/unsupported/Makefile-IRIX6 b/OS/unsupported/Makefile-IRIX6
0new file mode 10064413new file mode 100644
index 0000000..be01138
--- /dev/null
+++ b/OS/unsupported/Makefile-IRIX6
@@ -0,0 +1,13 @@
1# Exim: OS-specific make file for IRIX6 on 64-bit systems
2
3HAVE_ICONV=yes
4HOSTNAME_COMMAND=/usr/bsd/hostname
5CFLAGS=-O2 -n32 -OPT:Olimit=4000
6LFLAGS=-n32
7LIBS=-lelf -lm
8XINCLUDE=-I/usr/include/X11
9XLFLAGS=
10vfork=fork
11RANLIB=@true
12
13# End
diff --git a/OS/unsupported/Makefile-IRIX632 b/OS/unsupported/Makefile-IRIX632
0new file mode 10064414new file mode 100644
index 0000000..b567fc6
--- /dev/null
+++ b/OS/unsupported/Makefile-IRIX632
@@ -0,0 +1,16 @@
1# Exim: OS-specific make file for IRIX 6 on 32-bit systems.
2# There seems to be some variation. The commented settings show
3# some alternatives.
4
5HAVE_ICONV=yes
6HOSTNAME_COMMAND=/usr/bsd/hostname
7#CFLAGS=-OPT:Olimit=1500 -32 -mips2
8CFLAGS=-32
9LFLAGS=-32
10#LIBS=-lmld
11LIBS=-lelf -lm
12XINCLUDE=-I/usr/include/X11
13vfork=fork
14RANLIB=@true
15
16# End
diff --git a/OS/unsupported/Makefile-IRIX65 b/OS/unsupported/Makefile-IRIX65
0new file mode 10064417new file mode 100644
index 0000000..50e7745
--- /dev/null
+++ b/OS/unsupported/Makefile-IRIX65
@@ -0,0 +1,16 @@
1# Exim: OS-specific make file for IRIX 6.5
2
3HAVE_ICONV=yes
4HOSTNAME_COMMAND=/usr/bsd/hostname
5CC=cc
6CFLAGS=-O2 -OPT:Olimit=0
7# CFLAGS=-O2 # override with this (in your Local/Makefile) if using gcc
8LFLAGS=-Wl,-LD_MSG:off=85
9LFLAGS=
10# nlist has moved from libmld to libelf
11LIBS=-lelf -lm
12XINCLUDE=-I/usr/include/X11
13vfork=fork
14RANLIB=@true
15
16# End
diff --git a/OS/unsupported/Makefile-NetBSD b/OS/unsupported/Makefile-NetBSD
0new file mode 10064417new file mode 100644
index 0000000..35d03a2
--- /dev/null
+++ b/OS/unsupported/Makefile-NetBSD
@@ -0,0 +1,27 @@
1# Exim: OS-specific make file for NetBSD (ELF object format)
2
3CHOWN_COMMAND=/usr/sbin/chown
4CHMOD_COMMAND=/bin/chmod
5
6CFLAGS ?= -O2
7
8HAVE_SA_LEN=YES
9HAVE_IPV6=YES
10LIBS=-lcrypt -lm
11
12X11=/usr/X11R6
13XINCLUDE=-I$(X11)/include
14XLFLAGS=-L$(X11)/lib
15X11_LD_LIB=$(X11)/lib
16
17EXIWHAT_PS_ARG=-ax
18EXIWHAT_EGREP_ARG='/exim( |$$)'
19EXIWHAT_KILL_SIGNAL=-USR1
20
21# NetBSD always ships with Berkeley DB
22USE_DB=yes
23
24# NetBSD ELF linker needs a -R flag.
25XLFLAGS+=-Wl,-R$(X11)/lib/
26
27# End
diff --git a/OS/unsupported/Makefile-NetBSD-a.out b/OS/unsupported/Makefile-NetBSD-a.out
0new file mode 10064428new file mode 100644
index 0000000..e210efd
--- /dev/null
+++ b/OS/unsupported/Makefile-NetBSD-a.out
@@ -0,0 +1,24 @@
1# Exim: OS-specific make file for NetBSD (a.out/COFF object format)
2
3CHOWN_COMMAND=/usr/sbin/chown
4CHMOD_COMMAND=/bin/chmod
5
6CFLAGS ?= -O2
7
8HAVE_SA_LEN=YES
9HAVE_IPV6=YES
10LIBS=-lcrypt -lm
11
12X11=/usr/X11R6
13XINCLUDE=-I$(X11)/include
14XLFLAGS=-L$(X11)/lib
15X11_LD_LIB=$(X11)/lib
16
17EXIWHAT_PS_ARG=-ax
18EXIWHAT_EGREP_ARG='/exim( |$$)'
19EXIWHAT_KILL_SIGNAL=-USR1
20
21# NetBSD always ships with Berkeley DB
22USE_DB=yes
23
24# End
diff --git a/OS/unsupported/Makefile-OSF1 b/OS/unsupported/Makefile-OSF1
0new file mode 10064425new file mode 100644
index 0000000..811ca07
--- /dev/null
+++ b/OS/unsupported/Makefile-OSF1
@@ -0,0 +1,10 @@
1# Exim: OS-specific make file for OSF1
2
3CFLAGS=-O
4LIBS=-liconv -lm
5HAVE_CRYPT16=yes
6HAVE_ICONV=yes
7HOSTNAME_COMMAND=/usr/bin/hostname
8EXIWHAT_EGREP_ARG='/exim( |$$)'
9
10# End
diff --git a/OS/unsupported/Makefile-OpenUNIX b/OS/unsupported/Makefile-OpenUNIX
0new file mode 10064411new file mode 100644
index 0000000..e4d7261
--- /dev/null
+++ b/OS/unsupported/Makefile-OpenUNIX
@@ -0,0 +1,17 @@
1# Exim: OS-specific make file for OpenUNIX
2
3CC=/usr/bin/cc
4CFLAGS=-O -I/usr/local/include
5LFLAGS=-L/usr/local/lib
6
7LIBS=-lsocket -lnsl -lelf -lgen -lresolv -lm
8EXTRALIBS_EXIMON=-lICE -lSM
9
10RANLIB=@true
11ERRNO_QUOTA=0
12
13X11=/usr/lib/X11
14XINCLUDE=-I/usr/include/X11
15XLFLAGS=-L/usr/lib -L$(X11)/lib
16
17# End
diff --git a/OS/unsupported/Makefile-QNX b/OS/unsupported/Makefile-QNX
0new file mode 10064418new file mode 100644
index 0000000..3cf81c4
--- /dev/null
+++ b/OS/unsupported/Makefile-QNX
@@ -0,0 +1,30 @@
1# Exim: OS-specific makefile for QNX
2
3BASENAME_COMMAND=/bin/basename
4MAKE_SHELL=/usr/bin/bash
5
6CHOWN_COMMAND=/bin/chown
7CHGRP_COMMAND=/bin/chgrp
8CHMOD_COMMAND=/bin/chmod
9HOSTNAME_COMMAND=/bin/hostname
10MV_COMMAND=/bin/mv
11PERL_COMMAND=/usr/bin/perl
12RM_COMMAND=/bin/rm
13
14AR=ar -rc
15
16CC=cc
17CFLAGS=-Otax
18LIBIDENTCFLAGS=
19
20RANLIB=@true
21DBMLIB=-ldb
22USE_DB=yes
23LIBS=-lsocket -lm
24
25X11=/usr/X11R6
26XINCLUDE=-I$(X11)/include
27XLFLAGS=-L$(X11)/lib
28X11_LD_LIB=$(X11)/lib
29
30# End
diff --git a/OS/unsupported/Makefile-SCO b/OS/unsupported/Makefile-SCO
0new file mode 10064431new file mode 100644
index 0000000..baa61d8
--- /dev/null
+++ b/OS/unsupported/Makefile-SCO
@@ -0,0 +1,28 @@
1# Exim: OS-specific make file for SCO
2
3# It was reported that some versions of gcc (e.g. 2.8.1) require this to be
4# CFLAGS=-melf
5
6CFLAGS=-b elf
7
8RANLIB=@true
9DBMLIB=-lndbm
10ERRNO_QUOTA=0
11LIBS=-lsocket -lm
12HAVE_ICONV=yes
13
14X11=/usr/lib/X11
15XINCLUDE=-I/usr/include/X11
16XLFLAGS=-L/usr/lib -L$(X11)/lib
17X11_LD_LIB=$(X11)/lib
18
19# Changes from Frank Bernhardt (30/09/04)
20
21BASENAME_COMMAND=/bin/basename
22CHOWN_COMMAND=/bin/chown
23CHGRP_COMMAND=/bin/chgrp
24CHMOD_COMMAND=/bin/chmod
25HOSTNAME_COMMAND=/usr/bin/hostname
26TOUCH_COMMAND=/bin/touch
27
28# End
diff --git a/OS/unsupported/Makefile-SCO_SV b/OS/unsupported/Makefile-SCO_SV
0new file mode 10064429new file mode 100644
index 0000000..249b81a
--- /dev/null
+++ b/OS/unsupported/Makefile-SCO_SV
@@ -0,0 +1,34 @@
1# Exim: OS-specific make file for SCO_SV release 5 (tested on 5.0.5 & 5.0.5)
2# (see the UNIX_SV files for SCO 4.2)
3# Supplied by: Tony Earnshaw <tonye@ilion.nl>
4
5# Note that 'gcc -melf -m486' applies to gcc 2.7.2 and higher;
6# 2.7.1 and SCO's SDK need '-belf'.
7
8# Removed -lwrap (PH 27/7/00) because not all systems have it
9
10CFLAGS=-melf -O3 -m486
11LFLAGS=-L/lib -L/usr/lib -L/usr/local/lib
12LIBS=-ltinfo -lsocket -lm
13
14HAVE_ICONV=yes
15
16RANLIB=@true
17DBMLIB=-lndbm
18ERRNO_QUOTA=0
19
20X11=/usr/lib/X11
21XINCLUDE=-I/usr/include/X11
22XLFLAGS=-L/usr/lib -L$(X11)/lib
23X11_LD_LIB=$(X11)/lib
24
25# Changes from Frank Bernhardt (30/9/04)
26
27BASENAME_COMMAND=/bin/basename
28CHOWN_COMMAND=/bin/chown
29CHGRP_COMMAND=/bin/chgrp
30CHMOD_COMMAND=/bin/chmod
31HOSTNAME_COMMAND=/usr/bin/hostname
32TOUCH_COMMAND=/bin/touch
33
34# End
diff --git a/OS/unsupported/Makefile-SunOS4 b/OS/unsupported/Makefile-SunOS4
0new file mode 10064435new file mode 100644
index 0000000..c876998
--- /dev/null
+++ b/OS/unsupported/Makefile-SunOS4
@@ -0,0 +1,16 @@
1# Exim: OS-specific make file for SunOS4
2
3CFLAGS=-O
4
5CHOWN_COMMAND=/usr/etc/chown
6HOSTNAME_COMMAND=/usr/bin/hostname
7EXIT_FAILURE=1
8EXIT_SUCCESS=0
9LIBRESOLV=-lresolv
10XINCLUDE=-I/usr/include/X11
11
12EXIWHAT_PS_ARG=-ax
13EXIWHAT_EGREP_ARG='/exim( |$$)'
14EXIWHAT_KILL_SIGNAL=-30
15
16# End
diff --git a/OS/unsupported/Makefile-SunOS5-hal b/OS/unsupported/Makefile-SunOS5-hal
0new file mode 10064417new file mode 100644
index 0000000..05ea893
--- /dev/null
+++ b/OS/unsupported/Makefile-SunOS5-hal
@@ -0,0 +1,18 @@
1# Exim: OS-specific make file for SunOS5 on a HAL
2
3# Note: The HAL runs a standard SunOS5 except that it has a 64 bit C
4# compiler called hcc. To make things work pass the -KV7 flag to force
5# 32bit compilation - this is necessary to interwork with some libraries.
6
7CC=hcc
8CFLAGS=-O -KV7
9LIBIDENTCFLAGS="-KV7 -O -DHAVE_ANSIHEADERS"
10LIBIDENTNAME=sunos5
11RANLIB=@true
12LIBS=-lsocket -lnsl -lkstat -lm
13LIBRESOLV=-lresolv
14X11=/usr/X11R6
15XINCLUDE=-I$(X11)/include
16XLFLAGS=-L$(X11)/lib -R$(X11)/lib
17
18# End
diff --git a/OS/unsupported/Makefile-ULTRIX b/OS/unsupported/Makefile-ULTRIX
0new file mode 10064419new file mode 100644
index 0000000..9e912b3
--- /dev/null
+++ b/OS/unsupported/Makefile-ULTRIX
@@ -0,0 +1,18 @@
1# Exim: OS-specific make file for Ultrix
2
3MAKE_SHELL=/usr/bin/sh5
4
5CFLAGS=-O
6
7# This can either be /usr/include/X11 or /usr/include/mit depending on
8# the particular version of ULTRIX.
9
10XINCLUDE=-I/usr/include/X11 -I/usr/include/mit
11
12DBMLIB=-lgdbm
13
14EXIWHAT_PS_ARG=-ax
15EXIWHAT_EGREP_ARG='/exim( |$$)'
16EXIWHAT_KILL_SIGNAL=-USR1
17
18# End
diff --git a/OS/unsupported/Makefile-UNIX_SV b/OS/unsupported/Makefile-UNIX_SV
0new file mode 10064419new file mode 100644
index 0000000..bfcfae1
--- /dev/null
+++ b/OS/unsupported/Makefile-UNIX_SV
@@ -0,0 +1,24 @@
1# Exim: OS-specific make file for SCO SVR4.2MP (and maybe Unixware)
2#
3# *** Note that for SCO 5 the configuration file is called SCO_SV,
4# *** and that Unixware7 has its own configuration. This is an old
5# *** file that is retained for compatibility.
6#
7# Note that SCO does not include dbm/ndbm with their standard compiler
8# (it is available with /usr/ucb/cc, but that has bugs of its own). You
9# should install gcc and gdbm, then execute 'make install-compat' in the
10# gdbm source directory.
11
12CC=gcc -I/usr/local/include
13CFLAGS=-O
14
15RANLIB=@true
16DBMLIB=-lgdbm -L/usr/local/lib
17ERRNO_QUOTA=0
18LIBS=-lsocket -lelf -lgen -lnsl -lresolv -lm
19
20X11=/usr/lib/X11
21XINCLUDE=-I/usr/include/X11
22XLFLAGS=-L/usr/lib -L$(X11)/lib
23
24# End
diff --git a/OS/unsupported/Makefile-USG b/OS/unsupported/Makefile-USG
0new file mode 10064425new file mode 100644
index 0000000..753a2d7
--- /dev/null
+++ b/OS/unsupported/Makefile-USG
@@ -0,0 +1,33 @@
1# Exim: OS-specific make file for Unixware 2.x
2#
3# Note that Unixware does not include db/dbm/ndbm with their standard compiler
4# (it is available with /usr/ucb/cc, but that has bugs of its own). You
5# should install gcc and Berkeley DB (or another dbm library if you really
6# insist). If you use a different dbm library you will need to override
7# DBMLIB below.
8#
9# DB 1.85 and 2.x can be found at http://www.sleepycat.com/.
10# They have different characteristics. See the discussion of dbm libraries
11# in doc/dbm.discuss.txt in the Exim distribution.
12#
13# DB needs to be compiled with gcc and you need a 'cc' in your path
14# before the Unixware CC to compile it.
15#
16# Don't bother even starting to install exim on Unixware unless
17# you have installed gcc and use it for everything.
18
19CC=gcc -I/usr/local/include
20CFLAGS=-O
21
22RANLIB=@true
23DBMLIB=-ldb -L/usr/local/lib
24USE_DB=YES
25ERRNO_QUOTA=0
26LIBS=-lsocket -lelf -lgen -lnsl -lresolv -lm
27
28X11=/usr/lib/X11
29XINCLUDE=-I/usr/include/X11
30XLFLAGS=-L/usr/lib -L$(X11)/lib
31X11_LD_LIB=$(X11)/lib
32
33# End
diff --git a/OS/unsupported/Makefile-Unixware7 b/OS/unsupported/Makefile-Unixware7
0new file mode 10064434new file mode 100644
index 0000000..88a8838
--- /dev/null
+++ b/OS/unsupported/Makefile-Unixware7
@@ -0,0 +1,32 @@
1# Exim: OS-specific make file for Unixware7
2# Based on information from James FitzGibbon <james@ehlo.com>
3
4# If you want to use libbind, you need to
5# add -I/usr/local/bind/include to CFLAGS
6# add -L/usr/local/bind/lib to LFLAGS
7# remove -lresolv from LIBS
8# add LOOKUP_LIBS=-lbind
9# The new settings should go in your Local/Makefile rather than here; then
10# they will be usable for subsequent Exim releases.
11
12CC=/usr/bin/cc
13CFLAGS=-O -I/usr/local/include
14LFLAGS=-L/usr/local/lib
15
16HAVE_ICONV=yes
17
18LIBS=-lsocket -lnsl -lelf -lgen -lresolv -lm
19
20# Removed on the advice of Larry Rosenman
21# EXTRALIBS=-lwrap
22
23EXTRALIBS_EXIMON=-lICE -lSM
24
25RANLIB=@true
26ERRNO_QUOTA=0
27
28X11=/usr/lib/X11
29XINCLUDE=-I/usr/include/X11
30XLFLAGS=-L/usr/lib -L$(X11)/lib
31
32# End
diff --git a/OS/unsupported/Makefile-mips b/OS/unsupported/Makefile-mips
0new file mode 10064433new file mode 100644
index 0000000..ff33139
--- /dev/null
+++ b/OS/unsupported/Makefile-mips
@@ -0,0 +1,16 @@
1# Exim: OS-specific make file for RiscOS4bsd
2
3HOSTNAME_COMMAND=/usr/ucb/hostname
4EXIT_FAILURE=1
5EXIT_SUCCESS=0
6LIBRESOLV=-lresolv
7LIBS=-liberty -lm
8XINCLUDE=-I/usr/X11R6/include
9
10CFLAGS=-O
11
12EXIWHAT_PS_ARG=-ax
13EXIWHAT_EGREP_ARG='/exim( |$$)'
14EXIWHAT_KILL_SIGNAL=-30
15
16# End
diff --git a/OS/unsupported/README b/OS/unsupported/README
0new file mode 10064417new file mode 100644
index 0000000..73790ae
--- /dev/null
+++ b/OS/unsupported/README
@@ -0,0 +1,14 @@
1Files in this directory are historical. They may have worked once but the
2project has no assurance that they still do.
3
4If you need to use one for a build for your platform, copy it up one directory
5level first. We'll reinstate it given a current version and evidence of testing.
6For the latter please look into the project regression testsuite, and please
7consider operating a buildfarm animal in the long term (it runs the testsuite).
8
9The buildfarm status page is:
10 https://buildfarm.exim.org/cgi-bin/show_status.pl
11There's a "register" link there with a link to how-to instructions. Please do
12monitor the status of your animal on an ongoing basis. The exim-users or
13exim-dev mailinglist are good places to ask for help and to discuss any regressions
14seen in test runs. There is also the #exim IRC channel on Freenode.
diff --git a/OS/unsupported/os.c-BSDI b/OS/unsupported/os.c-BSDI
0new file mode 10064415new file mode 100644
index 0000000..03a7a1c
--- /dev/null
+++ b/OS/unsupported/os.c-BSDI
@@ -0,0 +1,19 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) 2016 Heiko Schlittermann <hs@schlittermann.de> */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* BSDI-specific code. This is concatenated onto the generic
9src/os.c file. */
10
11#ifndef OS_UNSETENV
12#define OS_UNSETENV
13
14int
15os_unsetenv(const uschar * name)
16{
17unsetenv(CS name);
18return 0;
19}
diff --git a/OS/unsupported/os.c-GNU b/OS/unsupported/os.c-GNU
0new file mode 10064420new file mode 100644
index 0000000..e5d6ff6
--- /dev/null
+++ b/OS/unsupported/os.c-GNU
@@ -0,0 +1,55 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* See the file NOTICE for conditions of use and distribution. */
6
7/* GNU-specific code. This is concatenated onto the generic src/os.c file.
8GNU/Hurd has approximately the same way to determine the load average as NeXT,
9so a variant of this could also be in the generic os.c file. See the GNU EMacs
10getloadavg.c file, from which this snippet was derived. getloadavg.c from Emacs
11is copyrighted by the FSF under the terms of the GPLv2 or any later version.
12Changes are hereby placed under the same license, as requested by the GPL. */
13
14#ifndef OS_LOAD_AVERAGE
15#define OS_LOAD_AVERAGE
16
17#include <mach.h>
18
19static processor_set_t default_set;
20static int getloadavg_initialized;
21
22int
23os_getloadavg (void)
24{
25host_t host;
26struct processor_set_basic_info info;
27unsigned info_count;
28
29if (!getloadavg_initialized)
30 {
31 if (processor_set_default (mach_host_self(), &default_set) == KERN_SUCCESS)
32 getloadavg_initialized = 1;
33 }
34
35if (getloadavg_initialized)
36 {
37 info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
38 if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO, &host,
39 (processor_set_info_t)&info, &info_count) != KERN_SUCCESS)
40 getloadavg_initialized = 0;
41 else
42 {
43 #if LOAD_SCALE == 1000
44 return info.load_average;
45 #else
46 return (int) (((double) info.load_average * 1000) / LOAD_SCALE));
47 #endif
48 }
49 }
50
51return -1;
52}
53#endif /* OS_LOAD_AVERAGE */
54
55/* End of os.c-GNU */
diff --git a/OS/unsupported/os.c-HI-OSF b/OS/unsupported/os.c-HI-OSF
0new file mode 10064456new file mode 100644
index 0000000..5e3d336
--- /dev/null
+++ b/OS/unsupported/os.c-HI-OSF
@@ -0,0 +1,35 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2001 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* HI-OSF-specific code. This is concatenated onto the generic
9src/os.c file. OSF has an apparently unique way of getting the
10load average, so we provide a unique function here, and define
11OS_LOAD_AVERAGE to stop src/os.c trying to provide the function. */
12
13#ifndef OS_LOAD_AVERAGE
14#define OS_LOAD_AVERAGE
15
16#include <sys/table.h>
17
18int
19os_getloadavg(void)
20{
21double avg;
22struct tbl_loadavg load_avg;
23
24table (TBL_LOADAVG, 0, &load_avg, 1, sizeof (load_avg));
25
26avg = (load_avg.tl_lscale == 0)?
27 load_avg.tl_avenrun.d[0] :
28 (load_avg.tl_avenrun.l[0] / (double)load_avg.tl_lscale);
29
30return (int)(avg * 1000.0);
31}
32
33#endif /* OS_LOAD_AVERAGE */
34
35/* End of os.c-HI-OSF */
diff --git a/OS/unsupported/os.c-HP-UX b/OS/unsupported/os.c-HP-UX
0new file mode 10064436new file mode 100644
index 0000000..fdd8708
--- /dev/null
+++ b/OS/unsupported/os.c-HP-UX
@@ -0,0 +1,16 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2016 */
6/* Copyright (c) Jeremy Harris 2016 */
7/* See the file NOTICE for conditions of use and distribution. */
8
9/* HP-UX-specific code. This is concatenated onto the generic
10src/os.c file. */
11
12#ifndef COMPILE_UTILITY
13# include "setenv.c"
14#endif
15
16/* End of os.c-SunHP-UX */
diff --git a/OS/unsupported/os.c-IRIX b/OS/unsupported/os.c-IRIX
0new file mode 10064417new file mode 100644
index 0000000..1f6b0e1
--- /dev/null
+++ b/OS/unsupported/os.c-IRIX
@@ -0,0 +1,118 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2001 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* Irix-specific code. This is concatenated onto the generic src/os.c file.
9Irix has a unique way of finding all the network interfaces, so we provide a
10unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
11trying to provide the function. The macro may be set initially anyway, when
12compiling os. for utilities that don't want this function. */
13
14#ifndef FIND_RUNNING_INTERFACES
15#define FIND_RUNNING_INTERFACES
16
17/* This is the special form of the function using sysctl() which is the only
18form that returns all the aliases on IRIX systems. This code has its origins
19in a sample program that came from within SGI. */
20
21#include <sys/sysctl.h>
22#include <net/if_dl.h>
23#include <net/if_types.h>
24#include <net/soioctl.h>
25#include <net/route.h>
26
27#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
28 : sizeof(__uint64_t))
29#ifdef _HAVE_SA_LEN
30#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
31#else
32#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
33#endif
34
35
36ip_address_item *
37os_find_running_interfaces(void)
38{
39ip_address_item *yield = NULL;
40ip_address_item *last = NULL;
41ip_address_item *next;
42
43size_t needed;
44int mib[6];
45char *buf, *nextaddr, *lim;
46register struct if_msghdr *ifm;
47
48mib[0] = CTL_NET;
49mib[1] = PF_ROUTE;
50mib[2] = 0;
51mib[3] = 0;
52mib[4] = NET_RT_IFLIST;
53mib[5] = 0;
54
55/* Get an estimate of the amount of store needed, then get the store and
56get the data into it. Any error causes a panic death. */
57
58if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
59 log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
60 strerror(errno));
61
62buf = store_get(needed);
63
64if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
65 log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
66 strerror(errno));
67
68/* Now fish out the data for each interface */
69
70lim = buf + needed;
71for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
72 {
73 ifm = (struct if_msghdr *)nextaddr;
74
75 if (ifm->ifm_type != RTM_IFINFO)
76 {
77 struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
78 struct sockaddr_in *mask = NULL, *addr = NULL;
79
80 if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
81 mask = (struct sockaddr_in *)(ifam + 1);
82
83 if ((ifam->ifam_addrs & RTA_IFA) != 0)
84 {
85 char *cp = CS mask;
86 struct sockaddr *sa = (struct sockaddr *)mask;
87 ADVANCE(cp, sa);
88 addr = (struct sockaddr_in *)cp;
89 }
90
91 /* Create a data block for the address, fill in the data, and put it on
92 the chain. This data has to survive for ever, so use malloc. */
93
94 if (addr != NULL)
95 {
96 next = store_malloc(sizeof(ip_address_item));
97 next->next = NULL;
98 next->port = 0;
99 (void)host_ntoa(-1, addr, next->address, NULL);
100
101 if (yield == NULL) yield = last = next; else
102 {
103 last->next = next;
104 last = next;
105 }
106
107 DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
108 last->address);
109 }
110 }
111 }
112
113return yield;
114}
115
116#endif /* FIND_RUNNING_INTERFACES */
117
118/* End of os.c-IRIX */
diff --git a/OS/unsupported/os.c-IRIX6 b/OS/unsupported/os.c-IRIX6
0new file mode 100644119new file mode 100644
index 0000000..1f6b0e1
--- /dev/null
+++ b/OS/unsupported/os.c-IRIX6
@@ -0,0 +1,118 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2001 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* Irix-specific code. This is concatenated onto the generic src/os.c file.
9Irix has a unique way of finding all the network interfaces, so we provide a
10unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
11trying to provide the function. The macro may be set initially anyway, when
12compiling os. for utilities that don't want this function. */
13
14#ifndef FIND_RUNNING_INTERFACES
15#define FIND_RUNNING_INTERFACES
16
17/* This is the special form of the function using sysctl() which is the only
18form that returns all the aliases on IRIX systems. This code has its origins
19in a sample program that came from within SGI. */
20
21#include <sys/sysctl.h>
22#include <net/if_dl.h>
23#include <net/if_types.h>
24#include <net/soioctl.h>
25#include <net/route.h>
26
27#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
28 : sizeof(__uint64_t))
29#ifdef _HAVE_SA_LEN
30#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
31#else
32#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
33#endif
34
35
36ip_address_item *
37os_find_running_interfaces(void)
38{
39ip_address_item *yield = NULL;
40ip_address_item *last = NULL;
41ip_address_item *next;
42
43size_t needed;
44int mib[6];
45char *buf, *nextaddr, *lim;
46register struct if_msghdr *ifm;
47
48mib[0] = CTL_NET;
49mib[1] = PF_ROUTE;
50mib[2] = 0;
51mib[3] = 0;
52mib[4] = NET_RT_IFLIST;
53mib[5] = 0;
54
55/* Get an estimate of the amount of store needed, then get the store and
56get the data into it. Any error causes a panic death. */
57
58if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
59 log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
60 strerror(errno));
61
62buf = store_get(needed);
63
64if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
65 log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
66 strerror(errno));
67
68/* Now fish out the data for each interface */
69
70lim = buf + needed;
71for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
72 {
73 ifm = (struct if_msghdr *)nextaddr;
74
75 if (ifm->ifm_type != RTM_IFINFO)
76 {
77 struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
78 struct sockaddr_in *mask = NULL, *addr = NULL;
79
80 if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
81 mask = (struct sockaddr_in *)(ifam + 1);
82
83 if ((ifam->ifam_addrs & RTA_IFA) != 0)
84 {
85 char *cp = CS mask;
86 struct sockaddr *sa = (struct sockaddr *)mask;
87 ADVANCE(cp, sa);
88 addr = (struct sockaddr_in *)cp;
89 }
90
91 /* Create a data block for the address, fill in the data, and put it on
92 the chain. This data has to survive for ever, so use malloc. */
93
94 if (addr != NULL)
95 {
96 next = store_malloc(sizeof(ip_address_item));
97 next->next = NULL;
98 next->port = 0;
99 (void)host_ntoa(-1, addr, next->address, NULL);
100
101 if (yield == NULL) yield = last = next; else
102 {
103 last->next = next;
104 last = next;
105 }
106
107 DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
108 last->address);
109 }
110 }
111 }
112
113return yield;
114}
115
116#endif /* FIND_RUNNING_INTERFACES */
117
118/* End of os.c-IRIX */
diff --git a/OS/unsupported/os.c-IRIX632 b/OS/unsupported/os.c-IRIX632
0new file mode 100644119new file mode 100644
index 0000000..1f6b0e1
--- /dev/null
+++ b/OS/unsupported/os.c-IRIX632
@@ -0,0 +1,118 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2001 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* Irix-specific code. This is concatenated onto the generic src/os.c file.
9Irix has a unique way of finding all the network interfaces, so we provide a
10unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
11trying to provide the function. The macro may be set initially anyway, when
12compiling os. for utilities that don't want this function. */
13
14#ifndef FIND_RUNNING_INTERFACES
15#define FIND_RUNNING_INTERFACES
16
17/* This is the special form of the function using sysctl() which is the only
18form that returns all the aliases on IRIX systems. This code has its origins
19in a sample program that came from within SGI. */
20
21#include <sys/sysctl.h>
22#include <net/if_dl.h>
23#include <net/if_types.h>
24#include <net/soioctl.h>
25#include <net/route.h>
26
27#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
28 : sizeof(__uint64_t))
29#ifdef _HAVE_SA_LEN
30#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
31#else
32#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
33#endif
34
35
36ip_address_item *
37os_find_running_interfaces(void)
38{
39ip_address_item *yield = NULL;
40ip_address_item *last = NULL;
41ip_address_item *next;
42
43size_t needed;
44int mib[6];
45char *buf, *nextaddr, *lim;
46register struct if_msghdr *ifm;
47
48mib[0] = CTL_NET;
49mib[1] = PF_ROUTE;
50mib[2] = 0;
51mib[3] = 0;
52mib[4] = NET_RT_IFLIST;
53mib[5] = 0;
54
55/* Get an estimate of the amount of store needed, then get the store and
56get the data into it. Any error causes a panic death. */
57
58if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
59 log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
60 strerror(errno));
61
62buf = store_get(needed);
63
64if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
65 log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
66 strerror(errno));
67
68/* Now fish out the data for each interface */
69
70lim = buf + needed;
71for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
72 {
73 ifm = (struct if_msghdr *)nextaddr;
74
75 if (ifm->ifm_type != RTM_IFINFO)
76 {
77 struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
78 struct sockaddr_in *mask = NULL, *addr = NULL;
79
80 if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
81 mask = (struct sockaddr_in *)(ifam + 1);
82
83 if ((ifam->ifam_addrs & RTA_IFA) != 0)
84 {
85 char *cp = CS mask;
86 struct sockaddr *sa = (struct sockaddr *)mask;
87 ADVANCE(cp, sa);
88 addr = (struct sockaddr_in *)cp;
89 }
90
91 /* Create a data block for the address, fill in the data, and put it on
92 the chain. This data has to survive for ever, so use malloc. */
93
94 if (addr != NULL)
95 {
96 next = store_malloc(sizeof(ip_address_item));
97 next->next = NULL;
98 next->port = 0;
99 (void)host_ntoa(-1, addr, next->address, NULL);
100
101 if (yield == NULL) yield = last = next; else
102 {
103 last->next = next;
104 last = next;
105 }
106
107 DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
108 last->address);
109 }
110 }
111 }
112
113return yield;
114}
115
116#endif /* FIND_RUNNING_INTERFACES */
117
118/* End of os.c-IRIX */
diff --git a/OS/unsupported/os.c-IRIX65 b/OS/unsupported/os.c-IRIX65
0new file mode 100644119new file mode 100644
index 0000000..1f6b0e1
--- /dev/null
+++ b/OS/unsupported/os.c-IRIX65
@@ -0,0 +1,118 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2001 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* Irix-specific code. This is concatenated onto the generic src/os.c file.
9Irix has a unique way of finding all the network interfaces, so we provide a
10unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
11trying to provide the function. The macro may be set initially anyway, when
12compiling os. for utilities that don't want this function. */
13
14#ifndef FIND_RUNNING_INTERFACES
15#define FIND_RUNNING_INTERFACES
16
17/* This is the special form of the function using sysctl() which is the only
18form that returns all the aliases on IRIX systems. This code has its origins
19in a sample program that came from within SGI. */
20
21#include <sys/sysctl.h>
22#include <net/if_dl.h>
23#include <net/if_types.h>
24#include <net/soioctl.h>
25#include <net/route.h>
26
27#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
28 : sizeof(__uint64_t))
29#ifdef _HAVE_SA_LEN
30#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
31#else
32#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
33#endif
34
35
36ip_address_item *
37os_find_running_interfaces(void)
38{
39ip_address_item *yield = NULL;
40ip_address_item *last = NULL;
41ip_address_item *next;
42
43size_t needed;
44int mib[6];
45char *buf, *nextaddr, *lim;
46register struct if_msghdr *ifm;
47
48mib[0] = CTL_NET;
49mib[1] = PF_ROUTE;
50mib[2] = 0;
51mib[3] = 0;
52mib[4] = NET_RT_IFLIST;
53mib[5] = 0;
54
55/* Get an estimate of the amount of store needed, then get the store and
56get the data into it. Any error causes a panic death. */
57
58if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
59 log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
60 strerror(errno));
61
62buf = store_get(needed);
63
64if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
65 log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
66 strerror(errno));
67
68/* Now fish out the data for each interface */
69
70lim = buf + needed;
71for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
72 {
73 ifm = (struct if_msghdr *)nextaddr;
74
75 if (ifm->ifm_type != RTM_IFINFO)
76 {
77 struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
78 struct sockaddr_in *mask = NULL, *addr = NULL;
79
80 if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
81 mask = (struct sockaddr_in *)(ifam + 1);
82
83 if ((ifam->ifam_addrs & RTA_IFA) != 0)
84 {
85 char *cp = CS mask;
86 struct sockaddr *sa = (struct sockaddr *)mask;
87 ADVANCE(cp, sa);
88 addr = (struct sockaddr_in *)cp;
89 }
90
91 /* Create a data block for the address, fill in the data, and put it on
92 the chain. This data has to survive for ever, so use malloc. */
93
94 if (addr != NULL)
95 {
96 next = store_malloc(sizeof(ip_address_item));
97 next->next = NULL;
98 next->port = 0;
99 (void)host_ntoa(-1, addr, next->address, NULL);
100
101 if (yield == NULL) yield = last = next; else
102 {
103 last->next = next;
104 last = next;
105 }
106
107 DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
108 last->address);
109 }
110 }
111 }
112
113return yield;
114}
115
116#endif /* FIND_RUNNING_INTERFACES */
117
118/* End of os.c-IRIX */
diff --git a/OS/unsupported/os.c-OSF1 b/OS/unsupported/os.c-OSF1
0new file mode 100644119new file mode 100644
index 0000000..ad91b63
--- /dev/null
+++ b/OS/unsupported/os.c-OSF1
@@ -0,0 +1,36 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Copyright (c) University of Cambridge 2001 */
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* OSF1-specific code. This is concatenated onto the generic src/os.c file.
9OSF1 has an apparently unique way of getting the load average, so we provide a
10unique function here, and define OS_LOAD_AVERAGE to stop src/os.c trying to
11provide the function. The macro may be set initially anyway, when compiling os.
12for utilities that don't want this function. */
13
14#ifndef OS_LOAD_AVERAGE
15#define OS_LOAD_AVERAGE
16
17#include <sys/table.h>
18
19int
20os_getloadavg(void)
21{
22double avg;
23struct tbl_loadavg load_avg;
24
25table (TBL_LOADAVG, 0, &load_avg, 1, sizeof (load_avg));
26
27avg = (load_avg.tl_lscale == 0)?
28 load_avg.tl_avenrun.d[0] :
29 (load_avg.tl_avenrun.l[0] / (double)load_avg.tl_lscale);
30
31return (int)(avg * 1000.0);
32}
33
34#endif /* OS_LOAD_AVERAGE */
35
36/* End of os.c-OSF1 */
diff --git a/OS/unsupported/os.c-cygwin b/OS/unsupported/os.c-cygwin
0new file mode 10064437new file mode 100644
index 0000000..c9464aa
--- /dev/null
+++ b/OS/unsupported/os.c-cygwin
@@ -0,0 +1,531 @@
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
5/* Cygwin-specific code. December 2002. Updated Jan 2015.
6 This is prefixed to the src/os.c file.
7
8 This code was supplied by Pierre A. Humblet <Pierre.Humblet@ieee.org>
9*/
10
11/* We need a special mkdir that
12 allows names starting with // */
13#undef mkdir
14int cygwin_mkdir( const char *path, mode_t mode )
15{
16 const char * p = path;
17 if (*p == '/') while(*(p+1) == '/') p++;
18 return mkdir(p, mode);
19}
20
21#ifndef COMPILE_UTILITY /* Utilities don't need special code */
22
23#ifdef INCLUDE_PAM
24#include "../pam/pam.c"
25#endif
26#include <alloca.h>
27
28unsigned int cygwin_WinVersion;
29
30/* Conflict between Windows definitions and others */
31#ifdef NOERROR
32#undef NOERROR
33#endif
34#ifdef DELETE
35#undef DELETE
36#endif
37
38#include <windows.h>
39#include <ntstatus.h>
40#include <lmcons.h>
41
42#define EqualLuid(Luid1, Luid2) \
43 ((Luid1.LowPart == Luid2.LowPart) && (Luid1.HighPart == Luid2.HighPart))
44#include <sys/cygwin.h>
45
46/* Special static variables */
47static BOOL cygwin_debug = FALSE;
48static int fakesetugid = 1; /* when not privileged, setugid = noop */
49
50#undef setuid
51int cygwin_setuid(uid_t uid )
52{
53 int res = 0;
54 if (fakesetugid == 0) {
55 res = setuid(uid);
56 if (cygwin_debug)
57 fprintf(stderr, "setuid %u %u %d pid: %d\n",
58 uid, getuid(),res, getpid());
59 }
60 return res;
61}
62
63#undef setgid
64int cygwin_setgid(gid_t gid )
65{
66 int res = 0;
67 if (fakesetugid == 0) {
68 res = setgid(gid);
69 if (cygwin_debug)
70 fprintf(stderr, "setgid %u %u %d pid: %d\n",
71 gid, getgid(), res, getpid());
72 }
73 return res;
74}
75
76/* Background processes run at lower priority */
77static void cygwin_setpriority()
78{
79 if (!SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS))
80 SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
81 return;
82}
83
84
85/* GetVersion()
86 MSB: 1 for 95/98/ME; Next 7: build number, except for 95/98/ME
87 Next byte: 0
88 Next byte: minor version of OS
89 Low byte: major version of OS (3 or 4 for for NT, 5 for 2000 and XP) */
90//#define VERSION_IS_58M(x) (x & 0x80000000) /* 95, 98, Me */
91//#define VERSION_IS_NT(x) ((x & 0XFF) < 5) /* NT 4 or 3.51 */
92
93/*
94 Routine to find if process or thread is privileged
95*/
96
97enum {
98 CREATE_BIT = 1,
99};
100
101static DWORD get_privileges ()
102{
103 char buffer[1024];
104 DWORD i, length;
105 HANDLE hToken = NULL;
106 PTOKEN_PRIVILEGES privs;
107 LUID cluid, rluid;
108 DWORD ret = 0;
109
110 privs = (PTOKEN_PRIVILEGES) buffer;
111
112 if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken)
113 && LookupPrivilegeValue (NULL, SE_CREATE_TOKEN_NAME, &cluid)
114 && LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &rluid)
115 && (GetTokenInformation( hToken, TokenPrivileges,
116 privs, sizeof (buffer), &length)
117 || (GetLastError () == ERROR_INSUFFICIENT_BUFFER
118 && (privs = (PTOKEN_PRIVILEGES) alloca (length))
119 && GetTokenInformation(hToken, TokenPrivileges,
120 privs, length, &length)))) {
121 for (i = 0; i < privs->PrivilegeCount; i++) {
122 if (EqualLuid(privs->Privileges[i].Luid, cluid))
123 ret |= CREATE_BIT;
124 if (ret == (CREATE_BIT))
125 break;
126 }
127 }
128 else
129 fprintf(stderr, "has_create_token_privilege %u\n", GetLastError());
130
131 if (hToken)
132 CloseHandle(hToken);
133
134 return ret;
135}
136
137/*
138 We use cygwin_premain to fake a few things
139 and to provide some debug info
140*/
141void cygwin_premain2(int argc, char ** argv, struct per_process * ptr)
142{
143 int i, res, is_daemon = 0, is_spoolwritable, is_privileged, is_eximuser;
144 uid_t myuid, systemuid;
145 gid_t mygid, adminsgid;
146 struct passwd * pwp = NULL;
147 struct stat buf;
148 char *cygenv;
149 SID(1, SystemSid, SECURITY_LOCAL_SYSTEM_RID);
150 SID(2, AdminsSid, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS);
151 DWORD priv_flags;
152
153 myuid = getuid();
154 mygid = getgid();
155 cygwin_WinVersion = GetVersion();
156 if ((cygenv = getenv("CYGWIN")) == NULL) cygenv = "";
157 /* Produce some debugging on stderr,
158 cannot yet use exim's debug functions.
159 Exim does not use -c and ignores -n.
160 Set lower priority for daemons */
161 for (i = 1; i < argc; i++) {
162 if (argv[i][0] == '-') {
163 if (argv[i][1] == 'c') {
164 ssize_t size;
165 wchar_t *win32_path;
166 argv[i][1] = 'n'; /* Replace -c by -n */
167 cygwin_debug = TRUE;
168 fprintf(stderr, "CYGWIN = \"%s\".\n", cygenv);
169 if (((size = cygwin_conv_path(CCP_POSIX_TO_WIN_W,"/", win32_path, 0)) > 0)
170 && ((win32_path = malloc(size)) != NULL)
171 && (cygwin_conv_path(CCP_POSIX_TO_WIN_W,"/", win32_path, size) == 0)) {
172 fprintf(stderr, " Root / mapped to %ls.\n", win32_path);
173 free(win32_path);
174 }
175 }
176 else if (argv[i][1] == 'b' && argv[i][2] == 'd') {
177 is_daemon = 1;
178 cygwin_setpriority();
179 }
180 }
181 }
182
183 /* Nt/2000/XP
184 We initially set the exim uid & gid to those of the "exim user",
185 or to the root uid (SYSTEM) and exim gid (ADMINS),
186 If privileged, we setuid to those.
187 We always set the configure uid to the system uid.
188 We always set the root uid to the real uid
189 to allow exim imposed restrictions (bypassable by recompiling)
190 and to avoid exec that cause loss of privilege
191 If not privileged and unable to chown,
192 we set the exim uid to our uid.
193 If unprivileged and /var/spool/exim is writable and not running as listening daemon,
194 we fake all subsequent setuid. */
195
196 /* Get the system and admins uid from their sids */
197 if ((systemuid = cygwin_internal(CW_GET_UID_FROM_SID, & SystemSid)) == -1) {
198 fprintf(stderr, "Cannot map System sid. Aborting\n");
199 exit(1);
200 }
201 if ((adminsgid = cygwin_internal(CW_GET_GID_FROM_SID, & AdminsSid)) == -1) {
202 fprintf(stderr, "Cannot map Admins sid. Aborting\n");
203 exit(1);
204 }
205
206 priv_flags = get_privileges ();
207 is_privileged = !!(priv_flags & CREATE_BIT);
208
209 /* Call getpwnam for account exim after getting the local exim name */
210 char exim_username[DNLEN + UNLEN + 2];
211 if (cygwin_internal(CW_CYGNAME_FROM_WINNAME, "exim", exim_username, sizeof exim_username) != 0)
212 pwp = getpwnam (exim_username);
213
214 /* If cannot setuid to exim or and is not the daemon (which is assumed to be
215 able to chown or to be the exim user) set the exim ugid to our ugid to avoid
216 chown failures after creating files and to be able to setuid to exim in
217 exim.c ( "privilege not needed" ). */
218 if ((is_privileged == 0) && (!is_daemon)) {
219 exim_uid = myuid;
220 exim_gid = mygid;
221 }
222 else if (pwp != NULL) {
223 exim_uid = pwp->pw_uid; /* Set it according to passwd */
224 exim_gid = pwp->pw_gid;
225 is_eximuser = 1;
226 }
227 else {
228 exim_uid = systemuid;
229 exim_gid = adminsgid;
230 is_eximuser = 0;
231 }
232
233 res = stat("/var/spool/exim", &buf);
234 /* Check if writable (and can be stat) */
235 is_spoolwritable = ((res == 0) && ((buf.st_mode & S_IWOTH) != 0));
236
237 fakesetugid = (is_privileged == 0) && (is_daemon == 0) && (is_spoolwritable == 1);
238
239 if (is_privileged) { /* Can setuid */
240 if (cygwin_setgid(exim_gid) /* Setuid to exim */
241 || cygwin_setuid(exim_uid)) {
242 fprintf(stderr, "Unable to setuid/gid to exim. priv_flags: %x\n", priv_flags);
243 exit(0); /* Problem... Perhaps not in 544 */
244 }
245 }
246
247 /* Set the configuration file uid and gid to the system uid and admins gid. */
248 config_uid = systemuid;
249 config_gid = adminsgid;
250
251 /* Pretend we are root to avoid useless exec
252 and avoid exim set limitations.
253 We are limited by file access rights */
254 root_uid = getuid ();
255
256 if (cygwin_debug) {
257 fprintf(stderr, "Starting uid %u, gid %u, priv_flags %x, is_privileged %d, is_daemon %d, is_spoolwritable %d.\n",
258 myuid, mygid, priv_flags, is_privileged, is_daemon, is_spoolwritable);
259 fprintf(stderr, "root_uid %u, exim_uid %u, exim_gid %u, config_uid %u, config_gid %u, is_eximuser %d.\n",
260 root_uid, exim_uid, exim_gid, config_uid, config_gid, is_eximuser);
261 }
262 return;
263}
264
265#ifndef OS_LOAD_AVERAGE /* Can be set on command line */
266#define OS_LOAD_AVERAGE /* src/os.c need not provide it */
267
268/*****************************************************************
269 Functions for average load measurements
270
271 Uses NtQuerySystemInformation.
272 This requires definitions that are not part of
273 standard include files.
274
275 This is discouraged starting with WinXP.
276
277*************************************************************/
278/* Structure to compute the load average efficiently */
279typedef struct {
280 DWORD Lock;
281 unsigned long long Time100ns; /* Last measurement time */
282 unsigned long long IdleCount; /* Latest cumulative idle time */
283 unsigned long long LastCounter; /* Last measurement counter */
284 unsigned long long PerfFreq; /* Perf counter frequency */
285 int LastLoad; /* Last reported load, or -1 */
286} cygwin_perf_t;
287
288static struct {
289 HANDLE handle;
290 pid_t pid;
291 cygwin_perf_t *perf;
292} cygwin_load = {NULL, 0, NULL};
293
294#include <ntdef.h>
295
296typedef enum _SYSTEM_INFORMATION_CLASS
297{
298 SystemBasicInformation = 0,
299 SystemPerformanceInformation = 2,
300 SystemTimeOfDayInformation = 3,
301 SystemProcessesAndThreadsInformation = 5,
302 SystemProcessorTimes = 8,
303 SystemPagefileInformation = 18,
304 /* There are a lot more of these... */
305} SYSTEM_INFORMATION_CLASS;
306
307typedef struct _SYSTEM_BASIC_INFORMATION
308{
309 ULONG Unknown;
310 ULONG MaximumIncrement;
311 ULONG PhysicalPageSize;
312 ULONG NumberOfPhysicalPages;
313 ULONG LowestPhysicalPage;
314 ULONG HighestPhysicalPage;
315 ULONG AllocationGranularity;
316 ULONG LowestUserAddress;
317 ULONG HighestUserAddress;
318 ULONG ActiveProcessors;
319 UCHAR NumberProcessors;
320} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
321
322typedef struct __attribute__ ((aligned (8))) _SYSTEM_PROCESSOR_TIMES
323{
324 LARGE_INTEGER IdleTime;
325 LARGE_INTEGER KernelTime;
326 LARGE_INTEGER UserTime;
327 LARGE_INTEGER DpcTime;
328 LARGE_INTEGER InterruptTime;
329 ULONG InterruptCount;
330} SYSTEM_PROCESSOR_TIMES, *PSYSTEM_PROCESSOR_TIMES;
331
332typedef NTSTATUS NTAPI (*NtQuerySystemInformation_t) (SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
333typedef ULONG NTAPI (*RtlNtStatusToDosError_t) (NTSTATUS);
334
335static NtQuerySystemInformation_t NtQuerySystemInformation;
336static RtlNtStatusToDosError_t RtlNtStatusToDosError;
337
338/*****************************************************************
339 *
340 LoadNtdll()
341 Load special functions from the NTDLL
342 Return TRUE if success.
343
344 *****************************************************************/
345
346static BOOL LoadNtdll()
347{
348 HINSTANCE hinstLib;
349
350 if ((hinstLib = LoadLibrary("NTDLL.DLL"))
351 && (NtQuerySystemInformation =
352 (NtQuerySystemInformation_t) GetProcAddress(hinstLib,
353 "NtQuerySystemInformation"))
354 && (RtlNtStatusToDosError =
355 (RtlNtStatusToDosError_t) GetProcAddress(hinstLib,
356 "RtlNtStatusToDosError")))
357 return TRUE;
358
359 DEBUG(D_load)
360 debug_printf("perf: load: %u (Windows)\n", GetLastError());
361 return FALSE;
362}
363/*****************************************************************
364 *
365 ReadStat()
366 Measures current Time100ns and IdleCount
367 Return TRUE if success.
368
369 *****************************************************************/
370
371static BOOL ReadStat(unsigned long long int *Time100nsPtr,
372 unsigned long long int *IdleCountPtr)
373{
374 NTSTATUS ret;
375 SYSTEM_BASIC_INFORMATION sbi;
376 PSYSTEM_PROCESSOR_TIMES spt;
377
378 *Time100nsPtr = *IdleCountPtr = 0;
379
380 if ((ret = NtQuerySystemInformation(SystemBasicInformation,
381 (PVOID) &sbi, sizeof sbi, NULL))
382 != STATUS_SUCCESS) {
383 DEBUG(D_load)
384 debug_printf("Perf: NtQuerySystemInformation: %u (Windows)\n",
385 RtlNtStatusToDosError(ret));
386 }
387 else if (!(spt = (PSYSTEM_PROCESSOR_TIMES) alloca(sizeof(spt[0]) * sbi.NumberProcessors))) {
388 DEBUG(D_load)
389 debug_printf("Perf: alloca: errno %d (%s)\n", errno, strerror(errno));
390 }
391 else if ((ret = NtQuerySystemInformation(SystemProcessorTimes, (PVOID) spt,
392 sizeof spt[0] * sbi.NumberProcessors, NULL))
393 != STATUS_SUCCESS) {
394 DEBUG(D_load)
395 debug_printf("Perf: NtQuerySystemInformation: %u (Windows)\n",
396 RtlNtStatusToDosError(ret));
397 }
398 else {
399 int i;
400 for (i = 0; i < sbi.NumberProcessors; i++) {
401 *Time100nsPtr += spt[i].KernelTime.QuadPart;;
402 *Time100nsPtr += spt[i].UserTime.QuadPart;
403 *IdleCountPtr += spt[i].IdleTime.QuadPart;
404 }
405 return TRUE;
406 }
407 return FALSE;
408}
409
410/*****************************************************************
411 *
412 InitLoadAvg()
413 Initialize the cygwin_load.perf structure.
414 and set cygwin_load.perf->Flag to TRUE if successful.
415 This is called the first time os_getloadavg is called
416 *****************************************************************/
417static void InitLoadAvg(cygwin_perf_t *this)
418{
419 BOOL success = TRUE;
420
421 /* Get perf frequency and counter */
422 QueryPerformanceFrequency((LARGE_INTEGER *)& this->PerfFreq);
423 QueryPerformanceCounter((LARGE_INTEGER *)& this->LastCounter);
424
425 /* Get initial values for Time100ns and IdleCount */
426 success = success
427 && ReadStat( & this->Time100ns,
428 & this->IdleCount);
429 /* If success, set the Load to 0, else to -1 */
430 if (success) this->LastLoad = 0;
431 else {
432 log_write(0, LOG_MAIN, "Cannot obtain Load Average");
433 this->LastLoad = -1;
434 }
435}
436
437
438/*****************************************************************
439 *
440 os_getloadavg()
441
442 Return -1 if not available;
443 Return the previous value if less than AVERAGING sec old.
444 else return the processor load on a [0 - 1000] scale.
445
446 The first time we are called we initialize the counts
447 and return 0 or -1.
448 The initial load cannot be measured as we use the processor 100%
449*****************************************************************/
450static SECURITY_ATTRIBUTES sa = {sizeof (SECURITY_ATTRIBUTES), NULL, TRUE};
451#define AVERAGING 10
452
453int os_getloadavg()
454{
455 unsigned long long Time100ns, IdleCount, CurrCounter;
456 int value;
457 pid_t newpid;
458
459 /* New process.
460 Reload the dlls and the file mapping */
461 if ((newpid = getpid()) != cygwin_load.pid) {
462 BOOL new;
463 cygwin_load.pid = newpid;
464
465 if (!LoadNtdll()) {
466 log_write(0, LOG_MAIN, "Cannot obtain Load Average");
467 cygwin_load.perf = NULL;
468 return -1;
469 }
470
471 if ((new = !cygwin_load.handle)) {
472 cygwin_load.handle = CreateFileMapping (INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE,
473 0, sizeof(cygwin_perf_t), NULL);
474 DEBUG(D_load)
475 debug_printf("Perf: CreateFileMapping: handle %p\n", (void *) cygwin_load.handle);
476 }
477 cygwin_load.perf = (cygwin_perf_t *) MapViewOfFile (cygwin_load.handle,
478 FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
479 DEBUG(D_load)
480 debug_printf("Perf: MapViewOfFile: addr %p\n", (void *) cygwin_load.perf);
481 if (new && cygwin_load.perf)
482 InitLoadAvg(cygwin_load.perf);
483 }
484
485 /* Check if initialized OK */
486 if (!cygwin_load.perf || cygwin_load.perf->LastLoad < 0)
487 return -1;
488
489 /* If we cannot get the lock, we return 0.
490 This is to prevent any lock-up possibility.
491 Finding a lock busy is unlikely, and giving up only
492 results in an immediate delivery .*/
493
494 if (InterlockedCompareExchange(&cygwin_load.perf->Lock, 1, 0)) {
495 DEBUG(D_load)
496 debug_printf("Perf: Lock busy\n");
497 return 0;
498 }
499
500 /* Get the current time (PerfCounter) */
501 QueryPerformanceCounter((LARGE_INTEGER *)& CurrCounter);
502 /* Calls closer than AVERAGING sec apart use the previous value */
503 if (CurrCounter - cygwin_load.perf->LastCounter >
504 AVERAGING * cygwin_load.perf->PerfFreq) {
505 /* Get Time100ns and IdleCount */
506 if (ReadStat( & Time100ns, & IdleCount)) { /* Success */
507 /* Return processor load on 1000 scale */
508 value = 1000 - ((1000 * (IdleCount - cygwin_load.perf->IdleCount)) /
509 (Time100ns - cygwin_load.perf->Time100ns));
510 cygwin_load.perf->Time100ns = Time100ns;
511 cygwin_load.perf->IdleCount = IdleCount;
512 cygwin_load.perf->LastCounter = CurrCounter;
513 cygwin_load.perf->LastLoad = value;
514 DEBUG(D_load)
515 debug_printf("Perf: New load average %d\n", value);
516 }
517 else { /* Something bad happened.
518 Refuse to measure the load anymore
519 but don't bother releasing the buffer */
520 log_write(0, LOG_MAIN, "Cannot obtain Load Average");
521 cygwin_load.perf->LastLoad = -1;
522 }
523 }
524 else
525 DEBUG(D_load)
526 debug_printf("Perf: Old load average %d\n", cygwin_load.perf->LastLoad);
527 cygwin_load.perf->Lock = 0;
528 return cygwin_load.perf->LastLoad;
529}
530#endif /* OS_LOAD_AVERAGE */
531#endif /* COMPILE_UTILITY */
diff --git a/OS/unsupported/os.h-AIX b/OS/unsupported/os.h-AIX
0new file mode 100644532new file mode 100644
index 0000000..5cd4501
--- /dev/null
+++ b/OS/unsupported/os.h-AIX
@@ -0,0 +1,27 @@
1/* Exim: OS-specific C header file for AIX */
2/* Written by Nick Waterman <nick@cimio.co.uk> */
3/* Modified by Philip Hazel with data from
4 Niels Provos <provos@wserver.physnet.uni-hamburg.de>
5 Juozas Simkevicius <juozas@omnitel.net> for load averages
6*/
7
8#define HAVE_DEV_KMEM
9#define LOAD_AVG_SYMBOL "avenrun"
10#define KERNEL_PATH "/unix"
11#define LOAD_AVG_TYPE int
12#define FSCALE 65536.0
13
14#define HAVE_SYS_VFS_H
15#define HAVE_SYS_STATFS_H
16
17/* Now tell AIX to emulate BSD as badly as it can. */
18
19#define _BSD 44
20
21typedef struct flock flock_t;
22
23/* default is non-const */
24#define ICONV_ARG2_TYPE const char **
25
26
27/* End */
diff --git a/OS/unsupported/os.h-BSDI b/OS/unsupported/os.h-BSDI
0new file mode 10064428new file mode 100644
index 0000000..a1705ec
--- /dev/null
+++ b/OS/unsupported/os.h-BSDI
@@ -0,0 +1,15 @@
1/* Exim: OS-specific C header file for BSDI */
2
3#define HAVE_BSD_GETLOADAVG
4#define HAVE_SETCLASSRESOURCES
5#define HAVE_MMAP
6#define HAVE_SYS_MOUNT_H
7#define SIOCGIFCONF_GIVES_ADDR
8#define OS_UNSETENV
9
10typedef struct flock flock_t;
11
12/* default is non-const */
13#define ICONV_ARG2_TYPE const char **
14
15/* End */
diff --git a/OS/unsupported/os.h-DGUX b/OS/unsupported/os.h-DGUX
0new file mode 10064416new file mode 100644
index 0000000..9040f0e
--- /dev/null
+++ b/OS/unsupported/os.h-DGUX
@@ -0,0 +1,28 @@
1/* Exim: OS-specific C header file for DGUX */
2
3/* Written by Ken Bailey (K.Bailey@rbgkew.org.uk) Feb 1998 */
4/* on dgux R4.11MU04 generic AViiON mc88100 */
5/* Modified Dec 1998 by PH after message from Ken. */
6
7#define HAVE_SYS_STATVFS_H
8#define F_FAVAIL f_favail
9
10#define NO_SYSEXITS /* DGUX doesn't ship sysexits.h */
11#define NO_IP_VAR_H /* DGUX has no netinet/ip_var.h */
12
13#define os_strsignal dg_strsignal
14#define OS_STRSIGNAL
15
16#define HAVE_MMAP
17
18/* The definition of ipoptions in netinet/in.h (masquerading as ip_opts) used
19in smtp_in.c is for Intel DG _IX86_ABI only. You may be able to get this to
20work on Intel DG but it's certainly easier to skip it on M88k. This means we
21forego the detection of some source-routing based IP attacks. */
22
23#define NO_IP_OPTIONS
24
25/* default is non-const */
26#define ICONV_ARG2_TYPE const char **
27
28/* End */
diff --git a/OS/unsupported/os.h-Darwin b/OS/unsupported/os.h-Darwin
0new file mode 10064429new file mode 100644
index 0000000..f408740
--- /dev/null
+++ b/OS/unsupported/os.h-Darwin
@@ -0,0 +1,48 @@
1/* Exim: OS-specific C header file for Darwin (Mac OS X) */
2
3/* #define CRYPT_H */ /* Apparently this isn't needed */
4
5#define HAVE_MMAP
6#define HAVE_SYS_MOUNT_H
7#define PAM_H_IN_PAM
8#define SIOCGIFCONF_GIVES_ADDR
9
10/* OSX 10.2 does not have poll.h, 10.3 does emulate it badly. */
11#define NO_POLL_H
12
13#define F_FREESP O_TRUNC
14typedef struct flock flock_t;
15
16#define BASE_62 36 /* HFS+ aliases lower and upper cases in filenames.
17 Consider reducing MAX_LOCALHOST_NUMBER */
18
19#ifndef _BSD_SOCKLEN_T_
20#define _BSD_SOCKLEN_T_ int32_t /* socklen_t (duh) */
21#endif
22
23/* Settings for handling IP options. There's no netinet/ip_var.h. The IP
24option handling is in the style of the later GLIBCs but the GLIBC macros
25aren't set, so we invent a new one. */
26
27#define NO_IP_VAR_H
28#define DARWIN_IP_OPTIONS
29
30/* Need this for the DNS lookup code. Remember to remove if we get round to
31updating Exim to use the newer interface. */
32
33#define BIND_8_COMPAT
34
35/* It's not .so for dynamic libraries on Darwin. */
36#define DYNLIB_FN_EXT "dylib"
37
38/* We currently need some assistance getting OFF_T_FMT correct on MacOS */
39#ifdef OFF_T_FMT
40# undef OFF_T_FMT
41#endif
42#define OFF_T_FMT "%lld"
43#define LONGLONG_T long int
44
45/* default is non-const */
46#define ICONV_ARG2_TYPE const char **
47
48/* End */
diff --git a/OS/unsupported/os.h-DragonFly b/OS/unsupported/os.h-DragonFly
0new file mode 10064449new file mode 100644
index 0000000..4c2f1d5
--- /dev/null
+++ b/OS/unsupported/os.h-DragonFly
@@ -0,0 +1,13 @@
1/* Exim: OS-specific C header file for DragonFly */
2
3#define HAVE_BSD_GETLOADAVG
4#define HAVE_MMAP
5#define HAVE_SYS_MOUNT_H
6#define SIOCGIFCONF_GIVES_ADDR
7
8typedef struct flock flock_t;
9
10/* default is non-const */
11#define ICONV_ARG2_TYPE const char **
12
13/* End */
diff --git a/OS/unsupported/os.h-GNU b/OS/unsupported/os.h-GNU
0new file mode 10064414new file mode 100644
index 0000000..4499316
--- /dev/null
+++ b/OS/unsupported/os.h-GNU
@@ -0,0 +1,23 @@
1/* Exim: OS-specific C header file for GNU/Hurd */
2
3#define CRYPT_H
4#define GLIBC_IP_OPTIONS
5#define HAVE_BSD_GETLOADAVG
6#define HAVE_MMAP
7#define HAVE_SYS_VFS_H
8#define NO_IP_VAR_H
9#define SIG_IGN_WORKS
10#define SIOCGIFCONF_GIVES_ADDR
11
12#define F_FREESP O_TRUNC
13typedef struct flock flock_t;
14
15#define os_strsignal strsignal
16#define OS_STRSIGNAL
17
18/* Hurd-specific bits below */
19
20/* default is non-const */
21#define ICONV_ARG2_TYPE const char **
22
23/* End */
diff --git a/OS/unsupported/os.h-GNUkFreeBSD b/OS/unsupported/os.h-GNUkFreeBSD
0new file mode 10064424new file mode 100644
index 0000000..ab35031
--- /dev/null
+++ b/OS/unsupported/os.h-GNUkFreeBSD
@@ -0,0 +1,25 @@
1/* Exim: OS-specific C header file for GNU/kFreeBSD */
2
3#define CRYPT_H
4#define GLIBC_IP_OPTIONS
5#define HAVE_MMAP
6#define HAVE_BSD_GETLOADAVG
7#define HAVE_SYS_VFS_H
8#define NO_IP_VAR_H
9#define SIG_IGN_WORKS
10
11#define F_FREESP O_TRUNC
12typedef struct flock flock_t;
13
14#define os_strsignal strsignal
15#define OS_STRSIGNAL
16
17/* kFreeBSD-specific bits below */
18
19#define HAVE_SYS_MOUNT_H
20#define SIOCGIFCONF_GIVES_ADDR
21
22/* default is non-const */
23#define ICONV_ARG2_TYPE const char **
24
25/* End */
diff --git a/OS/unsupported/os.h-GNUkNetBSD b/OS/unsupported/os.h-GNUkNetBSD
0new file mode 10064426new file mode 100644
index 0000000..bc3bc25
--- /dev/null
+++ b/OS/unsupported/os.h-GNUkNetBSD
@@ -0,0 +1,25 @@
1/* Exim: OS-specific C header file for GNU/kNetBSD */
2
3#define CRYPT_H
4#define GLIBC_IP_OPTIONS
5#define HAVE_MMAP
6#define HAVE_BSD_GETLOADAVG
7#define HAVE_SYS_VFS_H
8#define NO_IP_VAR_H
9#define SIG_IGN_WORKS
10
11#define F_FREESP O_TRUNC
12typedef struct flock flock_t;
13
14#define os_strsignal strsignal
15#define OS_STRSIGNAL
16
17/* kNetBSD-specific bits below */
18
19#define HAVE_SYS_MOUNT_H
20#define SIOCGIFCONF_GIVES_ADDR
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches