Permalink
Browse files

Merge inspircd_{config,version}.h into a single header file.

  • Loading branch information...
1 parent bb3aa2f commit 362f3009ac9a8fc7e1cedea66aa72abcdf52d934 @SaberUK SaberUK committed Apr 5, 2013
View
@@ -11,8 +11,7 @@
/run
/bin
-/include/inspircd_config.h
-/include/inspircd_version.h
+/include/config.h
/src/modules/m_geoip.cpp
/src/modules/m_ldapauth.cpp
View
@@ -861,7 +861,7 @@ my ($mliflags, $mfrules, $mobjs, $mfcount) = ("", "", "", 0);
sub writefiles {
my($writeheader) = @_;
- # First File.. inspircd_config.h
+ # First File.. config.h
chomp(my $incos = `uname -n -s -r`);
chomp(my $version = `sh src/version.sh`);
chomp(my $revision2 = getrevision());
@@ -872,16 +872,17 @@ sub writefiles {
}
if ($writeheader == 1)
{
- print "Writing \e[1;32minspircd_config.h\e[0m\n";
- open(FILEHANDLE, ">include/inspircd_config.h.tmp");
+ print "Writing \e[1;32mconfig.h\e[0m\n";
+ open(FILEHANDLE, ">include/config.h.tmp");
print FILEHANDLE <<EOF;
/* Auto generated by configure, do not modify! */
#ifndef __CONFIGURATION_AUTO__
#define __CONFIGURATION_AUTO__
-/* this is for windows support. */
-#define CoreExport /**/
-#define DllExport /**/
+#define BRANCH "$branch"
+#define VERSION "$version"
+#define REVISION "$revision2"
+#define SYSTEM "$incos"
#define CONFIG_PATH "$config{CONFIG_DIR}"
#define DATA_PATH "$config{DATA_DIR}"
@@ -947,38 +948,28 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n";
}
print FILEHANDLE "\n#include \"threadengines/threadengine_pthread.h\"\n\n#endif\n";
close(FILEHANDLE);
-
- open(FILEHANDLE, ">include/inspircd_version.h.tmp");
- print FILEHANDLE <<EOF;
-#define BRANCH "$branch"
-#define VERSION "$version"
-#define REVISION "$revision2"
-#define SYSTEM "$incos"
-EOF
- close FILEHANDLE;
-
- for my $file (qw(include/inspircd_config.h include/inspircd_version.h)) {
- my $diff = 0;
- open my $fh1, $file or $diff = 1;
- open my $fh2, $file.'.tmp' or die "Can't read $file.tmp that we just wrote: $!";
- while (!$diff) {
- my $line1 = <$fh1>;
- my $line2 = <$fh2>;
- if (defined($line1) != defined($line2)) {
- $diff = 1;
- } elsif (!defined $line1) {
- last;
- } else {
- $diff = ($line1 ne $line2);
- }
- }
- if ($diff) {
- unlink $file;
- rename "$file.tmp", $file;
+
+ my $file = 'include/config.h';
+ my $diff = 0;
+ open my $fh1, $file or $diff = 1;
+ open my $fh2, $file.'.tmp' or die "Can't read $file.tmp that we just wrote: $!";
+ while (!$diff) {
+ my $line1 = <$fh1>;
+ my $line2 = <$fh2>;
+ if (defined($line1) != defined($line2)) {
+ $diff = 1;
+ } elsif (!defined $line1) {
+ last;
} else {
- unlink "$file.tmp";
+ $diff = ($line1 ne $line2);
}
}
+ if ($diff) {
+ unlink $file;
+ rename "$file.tmp", $file;
+ } else {
+ unlink "$file.tmp";
+ }
}
# Write all .in files.
View
@@ -81,8 +81,7 @@
#include <bitset>
#include <set>
#include <time.h>
-#include "inspircd_config.h"
-#include "inspircd_version.h"
+#include "config.h"
#include "typedefs.h"
#include "consolecolors.h"
View
@@ -21,8 +21,8 @@
#ifndef INSPSTRING_H
#define INSPSTRING_H
-// This (inspircd_config) is needed as inspstring doesn't pull in the central header
-#include "inspircd_config.h"
+// This (config) is needed as inspstring doesn't pull in the central header
+#include "config.h"
#include <cstring>
//#include <cstddef>
View
@@ -26,7 +26,7 @@
#include <vector>
#include <string>
#include <map>
-#include "inspircd_config.h"
+#include "config.h"
#include "socket.h"
#include "base.h"
View
@@ -24,7 +24,7 @@
#include <vector>
#include <string>
#include <map>
-#include "inspircd_config.h"
+#include "config.h"
#include "base.h"
class ThreadData;
@@ -21,7 +21,7 @@
#ifndef THREADENGINE_WIN32_H
#define THREADENGINE_WIN32_H
-#include "inspircd_config.h"
+#include "config.h"
#include "base.h"
class Thread;
View
@@ -199,7 +199,7 @@ ($)
while (<$in>) {
if (/^\s*#\s*include\s*"([^"]+)"/) {
my $inc = $1;
- next if $inc eq 'inspircd_version.h' && $f eq '../include/inspircd.h';
+ next if $inc eq 'config.h' && $f eq '../include/inspircd.h';
my $found = 0;
for my $loc ("$basedir/$inc", "../include/$inc") {
next unless -e $loc;
View
@@ -276,8 +276,7 @@ configureclean:
rm -f .config.cache
rm -f BSDmakefile
rm -f GNUmakefile
- rm -f include/inspircd_config.h
- rm -f include/inspircd_version.h
+ rm -f include/config.h
rm -f inspircd
-rm -f org.inspircd.plist
View
@@ -28,7 +28,6 @@
/* $Core */
#include "inspircd.h"
-#include "inspircd_version.h"
#include <signal.h>
#ifndef _WIN32
View
@@ -23,7 +23,6 @@
#include <signal.h>
#include "exitcodes.h"
#include "inspircd.h"
-#include "inspircd_version.h"
void InspIRCd::SignalHandler(int signal)
{
@@ -20,17 +20,14 @@
*/
-#include "inspircd.h"
-#include "exitcodes.h"
-
#ifndef SOCKETENGINE_POLL
#define SOCKETENGINE_POLL
#include <iostream>
#include <vector>
#include <string>
#include <map>
-#include "inspircd_config.h"
+#include "config.h"
#include "inspircd.h"
#include "socketengine.h"
@@ -32,7 +32,6 @@
#include <vector>
#include <string>
#include <map>
-#include "inspircd_config.h"
#include "inspircd.h"
#include "socketengine.h"
#include <port.h>
@@ -18,8 +18,6 @@
*/
-#include "inspircd_config.h"
-
#include "inspircd.h"
#include "socketengine.h"
View
@@ -56,8 +56,7 @@ if(MSVC)
endif(MSVC)
configure_file("${INSPIRCD_BASE}/win/inspircd.rc.cmake" "${INSPIRCD_BASE}/win/inspircd.rc")
-configure_file("${INSPIRCD_BASE}/win/inspircd_version.h.cmake" "${INSPIRCD_BASE}/win/inspircd_version.h")
-configure_file("${INSPIRCD_BASE}/win/inspircd_config.h.cmake" "${INSPIRCD_BASE}/win/inspircd_config.h")
+configure_file("${INSPIRCD_BASE}/win/config.h.cmake" "${INSPIRCD_BASE}/win/config.h")
add_executable(inspircd ${INSPIRCD_SOURCES} "${INSPIRCD_BASE}/win/inspircd.rc")
target_link_libraries(inspircd win32_memory)
@@ -1,6 +1,11 @@
#ifndef INSPIRCD_CONFIG_H
#define INSPIRCD_CONFIG_H
+#define BRANCH "@MAJOR_VERSION@.@MINOR_VERSION@"
+#define VERSION "@FULL_VERSION@"
+#define REVISION "0"
+#define SYSTEM "@CMAKE_SYSTEM@"
+
#define CONFIG_PATH "@CONF_PATH@"
#define MOD_PATH "@MODULE_PATH@"
#define DATA_PATH "@DATA_PATH@"
@@ -1,4 +0,0 @@
-#define BRANCH "@MAJOR_VERSION@.@MINOR_VERSION@"
-#define VERSION "@FULL_VERSION@"
-#define REVISION "0"
-#define SYSTEM "@CMAKE_SYSTEM@"
View
@@ -17,7 +17,7 @@
*/
-#include "inspircd_config.h"
+#include "config.h"
#include "inspircd.h"
#include "exitcodes.h"
#include <windows.h>

0 comments on commit 362f300

Please sign in to comment.