Selaa lähdekoodia

* Removed conf.h
* configure now reads pack/pack.cfg and adds #defines to config.h


svn: 635

Bryan Drewery 22 vuotta sitten
vanhempi
commit
2455d8fa8a
9 muutettua tiedostoa jossa 60 lisäystä ja 15 poistoa
  1. 1 7
      Makefile.in
  2. 5 0
      autotools/Makefile
  3. 2 2
      autotools/configure.ac
  4. 11 0
      autotools/includes/pack.m4
  5. 22 0
      config.h.in
  6. 12 3
      configure
  7. 0 1
      src/eggmain.h
  8. 3 1
      src/makesettings.c
  9. 4 1
      src/stringfix.c

+ 1 - 7
Makefile.in

@@ -96,7 +96,7 @@ clean:  cleanutils
 distclean: clean clean-modconfig
 	@rm -f Makefile src/Makefile src/compat/Makefile src/mod/Makefile
 	@rm -f config.cache config.log config.status config.h lush.h stamp.*
-	@rm -rf *-$(VERSION)/ autom4te.cache/ autoscan.log configure.scan src/salt.h.tmp src/conf.h
+	@rm -rf *-$(VERSION)/ autom4te.cache/ autoscan.log configure.scan src/salt.h.tmp
 	@rm -rf src/.deps/ src/compat/.deps/ src/mod/*.mod/.deps/
 
 
@@ -132,12 +132,6 @@ packconf: makesettings pack/pack.cfg
 	@(if test "x`diff -qurN src/settings.c~ src/settings.c`" != "x"; then \
 	cp -f src/settings.c~ src/settings.c; \
 	fi)
-	@(if [ ! -f src/conf.h ]; then \
-	touch src/conf.h; \
-	fi)
-	@(if test "x`diff -qurN src/conf.h~ src/conf.h`" != "x"; then \
-	cp -f src/conf.h~ src/conf.h; \
-	fi)
 
 salt: packconf stringfix
 	@(if [ ! -f src/salt.h ]; then \

+ 5 - 0
autotools/Makefile

@@ -10,6 +10,11 @@ autoheader:
 	@rm -rf ../config.h.in
 	@echo "Autoheader..."
 	@autoheader
+	@echo "" >> config.h.in
+	@echo "/* Defines for pack features */" >> config.h.in
+	@(for define in `sed -n -e 's/^[\+|\-] \([^ ]*\) .*/\1/ p' ../pack/pack.cfg`; do \
+	echo "#undef S_$$define" >> config.h.in; \
+	done)
 	@mv -f config.h.in ../config.h.in
 	@ls -al ../config.h.in
 

+ 2 - 2
autotools/configure.ac

@@ -20,6 +20,8 @@ AC_AIX
 AC_ISC_POSIX
 AC_MINIX
 
+DO_PACK_CFG
+
 #checkpoint
 AC_CACHE_SAVE 
 
@@ -203,5 +205,3 @@ DO_DEPS
 
 AC_CONFIG_FILES([Makefile src/Makefile src/compat/Makefile src/mod/Makefile])
 AC_OUTPUT
-
-

+ 11 - 0
autotools/includes/pack.m4

@@ -0,0 +1,11 @@
+dnl  DO_PACK_CFG()
+dnl
+AC_DEFUN(DO_PACK_CFG, [dnl
+
+for define in `sed -n -e '[s/^+ \([^ ]*\) .*/\1/ p]' pack/pack.cfg`; do
+ u_define="S_$define"
+ AC_DEFINE_UNQUOTED($u_define)
+done
+
+])dnl
+

+ 22 - 0
config.h.in

@@ -365,3 +365,25 @@
 /* Define to empty if the keyword `volatile' does not work. Warning: valid
    code using `volatile' can become incorrect without. Disable with care. */
 #undef volatile
+
+/* Defines for pack features */
+#undef S_ANTITRACE
+#undef S_AUTH
+#undef S_AUTOAWAY
+#undef S_AUTOLOCK
+#undef S_DCCPASS
+#undef S_GARBLESTRINGS
+#undef S_HIJACKCHECK
+#undef S_LASTCHECK
+#undef S_MESSUPTERM
+#undef S_MSGCMDS
+#undef S_NAZIPASS
+#undef S_NODELAY
+#undef S_PROCESSCHECK
+#undef S_PROMISC
+#undef S_PSCLOAK
+#undef S_RANDSERVERS
+#undef S_SPLITHIJACK
+#undef S_TCLCMDS
+#undef S_TCLPERMONLY
+#undef S_UTCTIME

+ 12 - 3
configure

@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.5 .
+# From configure.ac Revision: 1.6 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59.
 #
@@ -3022,6 +3022,17 @@ _ACEOF
 fi
 
 
+
+for define in `sed -n -e 's/^+ \([^ ]*\) .*/\1/ p' pack/pack.cfg`; do
+ u_define="S_$define"
+ cat >>confdefs.h <<_ACEOF
+#define $u_define 1
+_ACEOF
+
+done
+
+
+
 #checkpoint
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -13679,5 +13690,3 @@ if test "$no_create" != yes; then
   $ac_cs_success || { (exit 1); exit 1; }
 fi
 
-
-

+ 0 - 1
src/eggmain.h

@@ -12,7 +12,6 @@
 #  include "config.h"
 #endif
 
-#include "conf.h"
 #include "garble.h"
 
 

+ 3 - 1
src/makesettings.c

@@ -350,6 +350,7 @@ int loadconfig(char **argv) {
     fclose(f);
     dosalt(salt1, salt2);
   }
+/* no longer needed, hooray configure 
   if (cfg.definesn && cfg.defines) {
     char *def;
     int i = 0;
@@ -360,10 +361,11 @@ int loadconfig(char **argv) {
       def = newsplit(&cfg.defines);
       fprintf(f, "#define S_%s\n", def);
     }
-    fprintf(f, "\n#endif /* _S_CONF_H */\n");
+    fprintf(f, "\n#endif \/* _S_CONF_H *\/\n");
     fflush(f);
     fclose(f);
   }
+*/
   printf(" Success\n");
   return 1;
 }

+ 4 - 1
src/stringfix.c

@@ -7,7 +7,10 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include "conf.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #define WTF 50720
 int help = 0;