]> diplodocus.org Git - nmh/blobdiff - build_nmh
Tell make that uip/mhical.c depends on sbr/icalparse.h
[nmh] / build_nmh
index ce35594d8c0aed37fdbb28f7fe76dd3c957220f9..ef6037c10b8156c17f88e6bcbd57b15db7e244a6 100755 (executable)
--- a/build_nmh
+++ b/build_nmh
@@ -122,7 +122,7 @@ download_sources() {
     [ "$verbose" -eq 0 ]  &&  git_opts=--quiet
     [ "$branch" = master ]  ||
       git_opts="${git_opts:+$git_opts }--branch $branch"
-    if "$gitdir"/git clone --depth 1 $git_opts "git://$gitrepo/nmh.git" >&3
+    if "$gitdir"/git clone $git_opts "git://$gitrepo/nmh.git" >&3
     then
       directory=nmh
       cd "$directory"  ||  die "failed to clone $directory"
@@ -370,18 +370,26 @@ if [ -z "$CFLAGS" ]; then
   #### Only use these flags with gcc.
   if cc -dM -E - </dev/null 2>&1 | grep __GNUC__ >/dev/null; then
     #### configure will supply -g -O2 with gcc, but only if CFLAGS
-    #### isn't defined.
-    CFLAGS='-g -std=c99 -pedantic'
+    #### isn't defined.  Always add -g here.
+    #### Try all this, borrowed from Fedora 32 build.
+    CFLAGS="-g -std=c99 -pedantic -Wall -Werror=format-security \
+-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong \
+-grecord-gcc-switches -fasynchronous-unwind-tables \
+-fstack-clash-protection -fcf-protection"
+    if ! cc -x c -c $CFLAGS /dev/null -o /dev/null 2>/dev/null; then
+        #### All that wasn't supported.  The following should be.
+        CFLAGS='-g -std=c99 -pedantic'
+    fi
     if [ "$config_debug" = n ]; then
-      CFLAGS="$CFLAGS -O2 -D_FORTIFY_SOURCE=2"
+      CFLAGS="$CFLAGS -O2 -Wp,-D_FORTIFY_SOURCE=2"
     else
       CFLAGS="$CFLAGS -O0"
     fi
   fi
 fi
 
-printf "\n./configure $config_opts ${CFLAGS:+CFLAGS=\"${CFLAGS}\" }\n"
-./configure $config_opts ${CFLAGS:+CFLAGS="${CFLAGS}"" "}
+printf "\n./configure $config_opts${CFLAGS:+ CFLAGS=\"${CFLAGS}\"}\n"
+./configure $config_opts ${CFLAGS:+CFLAGS="${CFLAGS}"}
 status=$?
 
 if [ $status -eq 0 ]; then