OpenDKIM icon indicating copy to clipboard operation
OpenDKIM copied to clipboard

configure: error: libmilter not found

Open hdatma opened this issue 5 years ago • 4 comments

I have libmilter installed in a location that is most convenient to me, let say /opt/libmilter. Opendkim is configured "--with-milter=/opt/libmilter" and the compiler is supposed to have an easy life with the following:

export CPPFLAGS="$CPPFLAGS -I/opt/libmilter/include"
export LDFLAGS="$LDFLAGS -L/opt/libmilter/lib"

Now, the library is there, opendkim is configured pointing its nose to where the library IS, and yet, it fails to find it.

Configure happens to be 24232 lines long, generated as follows:

   libtoolize -v -i --copy --force
   aclocal -I m4 -Wall
   autoheader -Wall -v

   autoconf -Wall -v
   # configure.ac:68: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
   # configure.ac:2716: You should run autoupdate.

   autoupdate

   automake --add-missing --force-missing --foreign --copy --warnings=override -Wall

This is the test that failed:

    if test x"$LIBMILTER_LIBDIRS" = x""
        then
                as_fn_error $? "libmilter not found" "$LINENO" 5
        fi

where $LIBMILTER_LIBDIRS is defined as follows:

if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

                                LIBMILTER_LIBDIRS="-L$milterpath/$d"
                                LIBMILTER_LIBS="-lmilter"
                                breakloop="yes"

fi

I commented the conditional, forcing the assignment, and the test passed.

Configure went on with the next test, breaking at

configure: error: libldns not found in lib

So, the block below is failing, multiple times.

if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

hdatma avatar Jul 08 '20 20:07 hdatma

Patching against configure instead of configure.ac, so you see how it expands on OpenBSD.

--- ./configure.orig	2020-07-09 12:04:31.000000000 +0200
+++ ./configure	2020-07-09 12:24:21.000000000 +0200
@@ -712,6 +712,7 @@
 LIBEVENT_LIBDIRS
 LIBLDNS_LIBS
 LIBLDNS_LIBDIRS
+LIBLDNS_INCDIRS
 LIBUNBOUND_LIBS
 LIBUNBOUND_LIBDIRS
 LIBUNBOUND_INCDIRS
@@ -17398,200 +17399,14 @@
 # Check whether --with-milter was given.
 if test "${with_milter+set}" = set; then :
   withval=$with_milter; milterpath="$withval"
+  LIBMILTER_INCDIRS="-I$milterpath/include"
+  LIBMILTER_LIBDIRS="-L$milterpath/lib"
+  LIBMILTER_LIBS="-lmilter"
 else
-  milterpath="auto"
+  milterpath="no"
 fi
 
 
-if test x"$enable_filter" = x"no"
-then
-	milterpath="no"
-fi
-
-if test "$milterpath" = "auto" -o "$milterpath" = "yes"
-then
-	milterdirs="/usr/local /opt/local /usr"
-	for d in $milterdirs
-	do
-		if test -f $d/include/libmilter/mfapi.h
-		then
-			milterpath=$d
-			break
-		fi
-	done
-fi
-case "$milterpath" in
-	no)
-		if test x"$enable_filter" = x"yes"
-		then
-			as_fn_error $? "milter is required" "$LINENO" 5
-		fi
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
-$as_echo "disabled" >&6; }
-		;;
-	auto)
-		as_fn_error $? "milter not found" "$LINENO" 5
-		;;
-	*/*)
-		if ! test -f $milterpath/include/libmilter/mfapi.h
-		then
-			as_fn_error $? "milter includes not found at $milterpath" "$LINENO" 5
-		fi
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $milterpath" >&5
-$as_echo "$milterpath" >&6; }
-		;;
-	*)
-		as_fn_error $? "milter not found" "$LINENO" 5
-		;;
-esac
-
-LIBMILTER_INCDIRS=""
-LIBMILTER_LIBDIRS=""
-LIBMILTER_LIBS=""
-
-if test x"$milterpath" != x"no"
-then
-	LIBMILTER_INCDIRS="-I$milterpath/include"
-
-	saved_CC="$CC"
-	saved_CFLAGS="$CFLAGS"
-	saved_CPPFLAGS="$CPPFLAGS"
-	saved_LDFLAGS="$LDFLAGS"
-	saved_LIBS="$LIBS"
-
-	CC="$PTHREAD_CC"
-	LIBS="$outer_LIBS $PTHREAD_LIBS $saved_LIBS"
-	CPPFLAGS="$LIBMILTER_INCDIRS $saved_CPPFLAGS"
-	CFLAGS="$PTHREAD_CFLAGS $saved_CFLAGS"
-	LDFLAGS="$outer_LDFLAGS $PTHREAD_CFLAGS $saved_LDFLAGS"
-
-	breakloop="no"
-	for d in lib lib64 lib/libmilter
-	do
-		unset ac_cv_search_smfi_register
-		LDFLAGS="$outer_LDFLAGS $PTHREAD_CFLAGS -L$milterpath/$d $saved_LDFLAGS"
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing smfi_register" >&5
-$as_echo_n "checking for library containing smfi_register... " >&6; }
-if ${ac_cv_search_smfi_register+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char smfi_register ();
-int
-main ()
-{
-return smfi_register ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' milter; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_smfi_register=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_smfi_register+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_smfi_register+:} false; then :
-
-else
-  ac_cv_search_smfi_register=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_smfi_register" >&5
-$as_echo "$ac_cv_search_smfi_register" >&6; }
-ac_res=$ac_cv_search_smfi_register
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-		               	LIBMILTER_LIBDIRS="-L$milterpath/$d"
-		               	LIBMILTER_LIBS="-lmilter"
-		               	breakloop="yes"
-
-fi
-
-
-		ac_fn_c_check_func "$LINENO" "smfi_insheader" "ac_cv_func_smfi_insheader"
-if test "x$ac_cv_func_smfi_insheader" = xyes; then :
-
-$as_echo "#define HAVE_SMFI_INSHEADER 1" >>confdefs.h
-
-fi
-
-
-		ac_fn_c_check_func "$LINENO" "smfi_opensocket" "ac_cv_func_smfi_opensocket"
-if test "x$ac_cv_func_smfi_opensocket" = xyes; then :
-
-$as_echo "#define HAVE_SMFI_OPENSOCKET 1" >>confdefs.h
-
-fi
-
-
-		ac_fn_c_check_func "$LINENO" "smfi_progress" "ac_cv_func_smfi_progress"
-if test "x$ac_cv_func_smfi_progress" = xyes; then :
-
-$as_echo "#define HAVE_SMFI_PROGRESS 1" >>confdefs.h
-
-fi
-
-
-		ac_fn_c_check_func "$LINENO" "smfi_setsymlist" "ac_cv_func_smfi_setsymlist"
-if test "x$ac_cv_func_smfi_setsymlist" = xyes; then :
-
-$as_echo "#define HAVE_SMFI_SETSYMLIST 1" >>confdefs.h
-
-fi
-
-
-		ac_fn_c_check_func "$LINENO" "smfi_version" "ac_cv_func_smfi_version"
-if test "x$ac_cv_func_smfi_version" = xyes; then :
-
-$as_echo "#define HAVE_SMFI_VERSION 1" >>confdefs.h
-
-fi
-
-
-		if test x"$breakloop" = x"yes"
-		then
-			break
-		fi
-	done
-	if test x"$LIBMILTER_LIBDIRS" = x""
-	then
-		as_fn_error $? "libmilter not found" "$LINENO" 5
-	fi
-
-	CC="$saved_CC"
-	CPPFLAGS="$saved_CPPFLAGS"
-	CFLAGS="$saved_CFLAGS"
-	LDFLAGS="$saved_LDFLAGS"
-	LIBS="$saved_LIBS"
-fi
-
-
-
-
-
 #
 # librrd
 #
@@ -18037,173 +17852,14 @@
 # Check whether --with-ldns was given.
 if test "${with_ldns+set}" = set; then :
   withval=$with_ldns; ldnspath="$withval"
+  LIBLDNS_INCDIRS="-I$ldnspath/include"
+  LIBLDNS_LIBDIRS="-L$ldnspath/lib"
+  LIBLDNS_LIBS="-lldns"
 else
   ldnspath="no"
 fi
 
 
-LIBLDNS_LIBS=""
-LIBLDNS_LIBDIRS=""
-
-if test x"$ldnspath" = x"yes"
-then
-	ldns_found="no"
-
-	ldnsdirs="/usr /usr/local"
-	for d in $ldnsdirs
-	do
-		unset ac_cv_search_ldns_rr_new
-		saved_LDFLAGS="$LDFLAGS"
-		saved_LIBS="$LIBS"
-		LDFLAGS="$outer_LDFLAGS -L$d/lib $LDFLAGS"
-		LIBS="$outer_LIBS"
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldns_rr_new" >&5
-$as_echo_n "checking for library containing ldns_rr_new... " >&6; }
-if ${ac_cv_search_ldns_rr_new+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ldns_rr_new ();
-int
-main ()
-{
-return ldns_rr_new ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' ldns; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_ldns_rr_new=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_ldns_rr_new+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_ldns_rr_new+:} false; then :
-
-else
-  ac_cv_search_ldns_rr_new=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldns_rr_new" >&5
-$as_echo "$ac_cv_search_ldns_rr_new" >&6; }
-ac_res=$ac_cv_search_ldns_rr_new
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  ldns_found="yes"
-fi
-
-		LDFLAGS="$saved_LDFLAGS"
-		LIBS="$saved_LIBS"
-
-		if test x"$ldns_found" = x"yes"
-		then
-			LIBLDNS_LIBDIRS="-L$d/lib"
-			LIBLDNS_LIBS="-lldns"
-			break
-		fi
-	done
-	if test x"$LIBLDNS_LIBS" = x""
-	then
-		as_fn_error $? "libldns not found" "$LINENO" 5
-	fi
-elif test x"$ldnspath" != x"no"
-then
-	ldns_found="no"
-	saved_LDFLAGS="$LDFLAGS"
-	saved_LIBS="$LIBS"
-	LDFLAGS="$outer_LDFLAGS -L$d/lib $LDFLAGS"
-	LIBS="$outer_LIBS"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ldns_rr_new" >&5
-$as_echo_n "checking for library containing ldns_rr_new... " >&6; }
-if ${ac_cv_search_ldns_rr_new+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ldns_rr_new ();
-int
-main ()
-{
-return ldns_rr_new ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' ldns; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_ldns_rr_new=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_ldns_rr_new+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_ldns_rr_new+:} false; then :
-
-else
-  ac_cv_search_ldns_rr_new=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ldns_rr_new" >&5
-$as_echo "$ac_cv_search_ldns_rr_new" >&6; }
-ac_res=$ac_cv_search_ldns_rr_new
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  ldns_found="yes"
-fi
-
-	LDFLAGS="$saved_LDFLAGS"
-	LIBS="$saved_LIBS"
-
-	if test x"$ldns_found" = x"yes"
-	then
-		LIBLDNS_LIBDIRS="-L$d/lib"
-		LIBLDNS_LIBS="-lldns"
-		break
-	else
-		as_fn_error $? "libldns not found in $d" "$LINENO" 5
-	fi
-fi
-
-
 
 
 # unbound may also need libevent

hdatma avatar Jul 09 '20 10:07 hdatma

This may be an autoconf/automake issue. Please feel free to submit your patch against the -development branch as a pull request and I'll look it over as I work on the new release.

martinbogo avatar Jul 13 '20 15:07 martinbogo

OK

hdatma avatar Jul 13 '20 16:07 hdatma

I am back on this and my other issues after a while now, and would like to close them all. I git cloned the development branch, and have new issues as a result. I thought the openssl 1.1 compatibility was a solved issue, but I still see SSL_library_init, which is gone for good on both openssl 1.1.i and libressl:

https://github.com/trusteddomainproject/OpenDKIM/search?q=SSL_library_init&type=

This is what I am using:

autoconf           2.69
automake         1.16.2
clang                10.0.1
openssl            1.1.1i
libsodium         1.0.18
ldns                  1.7.1
unbound           1.13.0
curl                   7.74.0
libmilter             8.16.1
libxml2              2.9.10

Do you have a stable branch that compiles at least on your machine? What version of the autotools, ssl, and other dependencies are you using? If we are on the same page I can give you feedback and try to work out my own issues.

hdatma avatar Dec 13 '20 17:12 hdatma