add compilation options
authorMazet Laurent <laurent.mazet@thalesgroup.com>
Fri, 28 Nov 2025 15:11:38 +0000 (16:11 +0100)
committerMazet Laurent <laurent.mazet@thalesgroup.com>
Fri, 28 Nov 2025 15:11:38 +0000 (16:11 +0100)
Makeconf.in
configure
configure.ac

index ca8a9769d3d5a6a76c6f4d3171751c04c01871fa..55095a82257994587fa8ac3800b36029b73b97fd 100644 (file)
@@ -39,7 +39,7 @@ SH_LD      = @SH_LD@
 SH_LDFLAGS = @LDFLAGS@ @SH_LDFLAGS@ @SONAME_FLAGS@
 
 LD         = @LD@
-LIBS       = @LIBS@ -L$(top_srcdir)/src -l@LIBRARY@
+LIBS       = @LIBS@ -L$(top_srcdir)/src -l@LIBRARY@ -lm
 LDFLAGS    = @LDFLAGS@
 RLDFLAG    = @RLD_FLAG@
 
index a1f7113605dd1c1684910149fce295602b8c177b..3bb3ccda3f3f0691ab3a4d61a677d70d0149b9a2 100755 (executable)
--- a/configure
+++ b/configure
@@ -4201,6 +4201,62 @@ printf "%s\n" "no" >&6; }
 
 
 
+  ac_safe=`echo "-W" | sed 'y%./+-%__p_%'`
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${CC-gcc} accepts -W" >&5
+printf %s "checking whether ${CC-gcc} accepts -W... " >&6; }
+  if eval test \${libviterbi_cv_cc_flag_$ac_safe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    XCCFLAGS="$CCFLAGS"
+    CCFLAGS="$CCFLAGS -W"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"
+then :
+  eval "libviterbi_cv_cc_flag_$ac_safe=yes"
+else $as_nop
+  eval "libviterbi_cv_cc_flag_$ac_safe=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+    CCFLAGS="$XCCFLAGS"
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+fi
+
+  if eval "test \"`echo '$libviterbi_cv_cc_flag_'$ac_safe`\" = yes"; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+    CCFLAGS="$CCFLAGS -W"
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+  fi
+
+
   ac_safe=`echo "-Wall" | sed 'y%./+-%__p_%'`
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${CC-gcc} accepts -Wall" >&5
 printf %s "checking whether ${CC-gcc} accepts -Wall... " >&6; }
@@ -4257,6 +4313,62 @@ printf "%s\n" "no" >&6; }
   fi
 
 
+  ac_safe=`echo "-Wextra" | sed 'y%./+-%__p_%'`
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${CC-gcc} accepts -Wextra" >&5
+printf %s "checking whether ${CC-gcc} accepts -Wextra... " >&6; }
+  if eval test \${libviterbi_cv_cc_flag_$ac_safe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    XCCFLAGS="$CCFLAGS"
+    CCFLAGS="$CCFLAGS -Wextra"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"
+then :
+  eval "libviterbi_cv_cc_flag_$ac_safe=yes"
+else $as_nop
+  eval "libviterbi_cv_cc_flag_$ac_safe=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+    CCFLAGS="$XCCFLAGS"
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+fi
+
+  if eval "test \"`echo '$libviterbi_cv_cc_flag_'$ac_safe`\" = yes"; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+    CCFLAGS="$CCFLAGS -Wextra"
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+  fi
+
+
 
 
   # Find a good install program.  We prefer a C program (faster),
@@ -4815,7 +4927,7 @@ then :
   withval=$with_debug; if test "$withval" = no; then DEBUG=false;
    else DEBUG=true; fi
 else $as_nop
-  DEBUG=false
+  DEBUG=true
 fi
 
 
@@ -4953,6 +5065,62 @@ printf "%s\n" "yes" >&6; }
 printf "%s\n" "no" >&6; }
   fi
 
+
+  ac_safe=`echo "-g" | sed 'y%./+-%__p_%'`
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${CC-gcc} accepts -g" >&5
+printf %s "checking whether ${CC-gcc} accepts -g... " >&6; }
+  if eval test \${libviterbi_cv_cc_ldflag_$ac_safe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    XLDFLAGS="$LDFLAGS"
+    LDFLAGS="$LDFLAGS -g"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"
+then :
+  eval "libviterbi_cv_cc_ldflag_$ac_safe=yes"
+else $as_nop
+  eval "libviterbi_cv_cc_ldflag_$ac_safe=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS="$XLDFLAGS"
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+fi
+
+  if eval "test \"`echo '$libviterbi_cv_cc_ldflag_'$ac_safe`\" = yes"; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+    LDFLAGS="$LDFLAGS -g"
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+  fi
+
     if test "$libviterbi_cv_cc_flag__g" = "no"; then
       as_fn_error $? "Can't add debugging information with this compiler!" "$LINENO" 5
     fi
index 486d512563d42a24b1079677a08a6ce651930c15..10c6c11bcf7bbe183fbd642a7df9b850821be6f0 100644 (file)
@@ -44,7 +44,9 @@ fi
 
 LIBVITERBI_CC_FLAG(-pipe)
  
+LIBVITERBI_CC_FLAG(-W)
 LIBVITERBI_CC_FLAG(-Wall)
+LIBVITERBI_CC_FLAG(-Wextra)
 
 dnl Checks for programs.
 
@@ -128,7 +130,7 @@ AC_ARG_WITH(debug,
   [  --with-debug            add debug information],
   [if test "$withval" = no; then DEBUG=false;
    else DEBUG=true; fi],
-  DEBUG=false)
+  DEBUG=true)
 AC_SUBST(DEBUG)
 
 ### with profiling information
@@ -149,6 +151,7 @@ if test "$DEBUG" = true; then
   LIBVITERBI_CC_FLAG(-ggdb3)
   if test "$libviterbi_cv_cc_flag__ggdb3" = "no"; then
     LIBVITERBI_CC_FLAG(-g)
+    LIBVITERBI_CC_LDFLAG(-g)
     if test "$libviterbi_cv_cc_flag__g" = "no"; then
       AC_MSG_ERROR([Can't add debugging information with this compiler!])
     fi