moved checksum_builder/libchechsum to top srcdir to respect build order
authorMartin Willi <martin@strongswan.org>
Mon, 22 Jun 2009 10:47:09 +0000 (12:47 +0200)
committerMartin Willi <martin@strongswan.org>
Mon, 22 Jun 2009 13:47:18 +0000 (15:47 +0200)
configure.in
src/Makefile.am
src/checksum/.gitignore [new file with mode: 0644]
src/checksum/Makefile.am [new file with mode: 0644]
src/checksum/checksum_builder.c [new file with mode: 0644]
src/libstrongswan/Makefile.am
src/libstrongswan/checksum/.gitignore [deleted file]
src/libstrongswan/checksum/Makefile.am [deleted file]
src/libstrongswan/checksum/checksum_builder.c [deleted file]

index 4388bc4..b5f71b0 100644 (file)
@@ -1253,7 +1253,6 @@ AC_OUTPUT(
        src/Makefile
        src/include/Makefile
        src/libstrongswan/Makefile
-       src/libstrongswan/checksum/Makefile
        src/libstrongswan/plugins/aes/Makefile
        src/libstrongswan/plugins/des/Makefile
        src/libstrongswan/plugins/blowfish/Makefile
@@ -1318,6 +1317,7 @@ AC_OUTPUT(
        src/libfast/Makefile
        src/manager/Makefile
        src/medsrv/Makefile
+       src/checksum/Makefile
        scripts/Makefile
        testing/Makefile
 )
index 09eb13f..150a58a 100644 (file)
@@ -44,6 +44,10 @@ if USE_MEDSRV
   SUBDIRS += medsrv
 endif
 
+if USE_INTEGRITY_TEST
+  SUBDIRS += checksum
+endif
+
 EXTRA_DIST = strongswan.conf
 
 install-exec-local :   
diff --git a/src/checksum/.gitignore b/src/checksum/.gitignore
new file mode 100644 (file)
index 0000000..9956b9d
--- /dev/null
@@ -0,0 +1,2 @@
+checksum.c
+checksum_builder
diff --git a/src/checksum/Makefile.am b/src/checksum/Makefile.am
new file mode 100644 (file)
index 0000000..aaed128
--- /dev/null
@@ -0,0 +1,17 @@
+ipsec_LTLIBRARIES = libchecksum.la
+noinst_PROGRAMS = checksum_builder
+
+libchecksum_la_SOURCES = checksum.c
+
+checksum_builder_SOURCES = checksum_builder.c
+checksum_builder_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+
+BUILT_SOURCES = checksum.c
+CLEANFILES = checksum.c checksum_builder
+INCLUDES = -I$(top_srcdir)/src/libstrongswan
+AM_CFLAGS = -rdynamic
+
+libs = $(shell find $(top_builddir)/src -name 'libstrongswan*.so')
+
+checksum.c : checksum_builder $(libs)
+               ./checksum_builder $(libs) > checksum.c
diff --git a/src/checksum/checksum_builder.c b/src/checksum/checksum_builder.c
new file mode 100644 (file)
index 0000000..b917e11
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2009 Martin Willi
+ * Hochschule fuer Technik Rapperswil, Switzerland
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <dlfcn.h>
+
+#include <library.h>
+
+/* we need to fake some charon symbols to dlopen() its plugins */
+void *eap_type_names, *auth_class_names, *charon, *protocol_id_names, 
+*action_names, *ipsec_mode_names, *ike_sa_state_names, *child_sa_state_names,
+*proposal_create_default, *peer_cfg_create, *ike_cfg_create, *child_cfg_create,
+*traffic_selector_create_dynamic, *callback_job_create, *delete_ike_sa_job_create,
+*eap_type_from_string, *auth_cfg_create, *proposal_create_from_string,
+*traffic_selector_create_from_subnet, *traffic_selector_create_from_bytes,
+*eap_payload_create_data, *ike_sa_create, *child_sa_create, *policy_dir_names,
+*controller_cb_empty, *proposal_create, *ipcomp_transform_names,
+*traffic_selector_create_from_string, *update_sa_job_create, *ike_sa_id_create,
+*rekey_child_sa_job_create, *roam_job_create, *migrate_job_create,
+*acquire_job_create, *delete_child_sa_job_create, *debug_names;
+
+int main(int argc, char* argv[])
+{
+       int i;
+       integrity_checker_t *integrity;
+       
+       /* avoid confusing leak reports in build process */
+       setenv("LEAK_DETECTIVE_DISABLE", "1", 0);
+       library_init(NULL);
+       atexit(library_deinit);
+       
+       integrity = integrity_checker_create(NULL);
+       
+       printf("/**\n");
+       printf(" * checksums of files and loaded code segments.\n");
+       printf(" * created by %s\n", argv[0]);
+       printf(" */\n");
+       printf("\n");
+       printf("#include <library.h>\n");
+       printf("\n");
+       printf("integrity_checksum_t checksums[] = {\n");
+       for (i = 1; i < argc; i++)
+       {
+               char *name, *path, *sname;
+               void *handle, *symbol;
+               u_int32_t fsum, ssum;
+               
+               path = argv[i];
+               
+               if ((name = strstr(path, "libstrongswan-")))
+               {
+                       name = strdup(name + strlen("libstrongswan-"));
+                       name[strlen(name) - 3] = '"';
+                       name[strlen(name) - 2] = ',';
+                       name[strlen(name) - 1] = '\0';
+                       sname = "plugin_create";
+               }
+               else if (strstr(path, "libstrongswan.so"))
+               {
+                       name = strdup("libstrongswan\",");
+                       sname = "library_init";
+               }
+               else
+               {
+                       fprintf(stderr, "don't know how to handle '%s', ignored", path);
+                       continue;
+               }
+               
+               fsum = integrity->build_file(integrity, path);
+               ssum = 0;
+               handle = dlopen(path, RTLD_LAZY);
+               if (handle)
+               {
+                       symbol = dlsym(handle, sname);
+                       if (symbol)
+                       {
+                               ssum = integrity->build_segment(integrity, symbol);
+                       }
+                       else
+                       {
+                               fprintf(stderr, "symbol lookup failed: %s\n", dlerror());
+                       }
+                       dlclose(handle);
+               }
+               else
+               {
+                       fprintf(stderr, "dlopen failed: %s\n", dlerror());
+               }
+               
+               printf("\t{\"%-20s0x%08x, 0x%08x},\n", name, fsum, ssum);
+               free(name);
+       }
+       printf("};\n");
+       printf("\n");
+       printf("int checksum_count = countof(checksums);\n");
+       printf("\n");
+       integrity->destroy(integrity);
+       
+       exit(0);
+}
+
index 7f27b8b..096ef3b 100644 (file)
@@ -197,7 +197,3 @@ endif
 if USE_TEST_VECTORS
   SUBDIRS += plugins/test_vectors
 endif
-
-if USE_INTEGRITY_TEST
-  SUBDIRS += checksum
-endif
diff --git a/src/libstrongswan/checksum/.gitignore b/src/libstrongswan/checksum/.gitignore
deleted file mode 100644 (file)
index 9956b9d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-checksum.c
-checksum_builder
diff --git a/src/libstrongswan/checksum/Makefile.am b/src/libstrongswan/checksum/Makefile.am
deleted file mode 100644 (file)
index aaed128..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-ipsec_LTLIBRARIES = libchecksum.la
-noinst_PROGRAMS = checksum_builder
-
-libchecksum_la_SOURCES = checksum.c
-
-checksum_builder_SOURCES = checksum_builder.c
-checksum_builder_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
-
-BUILT_SOURCES = checksum.c
-CLEANFILES = checksum.c checksum_builder
-INCLUDES = -I$(top_srcdir)/src/libstrongswan
-AM_CFLAGS = -rdynamic
-
-libs = $(shell find $(top_builddir)/src -name 'libstrongswan*.so')
-
-checksum.c : checksum_builder $(libs)
-               ./checksum_builder $(libs) > checksum.c
diff --git a/src/libstrongswan/checksum/checksum_builder.c b/src/libstrongswan/checksum/checksum_builder.c
deleted file mode 100644 (file)
index b917e11..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2009 Martin Willi
- * Hochschule fuer Technik Rapperswil, Switzerland
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <dlfcn.h>
-
-#include <library.h>
-
-/* we need to fake some charon symbols to dlopen() its plugins */
-void *eap_type_names, *auth_class_names, *charon, *protocol_id_names, 
-*action_names, *ipsec_mode_names, *ike_sa_state_names, *child_sa_state_names,
-*proposal_create_default, *peer_cfg_create, *ike_cfg_create, *child_cfg_create,
-*traffic_selector_create_dynamic, *callback_job_create, *delete_ike_sa_job_create,
-*eap_type_from_string, *auth_cfg_create, *proposal_create_from_string,
-*traffic_selector_create_from_subnet, *traffic_selector_create_from_bytes,
-*eap_payload_create_data, *ike_sa_create, *child_sa_create, *policy_dir_names,
-*controller_cb_empty, *proposal_create, *ipcomp_transform_names,
-*traffic_selector_create_from_string, *update_sa_job_create, *ike_sa_id_create,
-*rekey_child_sa_job_create, *roam_job_create, *migrate_job_create,
-*acquire_job_create, *delete_child_sa_job_create, *debug_names;
-
-int main(int argc, char* argv[])
-{
-       int i;
-       integrity_checker_t *integrity;
-       
-       /* avoid confusing leak reports in build process */
-       setenv("LEAK_DETECTIVE_DISABLE", "1", 0);
-       library_init(NULL);
-       atexit(library_deinit);
-       
-       integrity = integrity_checker_create(NULL);
-       
-       printf("/**\n");
-       printf(" * checksums of files and loaded code segments.\n");
-       printf(" * created by %s\n", argv[0]);
-       printf(" */\n");
-       printf("\n");
-       printf("#include <library.h>\n");
-       printf("\n");
-       printf("integrity_checksum_t checksums[] = {\n");
-       for (i = 1; i < argc; i++)
-       {
-               char *name, *path, *sname;
-               void *handle, *symbol;
-               u_int32_t fsum, ssum;
-               
-               path = argv[i];
-               
-               if ((name = strstr(path, "libstrongswan-")))
-               {
-                       name = strdup(name + strlen("libstrongswan-"));
-                       name[strlen(name) - 3] = '"';
-                       name[strlen(name) - 2] = ',';
-                       name[strlen(name) - 1] = '\0';
-                       sname = "plugin_create";
-               }
-               else if (strstr(path, "libstrongswan.so"))
-               {
-                       name = strdup("libstrongswan\",");
-                       sname = "library_init";
-               }
-               else
-               {
-                       fprintf(stderr, "don't know how to handle '%s', ignored", path);
-                       continue;
-               }
-               
-               fsum = integrity->build_file(integrity, path);
-               ssum = 0;
-               handle = dlopen(path, RTLD_LAZY);
-               if (handle)
-               {
-                       symbol = dlsym(handle, sname);
-                       if (symbol)
-                       {
-                               ssum = integrity->build_segment(integrity, symbol);
-                       }
-                       else
-                       {
-                               fprintf(stderr, "symbol lookup failed: %s\n", dlerror());
-                       }
-                       dlclose(handle);
-               }
-               else
-               {
-                       fprintf(stderr, "dlopen failed: %s\n", dlerror());
-               }
-               
-               printf("\t{\"%-20s0x%08x, 0x%08x},\n", name, fsum, ssum);
-               free(name);
-       }
-       printf("};\n");
-       printf("\n");
-       printf("int checksum_count = countof(checksums);\n");
-       printf("\n");
-       integrity->destroy(integrity);
-       
-       exit(0);
-}
-