unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

Makefile.in (9700B)

      1 #/************************************************************************
      2 #*   IRC - Internet Relay Chat, Makefile
      3 #*   Copyright (C) 1990, Jarkko Oikarinen
      4 #*
      5 #*   This program is free software; you can redistribute it and/or modify
      6 #*   it under the terms of the GNU General Public License as published by
      7 #*   the Free Software Foundation; either version 1, or (at your option)
      8 #*   any later version.
      9 #*
     10 #*   This program is distributed in the hope that it will be useful,
     11 #*   but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 #*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 #*   GNU General Public License for more details.
     14 #*
     15 #*   You should have received a copy of the GNU General Public License
     16 #*   along with this program; if not, write to the Free Software
     17 #*   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     18 #*  
     19 #*   $Id$
     20 #*/
     21 
     22 CC=@CC@
     23 INCLUDEDIR=@UNRLINCDIR@
     24 NETWORKSDIR=
     25 FROMDOS=/home/cmunk/bin/4dos
     26 
     27 # [CHANGEME]
     28 # Default flags:
     29 # Change XCFLAGS if you don't like what Config puts there.  Same with
     30 # IRCDLIBS.
     31 #
     32 # If you are configuring by hand, try "-O -g" for XCFLAGS, and leave
     33 # IRCDLIBS blank.  If that fails, try recomendations below.
     34 #
     35 
     36 #XCFLAGS=-O -g -export-dynamic
     37 IRCDLIBS=@IRCDLIBS@ @PCRE2_LIBS@ @ARGON2_LIBS@ @CARES_LIBS@ @SODIUM_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@
     38 CRYPTOLIB=@CRYPTOLIB@
     39 OPENSSLINCLUDES=
     40 
     41 XCFLAGS=@PTHREAD_CFLAGS@ @PCRE2_CFLAGS@ @ARGON2_CFLAGS@ @CARES_CFLAGS@ @SODIUM_CFLAGS@ @JANSSON_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@
     42 #
     43 # use the following on MIPS:
     44 #CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)
     45 # For Irix 4.x (SGI), use the following:
     46 #CFLAGS= -g -cckr -I$(INCLUDEDIR)
     47 #
     48 # on NEXT use:
     49 #CFLAGS=-bsd -I$(INCLUDEDIR)
     50 #on NeXT other than 2.0:
     51 #IRCDLIBS=-lsys_s
     52 #
     53 # AIX 370 flags
     54 #CFLAGS=-D_BSD -Hxa -I$(INCLUDEDIR)
     55 #IRCDLIBS=-lbsd
     56 #
     57 # Dynix/ptx V2.0.x
     58 #CFLAGS= -I$(INCLUDEDIR) -O -Xo
     59 #IRCDLIBS= -lsocket -linet -lnsl -lseq
     60 # 
     61 # Dynix/ptx V1.x.x
     62 #IRCDLIBS= -lsocket -linet -lnsl -lseq
     63 #
     64 #use the following on SUN OS without nameserver libraries inside libc
     65 #IRCDLIBS=-lresolv
     66 #
     67 # Solaris 2
     68 #IRCDLIBS=-lsocket -lnsl -lresolv -L/usr/ucblib -R/usr/ucblib -lgen
     69 #
     70 # ESIX
     71 #CFLAGS=-O -I$(INCLUDEDIR) -I/usr/ucbinclude
     72 #IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl
     73 #
     74 # LDFLAGS - flags to send the loader (ld). SunOS users may want to add
     75 # -Bstatic here.
     76 #
     77 #LDFLAGS=-Bstatic
     78 #
     79 #Dell SVR4
     80 #CC=gcc
     81 #CFLAGS= -I$(INCLUDEDIR) -O2
     82 #IRCDLIBS=-lsocket -lnsl -lucb
     83 
     84 # [CHANGEME]
     85 # IRCDMODE is the mode you want the binary to be.
     86 # The 4 at the front is important (allows for setuidness)
     87 #
     88 # WARNING: if you are making ircd SUID or SGID, check config.h to make sure
     89 #          you are not defining CMDLINE_CONFIG 
     90 IRCDMODE = 711
     91 
     92 # Objects that are optional due to optional libraries:
     93 URL=@URL@
     94 GEOIP_CLASSIC_OBJECTS=@GEOIP_CLASSIC_OBJECTS@
     95 GEOIP_CLASSIC_LIBS=@GEOIP_CLASSIC_LIBS@
     96 GEOIP_CLASSIC_CFLAGS=@GEOIP_CLASSIC_CFLAGS@
     97 GEOIP_MAXMIND_OBJECTS=@GEOIP_MAXMIND_OBJECTS@
     98 LIBMAXMINDDB_CFLAGS=@LIBMAXMINDDB_CFLAGS@
     99 LIBMAXMINDDB_LIBS=@LIBMAXMINDDB_LIBS@
    100 
    101 # Where is your openssl binary
    102 OPENSSLPATH=@OPENSSLPATH@
    103 
    104 CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS)
    105 XLDFLAGS=@LDFLAGS_PRIVATELIBS@ @HARDEN_LDFLAGS@ @LDFLAGS@
    106 LDFLAGS=$(XLDFLAGS)
    107 
    108 SHELL=/bin/sh
    109 SUBDIRS=src
    110 BINDIR=@BINDIR@
    111 INSTALL=@INSTALL@
    112 RM=@RM@
    113 CP=@CP@
    114 TOUCH=@TOUCH@
    115 RES=
    116 all:	build
    117 
    118 MAKEARGS =	'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
    119 		'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}' \
    120 		'RES=${RES}' 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \
    121 		'INCLUDEDIR=${INCLUDEDIR}' \
    122 		'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \
    123 		'SHELL=${SHELL}' \
    124 		'CRYPTOLIB=${CRYPTOLIB}' \
    125 		'CRYPTOINCLUDES=${CRYPTOINCLUDES}' \
    126 		'URL=${URL}' \
    127 		'GEOIP_CLASSIC_OBJECTS=${GEOIP_CLASSIC_OBJECTS}' \
    128 		'GEOIP_CLASSIC_LIBS=${GEOIP_CLASSIC_LIBS}' \
    129 		'GEOIP_CLASSIC_CFLAGS=${GEOIP_CLASSIC_CFLAGS}' \
    130 		'GEOIP_MAXMIND_OBJECTS=${GEOIP_MAXMIND_OBJECTS}' \
    131 		'LIBMAXMINDDB_CFLAGS=${LIBMAXMINDDB_CFLAGS}' \
    132 		'LIBMAXMINDDB_LIBS=${LIBMAXMINDDB_LIBS}'
    133 
    134 custommodule:
    135 	@if test -z "${MODULEFILE}"; then echo "Please set MODULEFILE when calling \`\`make custommodule''. For example, \`\`make custommodule MODULEFILE=callerid''." >&2; exit 1; fi
    136 	+cd src; ${MAKE} ${MAKEARGS} MODULEFILE=${MODULEFILE} 'EXLIBS=${EXLIBS}' custommodule
    137 
    138 server: Makefile
    139 build: Makefile
    140 	-@if [ ! -f include/setup.h ] ; then \
    141 		echo "Hmm...doesn't look like you've run Config..."; \
    142 		echo "Doing so now."; \
    143 		sh Config; \
    144 	fi
    145 	@+for i in $(SUBDIRS); do \
    146 		echo "Building $$i";\
    147 		( cd $$i; ${MAKE} ${MAKEARGS} build; ) \
    148 	done
    149 	@echo ''
    150 	@echo '* UnrealIRCd compiled successfully'
    151 	@echo '* YOU ARE NOT DONE YET! Run "${MAKE} install" to install UnrealIRCd !'
    152 	@echo ''
    153 
    154 clean:
    155 	$(RM) -f *~ \#* core *.orig include/*.orig
    156 	@+for i in $(SUBDIRS); do \
    157 		echo "Cleaning $$i";\
    158 		( cd $$i; ${MAKE} ${MAKEARGS} clean; ) \
    159 	done
    160 	-@if [ -f include/setup.h ] ; then \
    161 	  echo "To really restart installation, remove include/setup.h" ; \
    162 	fi
    163 
    164 cleandir: clean
    165 	rm -rf include/setup.h Makefile Settings
    166 
    167 distclean: cleandir
    168 	rm -rf extras/*.bak extras/*.tar extras/c-ares
    169 	rm -rf extras/c-ares-* extras/tre-*
    170 	rm -rf config.log config.settings *.pem ircd.* unrealircd
    171 	rm -rf Makefile config.status
    172 	
    173 depend:
    174 	@+for i in $(SUBDIRS); do \
    175 		echo "Making dependencies in $$i";\
    176 		( cd $$i; ${MAKE} ${MAKEARGS} depend; ) \
    177 	done
    178 
    179 install: all
    180 	$(INSTALL) -m 0700 -d $(DESTDIR)@BINDIR@
    181 	$(INSTALL) -m 0700 src/ircd $(DESTDIR)@BINDIR@/unrealircd
    182 	$(INSTALL) -m 0700 src/unrealircdctl $(DESTDIR)@BINDIR@/unrealircdctl
    183 	$(INSTALL) -m 0700 extras/unrealircd-upgrade-script $(DESTDIR)@BINDIR@/unrealircd-upgrade-script
    184 	$(INSTALL) -m 0700 -d $(DESTDIR)@DOCDIR@
    185 	$(INSTALL) -m 0600 doc/Authors doc/coding-guidelines doc/tao.of.irc doc/KEYS doc/RELEASE-NOTES.md $(DESTDIR)@DOCDIR@
    186 	$(INSTALL) -m 0700 -d $(DESTDIR)@CONFDIR@
    187 	$(INSTALL) -m 0600 doc/conf/*.conf $(DESTDIR)@CONFDIR@
    188 	$(INSTALL) -m 0600 doc/conf/*.motd $(DESTDIR)@CONFDIR@
    189 	$(INSTALL) -m 0700 unrealircd $(DESTDIR)@SCRIPTDIR@
    190 	$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@
    191 	@rm -f $(DESTDIR)@MODULESDIR@/*.so 1>/dev/null 2>&1
    192 	$(INSTALL) -m 0700 src/modules/*.so $(DESTDIR)@MODULESDIR@
    193 	$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/usermodes
    194 	@rm -f $(DESTDIR)@MODULESDIR@/usermodes/*.so 1>/dev/null 2>&1
    195 	$(INSTALL) -m 0700 src/modules/usermodes/*.so $(DESTDIR)@MODULESDIR@/usermodes
    196 	$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/chanmodes
    197 	@rm -f $(DESTDIR)@MODULESDIR@/chanmodes/*.so 1>/dev/null 2>&1
    198 	$(INSTALL) -m 0700 src/modules/chanmodes/*.so $(DESTDIR)@MODULESDIR@/chanmodes
    199 	$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/extbans
    200 	@rm -f $(DESTDIR)@MODULESDIR@/extbans/*.so 1>/dev/null 2>&1
    201 	$(INSTALL) -m 0700 src/modules/extbans/*.so $(DESTDIR)@MODULESDIR@/extbans
    202 	$(INSTALL) -m 0700 -d $(DESTDIR)@MODULESDIR@/rpc
    203 	@rm -f $(DESTDIR)@MODULESDIR@/rpc/*.so 1>/dev/null 2>&1
    204 	$(INSTALL) -m 0700 src/modules/rpc/*.so $(DESTDIR)@MODULESDIR@/rpc
    205 	@#If the conf/ssl directory exists then rename it here to conf/tls
    206 	@#and add a symlink for backwards compatibility (so that f.e. certbot
    207 	@#doesn't randomly fail after an upgrade to U5).
    208 	-@if [ -d "$(DESTDIR)@CONFDIR@/ssl" ] ; then \
    209 		mv "$(DESTDIR)@CONFDIR@/ssl" "$(DESTDIR)@CONFDIR@/tls" ; \
    210 		ln -s "$(DESTDIR)@CONFDIR@/tls" "$(DESTDIR)@CONFDIR@/ssl" ; \
    211 	fi
    212 	$(INSTALL) -m 0700 -d $(DESTDIR)@CONFDIR@/tls
    213 	$(INSTALL) -m 0600 doc/conf/tls/curl-ca-bundle.crt $(DESTDIR)@CONFDIR@/tls
    214 	@# delete modules/cap directory, to avoid confusing with U4 to U5 upgrades:
    215 	rm -rf $(DESTDIR)@MODULESDIR@/cap
    216 	@#This step can fail with zero files, so we ignore exit status:
    217 	$(INSTALL) -m 0700 -d $(DESTDIR)@TMPDIR@
    218 	$(INSTALL) -m 0700 -d $(DESTDIR)@CACHEDIR@
    219 	$(INSTALL) -m 0700 -d $(DESTDIR)@PERMDATADIR@
    220 	$(INSTALL) -m 0700 -d $(DESTDIR)@LOGDIR@
    221 	-@if [ -f "$(DESTDIR)@CONFDIR@/tls/server.cert.pem" ] ; then \
    222 		$(INSTALL) -m 0600 server.req.pem $(DESTDIR)@CONFDIR@/tls ; \
    223 		$(INSTALL) -m 0600 server.key.pem $(DESTDIR)@CONFDIR@/tls ; \
    224 		$(INSTALL) -m 0600 server.cert.pem $(DESTDIR)@CONFDIR@/tls ; \
    225 	fi
    226 	@rm -f $(DESTDIR)@SCRIPTDIR@/source
    227 	ln -s @BUILDDIR@ $(DESTDIR)@SCRIPTDIR@/source
    228 	@echo ''
    229 	@echo '* UnrealIRCd is now installed.'
    230 	
    231 	-@if [ "@SCRIPTDIR@/bin" = "@BINDIR@" ] ; then \
    232 		echo '* Leave this directory and run "cd @SCRIPTDIR@" now' ; \
    233 	fi
    234 	@echo '* Directory layout:'
    235 	-@if [ "@SCRIPTDIR@/bin" = "@BINDIR@" ] ; then \
    236 		echo ' * Base directory: @SCRIPTDIR@' ; \
    237 	fi
    238 	@echo '  * Configuration files: @CONFDIR@'
    239 	@echo '  * Log files: @LOGDIR@'
    240 	@echo '  * Modules: @MODULESDIR@'
    241 	@echo '* To start/stop UnrealIRCd run: @SCRIPTDIR@/unrealircd"'
    242 	@echo ''
    243 	@echo '* Consult the documentation online at:'
    244 	@echo '  * https://www.unrealircd.org/docs/'
    245 	@echo '  * https://www.unrealircd.org/docs/FAQ'
    246 	@echo '* You may also wish to install a cron job to ensure UnrealIRCd is always running:'
    247 	@echo '  * https://www.unrealircd.org/docs/Cron_job'
    248 	@echo ''
    249 	-@if [ "@SCRIPTDIR@/bin" = "@BINDIR@" ] ; then \
    250 		echo 'Again, be sure to change to the @SCRIPTDIR@ directory!' ; \
    251 	fi
    252 
    253 pem:	extras/tls.cnf
    254 	@echo "Generating server key..."
    255 	$(OPENSSLPATH) ecparam -out server.key.pem -name secp384r1 -genkey
    256 	@echo "Generating certificate request..."
    257 	$(OPENSSLPATH) req -new \
    258               -config extras/tls.cnf -sha256 -out server.req.pem \
    259               -key server.key.pem -nodes
    260 	@echo "Generating self-signed certificate..."
    261 	$(OPENSSLPATH) req -x509 -days 3650 -sha256 -nodes -in server.req.pem \
    262                -key server.key.pem -out server.cert.pem
    263 	@echo "Setting permissions on server.*.pem files..."
    264 	chmod o-rwx server.req.pem server.key.pem server.cert.pem
    265 	chmod g-rwx server.req.pem server.key.pem server.cert.pem
    266 
    267 Makefile: config.status Makefile.in
    268 	./config.status