summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile.in4
-rw-r--r--config.project2
-rw-r--r--config.usage6
-rwxr-xr-xconfigure28
-rw-r--r--project/defs.mk12
5 files changed, 47 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in
index bcd354b..db198d5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,6 +21,7 @@ CFLAGS_SYSROOT = @cflags_sysroot@
CFLAGS_OS = @cflags_os@
CFLAGS_SITE = @cflags_site@
CFLAGS_PATH = @cflags_path@
+CFLAGS_STRICT = @cflags_strict@
CFLAGS_UTIL = @cflags_util@
LDFLAGS_COMMON = @ldflags_common@
@@ -29,6 +30,7 @@ LDFLAGS_CMDLINE = @ldflags_cmdline@
LDFLAGS_CONFIG = @ldflags_config@
LDFLAGS_SYSROOT = @ldflags_sysroot@
LDFLAGS_PATH = @ldflags_path@
+LDFLAGS_STRICT = @ldflags_strict@
LDFLAGS_UTIL = @ldflags_util@
PE_SUBSYSTEM = @pe_subsystem@
@@ -292,6 +294,7 @@ clean: clean-implib
@echo CFLAGS_OS:' '$(CFLAGS_OS)
@echo CFLAGS_SITE:' '$(CFLAGS_SITE)
@echo CFLAGS_PATH:' '$(CFLAGS_PATH)
+ @echo CFLAGS_STRICT:' '$(CFLAGS_STRICT)
@echo CFLAGS_UTIL:' '$(CFLAGS_UTIL)
@echo
@echo LDFLAGS_COMMON:' '$(LDFLAGS_COMMON)
@@ -300,6 +303,7 @@ clean: clean-implib
@echo LDFLAGS_CONFIG:' '$(LDFLAGS_CONFIG)
@echo LDFLAGS_SYSROOT:' '$(LDFLAGS_SYSROOT)
@echo LDFLAGS_PATH:' '$(LDFLAGS_PATH)
+ @echo LDFLAGS_STRICT:' '$(LDFLAGS_STRICT)
@echo LDFLAGS_UTIL:' '$(LDFLAGS_UTIL)
@echo
diff --git a/config.project b/config.project
index 309970d..2006b80 100644
--- a/config.project
+++ b/config.project
@@ -26,6 +26,7 @@ mb_default_cflags_cmdline=
mb_default_cflags_config=
mb_default_cflags_sysroot=
mb_default_cflags_path=
+mb_default_cflags_strict=
mb_default_cflags_util=
mb_default_ldflags_common="-Llib"
@@ -34,6 +35,7 @@ mb_default_ldflags_cmdline=
mb_default_ldflags_config=
mb_default_ldflags_sysroot=
mb_default_ldflags_path=
+mb_default_ldflags_strict=
mb_default_ldflags_util=
mb_default_pe_subsystem=windows
diff --git a/config.usage b/config.usage
index 8eadb62..a3af209 100644
--- a/config.usage
+++ b/config.usage
@@ -26,6 +26,10 @@ supported switches:
--shell
--debug
+ --strict
+ --ccstrict
+ --ldstrict
+
--all-static
--all-shared
--enable-static
@@ -68,6 +72,7 @@ supported variables:
CFLAGS_CONFIG
CFLAGS_SYSROOT
CFLAGS_PATH
+ CFLAGS_STRICT
CFLAGS_UTIL
LDFLAGS
@@ -77,6 +82,7 @@ supported variables:
LDFLAGS_CONFIG
LDFLAGS_SYSROOT
LDFLAGS_PATH
+ LDFLAGS_STRICT
LDFLAGS_UTIL
PE_SUBSYSTEM
diff --git a/configure b/configure
index 63151a0..8a17f2e 100755
--- a/configure
+++ b/configure
@@ -68,6 +68,7 @@ init_vars()
mb_cflags_os=$CFLAGS_OS
mb_cflags_site=$CFLAGS_SITE
mb_cflags_path=$CFLAGS_PATH
+ mb_cflags_strict=$CFLAGS_STRICT
mb_cflags_util=$CFLAGS_UTIL
mb_ldflags=$LDFLAGS
@@ -77,6 +78,7 @@ init_vars()
mb_ldflags_config=$LDFLAGS_CONFIG
mb_ldflags_sysroot=$LDFLAGS_SYSROOT
mb_ldflags_path=$LDFLAGS_PATH
+ mb_ldflags_strict=$LDFLAGS_STRICT
mb_ldflags_util=$LDFLAGS_UTIL
mb_pe_subsystem=$PE_SUBSYSTEM
@@ -153,6 +155,7 @@ common_defaults()
[ -z "$mb_cflags_os" ] && mb_cflags_os=$mb_default_cflags_os
[ -z "$mb_cflags_site" ] && mb_cflags_site=$mb_default_cflags_site
[ -z "$mb_cflags_path" ] && mb_cflags_path=$mb_default_cflags_path
+ [ -z "$mb_cflags_strict" ] && mb_cflags_strict=$mb_default_cflags_strict
[ -z "$mb_cflags_util" ] && mb_cflags_util=$mb_default_cflags_util
[ -z "$mb_ldflags_debug" ] && mb_ldflags_debug=$mb_default_ldflags_debug
@@ -161,6 +164,7 @@ common_defaults()
[ -z "$mb_ldflags_config" ] && mb_ldflags_config=$mb_default_ldflags_config
[ -z "$mb_ldflags_sysroot" ] && mb_ldflags_sysroot=$mb_default_ldflags_sysroot
[ -z "$mb_ldflags_path" ] && mb_ldflags_path=$mb_default_ldflags_path
+ [ -z "$mb_ldflags_strict" ] && mb_ldflags_strict=$mb_default_ldflags_strict
[ -z "$mb_ldflags_util" ] && mb_ldflags_util=$mb_default_ldflags_util
[ -z "$mb_pe_subsystem" ] && mb_pe_subsystem=$mb_default_pe_subsystem
@@ -331,6 +335,16 @@ config_flags()
mb_ldflags="$mb_ldflags_libs"
mb_ldflags_util="$mb_ldflags_util -static"
fi
+
+ # ccstrict
+ if [ "$mb_ccstrict" = 'yes' ]; then
+ mb_cflags_strict='-Wall -Werror -Wextra -Wundef'
+ fi
+
+ # ldstrict
+ if [ "$mb_ldstrict" = 'yes' ]; then
+ mb_ldflags_strict='-Wl,--no-undefined'
+ fi
}
@@ -360,6 +374,7 @@ config_copy()
-e 's^@cflags_os@^'"$mb_cflags_os"'^g' \
-e 's^@cflags_site@^'"$mb_cflags_site"'^g' \
-e 's^@cflags_path@^'"$mb_cflags_path"'^g' \
+ -e 's^@cflags_strict@^'"$mb_cflags_strict"'^g' \
-e 's^@cflags_util@^'"$mb_cflags_util"'^g' \
\
-e 's^@ldflags@^'"$mb_ldflags"'^g' \
@@ -369,6 +384,7 @@ config_copy()
-e 's^@ldflags_config@^'"$mb_ldflags_config"'^g' \
-e 's^@ldflags_sysroot@^'"$mb_ldflags_sysroot"'^g' \
-e 's^@ldflags_path@^'"$mb_ldflags_path"'^g' \
+ -e 's^@ldflags_strict@^'"$mb_ldflags_strict"'^g' \
-e 's^@ldflags_util@^'"$mb_ldflags_util"'^g' \
\
-e 's^@pe_subsystem@^'"$mb_pe_subsystem"'^g' \
@@ -533,6 +549,18 @@ for arg ; do
mb_disable_shared='no'
;;
+ # convenience
+ --strict)
+ mb_ccstrict='yes'
+ mb_ldstrict='yes'
+ ;;
+ --ccstrict)
+ mb_ccstrict='yes'
+ ;;
+ --ldstrict)
+ mb_ldstrict='yes'
+ ;;
+
# project
--nickname=*)
mb_nickname=${arg#*=}
diff --git a/project/defs.mk b/project/defs.mk
index 09e54bd..11cec0f 100644
--- a/project/defs.mk
+++ b/project/defs.mk
@@ -42,7 +42,7 @@ STATIC_APP = bin/$(OS_APP_PREFIX)$(NICKNAME)-static$(OS_APP_SUFFIX)
CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_CONFIG) $(CFLAGS_SYSROOT) \
$(CFLAGS_COMMON) $(CFLAGS_CMDLINE) $(CFLAGS_HOST) \
$(CFLAGS_PATH) $(CFLAGS_OS) $(CFLAGS_SITE) \
- $(CFLAGS_VERSION)
+ $(CFLAGS_VERSION) $(CFLAGS_STRICT)
CFLAGS_SHARED = $(CFLAGS) $(CFLAGS_PIC) $(CFLAGS_SHARED_ATTR)
CFLAGS_STATIC = $(CFLAGS) $(CFLAGS_OBJ) $(CFLAGS_STATIC_ATTR)
@@ -50,13 +50,15 @@ CFLAGS_APP = $(CFLAGS) $(CFLAGS_OBJ) $(CFLAGS_APP_ATTR) $(CFLAGS_UTIL)
LDFLAGS_SHARED = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
$(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
- $(LDFLAGS_PATH) $(SHARED_LIB_DEPS) $(LDFLAGS_LAST)
+ $(LDFLAGS_PATH) $(SHARED_LIB_DEPS) $(LDFLAGS_STRICT) \
+ $(LDFLAGS_LAST)
LDFLAGS_APP = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
$(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
- $(LDFLAGS_PATH) $(SHARED_APP_DEPS) $(LDFLAGS_LAST) \
- $(LDFLAGS_UTIL)
+ $(LDFLAGS_PATH) $(SHARED_APP_DEPS) $(LDFLAGS_STRICT) \
+ $(LDFLAGS_UTIL) $(LDFLAGS_LAST)
LDFLAGS_STATIC = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
$(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
- $(LDFLAGS_PATH) $(STATIC_APP_DEPS) $(LDFLAGS_LAST)
+ $(LDFLAGS_PATH) $(STATIC_APP_DEPS) $(LDFLAGS_STRICT) \
+ $(LDFLAGS_LAST)