From 0b0488f17b41c5323028b522cc7323f2cd9b684c Mon Sep 17 00:00:00 2001 From: jimying Date: Wed, 19 Oct 2022 11:56:30 +0800 Subject: [PATCH] Add --disable-libuuid to autoconf (#3100) --- aconfigure | 21 +++++++++++++++++++-- aconfigure.ac | 18 ++++++++++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/aconfigure b/aconfigure index dcb2e5721a..66f88ef948 100755 --- a/aconfigure +++ b/aconfigure @@ -823,6 +823,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_libuuid enable_floating_point enable_kqueue enable_epoll @@ -1522,6 +1523,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-libuuid Exclude libuuid(default: autodetect) --disable-floating-point Disable floating point where possible --enable-kqueue Use kqueue ioqueue on macos/BSD (experimental) @@ -5250,7 +5252,18 @@ then : fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 + +# Check whether --enable-libuuid was given. +if test ${enable_libuuid+y} +then : + enableval=$enable_libuuid; if test "$enable_libuuid" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if libuuid disabled... yes" >&5 +printf "%s\n" "Checking if libuuid disabled... yes" >&6; } + ac_has_uuid_lib=0 + fi +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 printf %s "checking for uuid_generate in -luuid... " >&6; } if test ${ac_cv_lib_uuid_uuid_generate+y} then : @@ -5293,7 +5306,7 @@ then : fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5 printf %s "checking for uuid_generate in -luuid... " >&6; } if test ${ac_cv_lib_uuid_uuid_generate+y} then : @@ -5333,6 +5346,10 @@ then : ac_has_uuid_lib=1 fi + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 printf %s "checking for library containing gethostbyname... " >&6; } if test ${ac_cv_search_gethostbyname+y} diff --git a/aconfigure.ac b/aconfigure.ac index 746275dcd5..986a58a565 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -113,8 +113,22 @@ AC_CHECK_LIB(winmm,puts) AC_CHECK_LIB(socket,puts) AC_CHECK_LIB(rt,puts) AC_CHECK_LIB(m,sin) -AC_CHECK_LIB(uuid,uuid_generate) -AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1]) + +dnl +dnl libuuid +dnl +AC_ARG_ENABLE(libuuid, + AS_HELP_STRING([--disable-libuuid], + [Exclude libuuid(default: autodetect)]), + [if test "$enable_libuuid" = "no"; then + AC_MSG_RESULT([Checking if libuuid disabled... yes]) + ac_has_uuid_lib=0 + fi], + [ + AC_CHECK_LIB(uuid,uuid_generate) + AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1]) + ]) + AC_SEARCH_LIBS(gethostbyname,nsl) AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu])