From 7cb47de12ac18e348c5a5c57363757fa7c63da1c Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Thu, 28 Feb 2019 11:37:23 +0000 Subject: [PATCH] query_config: Move to programs/test As the SSL programs, like ssl_client2 and ssl_server2, are dependent on SSL and therefore about to be removed, the only consumer of query_config is the query_compile_time_config test. As such, it makes sense to move query_config to be next to what uses it. --- programs/Makefile | 12 ++++++------ programs/ssl/CMakeLists.txt | 4 ++-- programs/test/CMakeLists.txt | 2 +- programs/{ssl => test}/query_config.c | 0 scripts/bump_version.sh | 2 +- scripts/generate_query_config.pl | 2 +- scripts/generate_visualc_files.pl | 2 +- tests/scripts/check-generated-files.sh | 2 +- visualc/VS2010/query_compile_time_config.vcxproj | 2 +- visualc/VS2010/ssl_client2.vcxproj | 2 +- visualc/VS2010/ssl_server2.vcxproj | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) rename programs/{ssl => test}/query_config.c (100%) diff --git a/programs/Makefile b/programs/Makefile index 99c83ce1c..d004e2e06 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -253,17 +253,17 @@ ssl/ssl_client1$(EXEXT): ssl/ssl_client1.c $(DEP) echo " CC ssl/ssl_client1.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client1.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -ssl/ssl_client2$(EXEXT): ssl/ssl_client2.c ssl/query_config.c $(DEP) +ssl/ssl_client2$(EXEXT): ssl/ssl_client2.c test/query_config.c $(DEP) echo " CC ssl/ssl_client2.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client2.c ssl/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client2.c test/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ ssl/ssl_server$(EXEXT): ssl/ssl_server.c $(DEP) echo " CC ssl/ssl_server.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c ssl/query_config.c $(DEP) +ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c test/query_config.c $(DEP) echo " CC ssl/ssl_server2.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c ssl/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c test/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ ssl/ssl_fork_server$(EXEXT): ssl/ssl_fork_server.c $(DEP) echo " CC ssl/ssl_fork_server.c" @@ -301,9 +301,9 @@ test/zeroize$(EXEXT): test/zeroize.c $(DEP) echo " CC test/zeroize.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/zeroize.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -test/query_compile_time_config$(EXEXT): test/query_compile_time_config.c ssl/query_config.c $(DEP) +test/query_compile_time_config$(EXEXT): test/query_compile_time_config.c test/query_config.c $(DEP) echo " CC test/query_compile_time_config.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_compile_time_config.c ssl/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_compile_time_config.c test/query_config.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ util/pem2der$(EXEXT): util/pem2der.c $(DEP) echo " CC util/pem2der.c" diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt index 803920cde..f28a47d87 100644 --- a/programs/ssl/CMakeLists.txt +++ b/programs/ssl/CMakeLists.txt @@ -34,14 +34,14 @@ add_executable(ssl_client1 ssl_client1.c) target_link_libraries(ssl_client1 ${libs}) add_executable(ssl_client2 ssl_client2.c) -target_sources(ssl_client2 PUBLIC query_config.c) +target_sources(ssl_client2 PUBLIC ../test/query_config.c) target_link_libraries(ssl_client2 ${libs}) add_executable(ssl_server ssl_server.c) target_link_libraries(ssl_server ${libs}) add_executable(ssl_server2 ssl_server2.c) -target_sources(ssl_server2 PUBLIC query_config.c) +target_sources(ssl_server2 PUBLIC ../test/query_config.c) target_link_libraries(ssl_server2 ${libs}) add_executable(ssl_fork_server ssl_fork_server.c) diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 282ef58aa..64ed379e7 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -28,7 +28,7 @@ add_executable(zeroize zeroize.c) target_link_libraries(zeroize ${libs}) add_executable(query_compile_time_config query_compile_time_config.c) -target_sources(query_compile_time_config PUBLIC ../ssl/query_config.c) +target_sources(query_compile_time_config PUBLIC query_config.c) target_link_libraries(query_compile_time_config ${libs}) install(TARGETS selftest benchmark udp_proxy query_compile_time_config diff --git a/programs/ssl/query_config.c b/programs/test/query_config.c similarity index 100% rename from programs/ssl/query_config.c rename to programs/test/query_config.c diff --git a/scripts/bump_version.sh b/scripts/bump_version.sh index c39a86a5e..cf875c88d 100755 --- a/scripts/bump_version.sh +++ b/scripts/bump_version.sh @@ -132,7 +132,7 @@ done [ $VERBOSE ] && echo "Re-generating library/error.c" scripts/generate_errors.pl -[ $VERBOSE ] && echo "Re-generating programs/ssl/query_config.c" +[ $VERBOSE ] && echo "Re-generating programs/test/query_config.c" scripts/generate_query_config.pl [ $VERBOSE ] && echo "Re-generating library/version_features.c" diff --git a/scripts/generate_query_config.pl b/scripts/generate_query_config.pl index f15e03a35..d94fdad62 100755 --- a/scripts/generate_query_config.pl +++ b/scripts/generate_query_config.pl @@ -21,7 +21,7 @@ use strict; my $config_file = "./include/mbedtls/config.h"; my $query_config_format_file = "./scripts/data_files/query_config.fmt"; -my $query_config_file = "./programs/ssl/query_config.c"; +my $query_config_file = "./programs/test/query_config.c"; # Excluded macros from the generated query_config.c. For example, macros that # have commas or function-like macros cannot be transformed into strings easily diff --git a/scripts/generate_visualc_files.pl b/scripts/generate_visualc_files.pl index 90ab609d7..0342f8f8d 100755 --- a/scripts/generate_visualc_files.pl +++ b/scripts/generate_visualc_files.pl @@ -117,7 +117,7 @@ sub gen_app { my $srcs = "\n \r"; if( $appname eq "ssl_client2" or $appname eq "ssl_server2" or $appname eq "query_compile_time_config" ) { - $srcs .= "\n \r"; + $srcs .= "\n \r"; } my $content = $template; diff --git a/tests/scripts/check-generated-files.sh b/tests/scripts/check-generated-files.sh index 065ea33a2..f41e465c3 100755 --- a/tests/scripts/check-generated-files.sh +++ b/tests/scripts/check-generated-files.sh @@ -65,6 +65,6 @@ check() } check scripts/generate_errors.pl library/error.c -check scripts/generate_query_config.pl programs/ssl/query_config.c +check scripts/generate_query_config.pl programs/test/query_config.c check scripts/generate_features.pl library/version_features.c check scripts/generate_visualc_files.pl visualc/VS2010 diff --git a/visualc/VS2010/query_compile_time_config.vcxproj b/visualc/VS2010/query_compile_time_config.vcxproj index bb2f7ad19..112fea8d0 100644 --- a/visualc/VS2010/query_compile_time_config.vcxproj +++ b/visualc/VS2010/query_compile_time_config.vcxproj @@ -20,7 +20,7 @@ - + diff --git a/visualc/VS2010/ssl_client2.vcxproj b/visualc/VS2010/ssl_client2.vcxproj index dd922c047..f23f9a16b 100644 --- a/visualc/VS2010/ssl_client2.vcxproj +++ b/visualc/VS2010/ssl_client2.vcxproj @@ -20,7 +20,7 @@ - + diff --git a/visualc/VS2010/ssl_server2.vcxproj b/visualc/VS2010/ssl_server2.vcxproj index d4629bd41..df1ee2825 100644 --- a/visualc/VS2010/ssl_server2.vcxproj +++ b/visualc/VS2010/ssl_server2.vcxproj @@ -20,7 +20,7 @@ - +