]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge pull request #1167 from SaberUK/master+collision
authorAttila Molnar <attilamolnar@hush.com>
Mon, 4 Apr 2016 12:31:04 +0000 (14:31 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Mon, 4 Apr 2016 12:31:04 +0000 (14:31 +0200)
Rename vague build environment variables to prevent collisions.

include/modules.h
make/calcdep.pl
make/template/main.mk
src/coremods/core_info/cmd_modules.cpp
src/modmanager_dynamic.cpp
src/modmanager_static.cpp
tools/test-build

index 46aa13e4086fbed920340b5f4aa6cf6c79fb7aed..e836f19ddb828d08c5b7146aba57b5f91d94a73b 100644 (file)
@@ -1235,7 +1235,7 @@ class CoreExport ModuleManager : public fakederef<ModuleManager>
 #define MODULE_INIT_SYM_FN_2(x,y) MODULE_INIT_SYM_FN_1(x,y)
 #define MODULE_INIT_SYM_FN_1(x,y) inspircd_module_ ## x ## _ ## y
 
-#ifdef PURE_STATIC
+#ifdef INSPIRCD_STATIC
 
 struct AllCommandList {
        typedef Command* (*fn)(Module*);
index 65e19773e0e29fe1c08d84b408a59954464f8750..f8f50497e18e9d82508a36a6079396b5918a9c6b 100755 (executable)
@@ -57,7 +57,7 @@ sub run() {
        open MAKE, '>real.mk' or die "Could not write real.mk: $!";
        chdir "${\SOURCEPATH}/src";
 
-       if ($ENV{PURE_STATIC}) {
+       if ($ENV{INSPIRCD_STATIC}) {
                run_static();
        } else {
                run_dynamic();
index 7b153a924ba2c202d11283df1ce9f67e699ab223..78de3a8d1f452bcbdaf2bc30425879be3c44a086 100644 (file)
@@ -84,12 +84,12 @@ INSTMODE_LIB = 0640
   PICLDFLAGS = -fPIC -shared -twolevel_namespace -undefined dynamic_lookup $(LDFLAGS)
 @ENDIF
 
-@IFNDEF D
-  D=0
+@IFNDEF INSPIRCD_DEBUG
+  INSPIRCD_DEBUG=0
 @ENDIF
 
 DBGOK=0
-@IFEQ $(D) 0
+@IFEQ $(INSPIRCD_DEBUG) 0
   CORECXXFLAGS += -fno-rtti -O2
 @IFEQ $(COMPILER) GCC
     CORECXXFLAGS += -g1
@@ -97,12 +97,12 @@ DBGOK=0
   HEADER = std-header
   DBGOK=1
 @ENDIF
-@IFEQ $(D) 1
+@IFEQ $(INSPIRCD_DEBUG) 1
   CORECXXFLAGS += -O0 -g3 -Werror -DINSPIRCD_ENABLE_RTTI
   HEADER = debug-header
   DBGOK=1
 @ENDIF
-@IFEQ $(D) 2
+@IFEQ $(INSPIRCD_DEBUG) 2
   CORECXXFLAGS += -fno-rtti -O2 -g3
   HEADER = debug-header
   DBGOK=1
@@ -114,7 +114,7 @@ FOOTER = finishmessage
 @TARGET GNU_MAKE SOURCEPATH = $(shell /bin/pwd)
 @TARGET BSD_MAKE SOURCEPATH != /bin/pwd
 
-@IFDEF V
+@IFDEF INSPIRCD_VERBOSE
   VERBOSE = -v
 @ELSE
   @TARGET GNU_MAKE MAKEFLAGS += --silent
@@ -122,8 +122,8 @@ FOOTER = finishmessage
   VERBOSE =
 @ENDIF
 
-@IFDEF PURE_STATIC
-  CORECXXFLAGS += -DPURE_STATIC
+@IFDEF INSPIRCD_STATIC
+  CORECXXFLAGS += -DINSPIRCD_STATIC
 @ENDIF
 
 # Add the users CXXFLAGS to the base ones to allow them to override
@@ -131,22 +131,22 @@ FOOTER = finishmessage
 CORECXXFLAGS += $(CXXFLAGS)
 
 @DO_EXPORT CXX CORECXXFLAGS LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
-@DO_EXPORT SOURCEPATH BUILDPATH PURE_STATIC
+@DO_EXPORT SOURCEPATH BUILDPATH INSPIRCD_STATIC
 
 # Default target
 TARGET = all
 
-@IFDEF M
+@IFDEF INSPIRCD_MODULE
     HEADER = mod-header
     FOOTER = mod-footer
-    @TARGET BSD_MAKE TARGET = modules/${M:S/.so$//}.so
-    @TARGET GNU_MAKE TARGET = modules/$(M:.so=).so
+    @TARGET BSD_MAKE TARGET = modules/${INSPIRCD_MODULE:S/.so$//}.so
+    @TARGET GNU_MAKE TARGET = modules/$(INSPIRCD_MODULE:.so=).so
 @ENDIF
 
-@IFDEF T
+@IFDEF INSPIRCD_TARGET
     HEADER =
     FOOTER = target
-    TARGET = $(T)
+    TARGET = $(INSPIRCD_TARGET)
 @ENDIF
 
 @IFEQ $(DBGOK) 0
@@ -160,7 +160,7 @@ target: $(HEADER)
        cd $(BUILDPATH); $(MAKEENV) $(MAKE) -f real.mk $(TARGET)
 
 debug:
-       @${MAKE} D=1 all
+       @${MAKE} INSPIRCD_DEBUG=1 all
 
 debug-header:
        @echo "*************************************"
@@ -177,7 +177,7 @@ debug-header:
        @echo "*************************************"
 
 mod-header:
-@IFDEF PURE_STATIC
+@IFDEF INSPIRCD_STATIC
        @echo 'Cannot build single modules in pure-static build'
        @exit 1
 @ENDIF
@@ -226,7 +226,7 @@ install: target
        @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MANPATH)
        @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH)
        [ $(BUILDPATH)/bin/ -ef $(BINPATH) ] || $(INSTALL) -m $(INSTMODE_BIN) $(BUILDPATH)/bin/inspircd $(BINPATH)
-@IFNDEF PURE_STATIC
+@IFNDEF INSPIRCD_STATIC
        [ $(BUILDPATH)/modules/ -ef $(MODPATH) ] || $(INSTALL) -m $(INSTMODE_LIB) $(BUILDPATH)/modules/*.so $(MODPATH)
 @ENDIF
        -$(INSTALL) -m $(INSTMODE_BIN) @CONFIGURE_DIRECTORY@/inspircd $(BASE) 2>/dev/null
@@ -301,11 +301,11 @@ help:
        @echo 'Use: ${MAKE} [flags] [targets]'
        @echo ''
        @echo 'Flags:'
-       @echo ' V=1       Show the full command being executed instead of "BUILD: dns.cpp"'
-       @echo ' D=1       Enable debug build, for module development or crash tracing'
-       @echo ' D=2       Enable debug build with optimizations, for detailed backtraces'
-       @echo ' DESTDIR=  Specify a destination root directory (for tarball creation)'
-       @echo ' -j <N>    Run a parallel build using N jobs'
+       @echo ' INSPIRCD_VERBOSE=1  Show the full command being executed instead of "BUILD: dns.cpp"'
+       @echo ' INSPIRCD_DEBUG=1    Enable debug build, for module development or crash tracing'
+       @echo ' INSPIRCD_DEBUG=2    Enable debug build with optimizations, for detailed backtraces'
+       @echo ' DESTDIR=            Specify a destination root directory (for tarball creation)'
+       @echo ' -j <N>              Run a parallel build using N jobs'
        @echo ''
        @echo 'Targets:'
        @echo ' all       Complete build of InspIRCd, without installing (default)'
@@ -313,10 +313,10 @@ help:
        @echo '           Currently installs to ${BASE}'
        @echo ' debug     Compile a debug build. Equivalent to "make D=1 all"'
        @echo ''
-       @echo ' M=m_foo   Builds a single module (cmd_foo also works here)'
-       @echo ' T=target  Builds a user-specified target, such as "inspircd" or "modules"'
-       @echo '           Other targets are specified by their path in the build directory'
-       @echo '           Multiple targets may be separated by a space'
+       @echo ' INSPIRCD_MODULE=m_foo   Builds a single module (core_foo also works here)'
+       @echo ' INSPIRCD_TARGET=target  Builds a user-specified target, such as "inspircd" or "modules"'
+       @echo '                         Other targets are specified by their path in the build directory'
+       @echo '                         Multiple targets may be separated by a space'
        @echo ''
        @echo ' clean     Cleans object files produced by the compile'
        @echo ' distclean Cleans all generated files (build, configure, run, etc)'
index 5f02d071f402a4389afd66b69119167321da8de5..ef1ee7dbe53abf2afb090e435cc1f49b2c2f97a5 100644 (file)
@@ -64,7 +64,7 @@ CmdResult CommandModules::Handle (const std::vector<std::string>& parameters, Us
                                if (!(V.Flags & mult))
                                        flags[pos] = '-';
 
-#ifdef PURE_STATIC
+#ifdef INSPIRCD_STATIC
                        user->WriteRemoteNumeric(702, InspIRCd::Format("%s %s :%s", m->ModuleSourceFile.c_str(), flags.c_str(), V.description.c_str()));
 #else
                        std::string srcrev = m->ModuleDLLManager->GetVersion();
index 9a687ad2bf1af38002134ff30aefc3f288ff6603..9e940cc3253a615c550b223b5cefc576426884a5 100644 (file)
@@ -25,7 +25,7 @@
 #include <dirent.h>
 #endif
 
-#ifndef PURE_STATIC
+#ifndef INSPIRCD_STATIC
 
 bool ModuleManager::Load(const std::string& modname, bool defer)
 {
index 98ed26c672c1fe787512e912aa13ba455b400d2a..5c04a76800f6e211afbfea316c0ca4ea11cd45f4 100644 (file)
@@ -23,7 +23,7 @@
 #include "exitcodes.h"
 #include <iostream>
 
-#ifdef PURE_STATIC
+#ifdef INSPIRCD_STATIC
 
 typedef std::map<std::string, AllModuleList*> modmap;
 static std::vector<AllCommandList::fn>* cmdlist = NULL;
index b0eb255c02c744b4e8a95627aa72d4079ae670b2..629e537c4917dcad43beaec921f34241dc3e7f0e 100755 (executable)
@@ -33,7 +33,7 @@ use warnings FATAL => qw(all);
 use make::common;
 use make::configure;
 
-$ENV{D} = $ENV{V} = 1;
+$ENV{INSPIRCD_DEBUG} = $ENV{INSPIRCD_VERBOSE} = 1;
 
 system 'git', 'clean', '-dfx';
 
@@ -56,12 +56,12 @@ foreach my $compiler (@compilers) {
                        say "Failed to configure using the $compiler compiler and the $socketengine socket engine!";
                        exit 1;
                }
-               $ENV{PURE_STATIC} = 1;
+               $ENV{INSPIRCD_STATIC} = 1;
                if (system 'make', '-j'.get_cpu_count, 'install') {
                        say "Failed to compile with static modules using the $compiler compiler and the $socketengine socket engine!";
                        exit 1;
                }
-               delete $ENV{PURE_STATIC};
+               delete $ENV{INSPIRCD_STATIC};
                if (system 'make', '-j'.get_cpu_count, 'install') {
                        say "Failed to compile with dynamic modules using the $compiler compiler and the $socketengine socket engine!";
                        exit 1;