summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2023-09-04 01:40:55 +0000
committermidipix <writeonce@midipix.org>2023-09-04 01:40:55 +0000
commit8a57c043b684c2e2e9cd3bbb0c1f5707ce65f182 (patch)
tree6a6c06327d4c632cb83f92bbd410d0f72f65d54e
parenta126a7f68ef374d65d014226195380eb7dceb634 (diff)
downloadslibtool-8a57c043b684c2e2e9cd3bbb0c1f5707ce65f182.tar.bz2
slibtool-8a57c043b684c2e2e9cd3bbb0c1f5707ce65f182.tar.xz
project: added cfgdefs.sh (custom config steps), explicitly test for sys/syscall.h.
-rw-r--r--config.project2
-rw-r--r--project/config/cfgdefs.in0
-rw-r--r--project/config/cfgdefs.sh69
3 files changed, 70 insertions, 1 deletions
diff --git a/config.project b/config.project
index c8b6eef..536a088 100644
--- a/config.project
+++ b/config.project
@@ -13,7 +13,7 @@ mb_disable_static=yes
mb_disable_shared=yes
# custom config step
-mb_use_custom_cfgdefs=no
+mb_use_custom_cfgdefs=yes
mb_use_custom_cfginit=no
mb_use_custom_cfgfini=yes
mb_use_custom_cfgtest=no
diff --git a/project/config/cfgdefs.in b/project/config/cfgdefs.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/config/cfgdefs.in
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
new file mode 100644
index 0000000..d82be48
--- /dev/null
+++ b/project/config/cfgdefs.sh
@@ -0,0 +1,69 @@
+# in projects where [ $mb_use_custom_cfgdefs = yes ],
+# cfgdefs.sh is invoked from within ./configure via
+# . $mb_project_dir/project/cfgdefs.sh
+
+# a successful return from cfgdefs.sh will be followed
+# by a second invocation of the config_copy() function,
+# reflecting any changes to common config variables
+# made by cfgdefs.sh.
+
+# finally, cfgdefs.sh may update the contents of the
+# config-time generated cfgdefs.mk.
+
+
+# sofort's config test framework
+. "$mb_project_dir/sofort/cfgtest/cfgtest.sh"
+
+
+for arg ; do
+ case "$arg" in
+ *)
+ error_msg ${arg#}: "unsupported config argument."
+ exit 2
+ esac
+done
+
+
+cfgdefs_output_custom_defs()
+{
+ cat "$mb_project_dir/project/config/cfgdefs.in" > cfgdefs.mk
+}
+
+
+cfgdefs_perform_common_tests()
+{
+ # headers
+ cfgtest_header_presence 'sys/syscall.h'
+}
+
+
+cfgdefs_perform_target_tests()
+{
+ # init
+ cfgtest_newline
+ cfgtest_host_section
+
+ # common tests
+ cfgdefs_perform_common_tests
+
+ # pretty cfgdefs.mk
+ cfgtest_newline
+}
+
+# cfgdefs.in --> cfgdefs.mk
+cfgdefs_output_custom_defs
+
+# strict: some tests might fail
+set +e
+
+# strict: some tests might fail
+set +e
+
+# target-specific tests
+cfgdefs_perform_target_tests
+
+# strict: restore mode
+set -e
+
+# all done
+return 0