]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
generate gcry rules from import_gcry
authorBVK Chaitanya <bvk@dbook>
Fri, 20 Aug 2010 12:51:31 +0000 (18:21 +0530)
committerBVK Chaitanya <bvk@dbook>
Fri, 20 Aug 2010 12:51:31 +0000 (18:21 +0530)
.bzrignore
Makefile.am
Makefile.util.def [moved from modules.def with 100% similarity]
autogen.sh
conf/Makefile.common
gentpl.py
grub-core/Makefile.am
grub-core/Makefile.core.def [moved from grub-core/modules.def with 90% similarity]
util/import_gcry.py

index 1672efd658f61391b3522f6757221b88b1ed7f21..3c7150afbb3092068e9ff2dc1e528eb56070c206 100644 (file)
@@ -19,7 +19,6 @@ config.status
 config.sub
 configure
 conf/*.mk
-conf/gcry.rmk
 *.d
 DISTLIST
 docs/*.info
@@ -80,7 +79,6 @@ trigtables.c
 update-grub_lib
 unidata.c
 Makefile.in
-modules.am
 GPATH
 GRTAGS
 GSYMS
@@ -93,3 +91,7 @@ texinfo.tex
 grub-core/lib/libgcrypt-grub
 **/.deps-util
 **/.deps-core
+Makefile.util.am
+grub-core/Makefile.core.am
+grub-core/Makefile.gcry.am
+grub-core/Makefile.gcry.def
index ed482eea298de4665e5d5026fb2f3468d42ed217..b0d374b7540b0de0f4f9b7c0737f0de823c148ef 100644 (file)
@@ -16,7 +16,7 @@ LDFLAGS_PROGRAM += $(LDFLAGS_GNULIB)
 CPPFLAGS_PROGRAM += $(CPPFLAGS_GNULIB)
 CCASFLAGS_PROGRAM += $(CCASFLAGS_GNULIB)
 
-include $(srcdir)/modules.am
+include $(srcdir)/Makefile.util.am
 
 # XXX Use Automake's LEX & YACC support
 grub_script.tab.h: $(top_srcdir)/grub-core/script/parser.y
@@ -82,3 +82,4 @@ CLEANFILES += widthspec.h
 
 # Install config.h into platformdir
 platform_HEADERS = config.h
+
similarity index 100%
rename from modules.def
rename to Makefile.util.def
index 60139cfb33f6d93b1169f49e84b79d8761d2ccc1..31a269e0f5b78ad069c97e04491acc7824421817 100755 (executable)
@@ -4,19 +4,20 @@ set -e
 
 autogen --version >/dev/null || (echo autogen missing; exit 1)
 
-echo "Creating Makefile.tpl..."
-python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
-
-echo "Running autogen..."
-autogen -T Makefile.tpl modules.def | sed -e '/^$/{N;/^\n$/D;}' > modules.am
-autogen -T Makefile.tpl grub-core/modules.def | sed -e '/^$/{N;/^\n$/D;}' > grub-core/modules.am
-
 echo "Importing unicode..."
 python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
 
 echo "Importing libgcrypt..."
 python util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
 
+echo "Creating Makefile.tpl..."
+python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
+
+echo "Running autogen..."
+autogen -T Makefile.tpl Makefile.util.def | sed -e '/^$/{N;/^\n$/D;}' > Makefile.util.am
+autogen -T Makefile.tpl grub-core/Makefile.core.def | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.core.am
+autogen -T Makefile.tpl grub-core/Makefile.gcry.def | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.gcry.am
+
 echo "Saving timestamps..."
 echo timestamp > stamp-h.in
 
index 47067596b34073bbdc0f580b6f8e935d2d724aca..3bb8b9c0e1132c085bb130bc4fca55b33887312f 100644 (file)
@@ -1,3 +1,5 @@
+# -*- makefile -*-
+
 # Platform specific options
 if COND_i386_pc
   CFLAGS_PLATFORM = -mrtd -mregparm=3
@@ -117,3 +119,25 @@ TESTS =
 EXTRA_DIST =
 CLEANFILES =
 BUILT_SOURCES =
+
+# Rules for autogen definition files
+
+.PRECIOUS: $(top_srcdir)/Makefile.tpl
+$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
+       python $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
+       mv $@.new $@
+
+.PRECIOUS: $(top_srcdir)/Makefile.util.am
+$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.tpl
+       autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
+       mv $@.new $@
+
+.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
+$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/Makefile.tpl
+       autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
+       mv $@.new $@
+
+.PRECIOUS: $(top_srcdir)/grub-core/Makefile.gcry.am
+$(top_srcdir)/grub-core/Makefile.gcry.am: $(top_srcdir)/grub-core/Makefile.gcry.def $(top_srcdir)/Makefile.tpl
+       autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
+       mv $@.new $@
index 632b4c13ec348e6ff0acf404b671171ca440f11b..59950bb0e2204c69e689f75bf40ae82c2956e0c7 100644 (file)
--- a/gentpl.py
+++ b/gentpl.py
@@ -448,14 +448,3 @@ print d
 print e
 print f
 print g
-
-print """.PRECIOUS: modules.am
-$(srcdir)/modules.am: $(srcdir)/modules.def $(top_srcdir)/Makefile.tpl
-       autogen -T $(top_srcdir)/Makefile.tpl $(srcdir)/modules.def | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
-       mv $@.new $@
-
-.PRECIOUS: $(top_srcdir)/Makefile.tpl
-$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
-       python $(top_srcdir)/gentpl.py | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
-       mv $@.new $@
-"""
index d91448149716adddab94d71d5b93de54454caff2..770f1a6bb5027426f6ca12d1a081c1a706da4754 100644 (file)
@@ -45,7 +45,8 @@ grub_script.yy.h: script/yylex.l
 grub_script.yy.c: grub_script.yy.h
 CLEANFILES += grub_script.yy.c grub_script.yy.h
 
-include $(srcdir)/modules.am
+include $(srcdir)/Makefile.core.am
+include $(srcdir)/Makefile.gcry.am
 
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cache.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h
similarity index 90%
rename from grub-core/modules.def
rename to grub-core/Makefile.core.def
index fa830e779930dff4867286523b49f7ddcadfcb10..73caf0771b783b3ff60a5fe7a9b41af2e57570fb 100644 (file)
@@ -1049,140 +1049,6 @@ module = {
   extra_dist = lib/libgcrypt-grub/cipher/crypto.lst;
 };
 
-module = {
-  name = gcry_arcfour;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/arcfour.c;
-};
-
-module = {
-  name = gcry_blowfish;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/blowfish.c;
-};
-
-module = {
-  name = gcry_camellia;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/camellia.c;
-  source = lib/libgcrypt-grub/cipher/camellia-glue.c;
-};
-
-module = {
-  name = gcry_cast5;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/cast5.c;
-};
-
-module = {
-  name = gcry_crc;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/crc.c;
-};
-
-module = {
-  name = gcry_des;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/des.c;
-};
-
-module = {
-  name = gcry_md4;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/md4.c;
-};
-
-module = {
-  name = gcry_md5;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/md5.c;
-};
-
-module = {
-  name = gcry_rfc2268;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/rfc2268.c;
-};
-
-module = {
-  name = gcry_rijndael;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/rijndael.c;
-};
-
-module = {
-  name = gcry_rmd160;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/rmd160.c;
-};
-
-module = {
-  name = gcry_seed;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/seed.c;
-};
-
-module = {
-  name = gcry_serpent;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/serpent.c;
-};
-
-module = {
-  name = gcry_sha1;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/sha1.c;
-};
-
-module = {
-  name = gcry_sha256;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/sha256.c;
-};
-
-module = {
-  name = gcry_sha512;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/sha512.c;
-};
-
-module = {
-  name = gcry_tiger;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/tiger.c;
-};
-
-module = {
-  name = gcry_twofish;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/twofish.c;
-};
-
-module = {
-  name = gcry_whirlpool;
-  cflags = '$(CFLAGS_GCRY)';
-  cppflags = '$(CPPFLAGS_GCRY)';
-  source = lib/libgcrypt-grub/cipher/whirlpool.c;
-};
-
 module = {
   name = pbkdf2;
   source = lib/pbkdf2.c;
index b63fb550132a80c5a06d94e40e6efd8a50b76760..6280f001e48bdf6d724ab08186142278fa257d23 100644 (file)
@@ -40,8 +40,8 @@ except:
     print ("WARNING: %s already exists" % cipher_dir_out)
 
 cipher_files = os.listdir (cipher_dir_in)
-conf = open (os.path.join ("conf", "gcry.rmk"), "w")
-conf.write ("# -*- makefile -*-\n\n")
+conf = open (os.path.join ("grub-core", "Makefile.gcry.def"), "w")
+conf.write ("AutoGen definitions Makefile.tpl;\n\n")
 chlog = ""
 
 # Strictly speaking CRC32/CRC24 work on bytes so this value should be 1
@@ -62,7 +62,6 @@ mdblocksizes = {"_gcry_digest_spec_crc32" : 64,
                 "_gcry_digest_spec_whirlpool" : 64}
 
 cryptolist = open (os.path.join (cipher_dir_out, "crypto.lst"), "w")
-conf.write ("MAINTAINER_CLEANFILES += $(srcdir)/conf/gcry.rmk $(srcdir)/lib/libgcrypt-grub/cipher/ChangeLog $(srcdir)/lib/libgcrypt-grub/cipher/cipher.h $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst $(srcdir)/lib/libgcrypt-grub/cipher/g10lib.h $(srcdir)/lib/libgcrypt-grub/cipher/memory.h $(srcdir)/lib/libgcrypt-grub/cipher/types.h\n");
 
 # rijndael is the only cipher using aliases. So no need for mangling, just
 # hardcode it
@@ -88,7 +87,6 @@ for cipher_file in cipher_files:
         continue
     nch = False
     if re.match (".*\.[ch]$", cipher_file):
-        conf.write ("MAINTAINER_CLEANFILES += $(srcdir)/lib/libgcrypt-grub/cipher/" + cipher_file + "\n");
         isc = re.match (".*\.c$", cipher_file)
         f = open (infile, "r")
         fw = open (outfile, "w")
@@ -276,11 +274,13 @@ for cipher_file in cipher_files:
                 chlognew = "%s\n       %s" % (chlognew, chmsg)
                 fw.write ("  grub_md_unregister (&%s);\n" % mdname)
             fw.write ("}\n")
-            conf.write ("pkglib_MODULES += %s.mod\n" % modname)
-            conf.write ("%s_mod_SOURCES = %s\n" %\
-                            (modname, modfiles))
-            conf.write ("%s_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-missing-field-initializers -Wno-error -I$(srcdir)/lib/libgcrypt_wrap\n" % modname)
-            conf.write ("%s_mod_LDFLAGS = $(COMMON_LDFLAGS)\n\n" % modname)
+            conf.write ("module = {\n")
+            conf.write ("  name = %s;\n" % modname)
+            for src in modfiles.split():
+                conf.write ("  source = %s;\n" % src)
+            conf.write ("  cflags = '$(CFLAGS_GCRY)';\n");
+            conf.write ("  cppflags = '$(CPPFLAGS_GCRY)';\n");
+            conf.write ("};\n\n")
         elif isc and cipher_file != "camellia.c":
             print ("WARNING: C file isn't a module: %s" % cipher_file)
         f.close ()