summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-01-09 15:02:11 +0000
committerMartin Mares <mj@ucw.cz>1999-01-09 15:02:11 +0000
commit2f9bcf9713523f6fefecd143cc2aa2a8dda7f27f (patch)
tree3580ae083792f0e84fae328028cb59d2144769e6 /sysdep
parent6996f459c6d8e6205bbacd83e3656b47635f7d6d (diff)
First step of "autoconfization". Created a configure script which
guesses most system-dependent parameters and determines name of system configuration file (sysdep/cf/...) with the remaining ones. To compile BIRD, you now need to do: autoconf # Create configure from configure.in ./configure # Run configure script make # Compile everything Configuration files: sysdep/config.h Master config file sysdep/autoconf.h Parameters determined by configure script sysdep/cf/*.h Fixed system configuration we're unable to guess. Makefiles are still the original ones, but this will change soon.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/autoconf.h.in42
-rw-r--r--sysdep/config.h70
2 files changed, 65 insertions, 47 deletions
diff --git a/sysdep/autoconf.h.in b/sysdep/autoconf.h.in
new file mode 100644
index 00000000..a1ef2f84
--- /dev/null
+++ b/sysdep/autoconf.h.in
@@ -0,0 +1,42 @@
+/*
+ * This file contains all system parameters automatically
+ * discovered by the configure script.
+ */
+
+/* System configuration file */
+#define SYSCONF_INCLUDE ?
+
+/* Include debugging code */
+#undef DEBUGGING
+
+/* 8-bit integer type */
+#define INTEGER_8 ?
+
+/* 16-bit integer type */
+#define INTEGER_16 ?
+
+/* 32-bit integer type */
+#define INTEGER_32 ?
+
+/* CPU endianity */
+#undef CPU_LITTLE_ENDIAN
+#undef CPU_BIG_ENDIAN
+
+/* Usual alignment for structures */
+#define CPU_STRUCT_ALIGN 1
+
+/* Characteristics of time_t */
+#undef TIME_T_IS_64BIT
+#undef TIME_T_IS_SIGNED
+
+/* Protocols compiled in */
+#undef CONFIG_STATIC
+#undef CONFIG_RIP
+#undef CONFIG_BGP
+#undef CONFIG_OSPF
+
+/* We have <syslog.h> and syslog() */
+#undef HAVE_SYSLOG
+
+/* Path to configuration files */
+#define PATH_CONFIG_DIR ?
diff --git a/sysdep/config.h b/sysdep/config.h
index 90ab8bbc..6d8d1722 100644
--- a/sysdep/config.h
+++ b/sysdep/config.h
@@ -1,63 +1,39 @@
/*
- * This is a manually generated BIRD configuration file.
- * It will be replaced by something better when we come
- * with an automated configuration mechanism. [mj]
+ * This file contains all parameters dependent on the
+ * operating system and build-time configuration.
*/
#ifndef _BIRD_CONFIG_H_
#define _BIRD_CONFIG_H_
-/* System-dependent configuration */
+/* Include parameters determined by configure script */
+#include "sysdep/autoconf.h"
-#include "sysdep/cf/linux-20.h"
-
-/* Include debugging code */
-
-#define DEBUGGING
+/* Include OS configuration file as chosen in autoconf.h */
+#include SYSCONF_INCLUDE
/* Types */
-
-typedef signed char s8;
-typedef unsigned char u8;
-typedef short int s16;
-typedef unsigned short int u16;
-typedef int s32;
-typedef unsigned int u32;
-
+typedef signed INTEGER_8 s8;
+typedef unsigned INTEGER_8 u8;
+typedef INTEGER_16 s16;
+typedef unsigned INTEGER_16 u16;
+typedef INTEGER_32 s32;
+typedef unsigned INTEGER_32 u32;
typedef u8 byte;
typedef u16 word;
-/* Endianity */
-
-#define CPU_LITTLE_ENDIAN
-
-/* Required alignment for multi-byte accesses */
-
-#define CPU_NEEDS_ALIGN_WORD 1
-#define CPU_NEEDS_ALIGN_LONG 1
-
-/* Usual alignment for structures */
-
-#define CPU_STRUCT_ALIGN 4
-
-/* Timers */
-
-#undef TIME_T_IS_64BIT
-#define TIME_T_IS_SIGNED
-
-/* Protocol options */
-
-#define CONFIG_STATIC
-#define CONFIG_RIP
-#define CONFIG_BGP
-#define CONFIG_OSPF
-
-/* Autodetected system features */
-
-#define HAVE_SYSLOG
+/*
+ * Required alignment for multi-byte accesses. We currently don't
+ * test these values in configure script, because several CPU's
+ * have unaligned accesses emulated by OS and they are slower
+ * than a call to memcpy() which is, in fact, often compiled
+ * as load/store by GCC on machines which don't require alignment.
+ */
-/* Paths */
+#define CPU_NEEDS_ALIGN_WORD 2
+#define CPU_NEEDS_ALIGN_LONG 4
-#define PATH_CONFIG "bird.conf"
+/* Path to configuration file */
+#define PATH_CONFIG PATH_CONFIG_DIR "/bird.conf"
#endif