]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
bootstrap.conf: refactor detection of gtk-doc and gnulib sockets
authorDaiki Ueno <ueno@gnu.org>
Sun, 7 Feb 2021 16:38:31 +0000 (17:38 +0100)
committerDaiki Ueno <ueno@gnu.org>
Sat, 13 Feb 2021 14:59:38 +0000 (15:59 +0100)
Signed-off-by: Daiki Ueno <ueno@gnu.org>
bootstrap.conf

index 31eb7a33a6dde6cef08117c6a0c1d91ca7174bdc..0248acc813b45344b775d8c53c7fa2729ba729c8 100644 (file)
@@ -53,53 +53,41 @@ autopoint  -
 autogen    -
 "
 
-GTKDOCIZE=$(which gtkdocize 2>/dev/null)
-if test $? -ne 0; then
-  echo "No gtk-doc support found. You can't build the docs."
-  # rm because gtk-doc.make might be a link to a protected file
-  rm -f gtk-doc.make 2>/dev/null
-  echo "EXTRA_DIST =" >gtk-doc.make
-  echo "CLEANFILES =" >>gtk-doc.make
-  GTKDOCIZE=""
-else
-  $GTKDOCIZE
-fi
-
 # update git submodules
 git_options=
 if test -n "$SUBMODULE_NOFETCH"; then
   git_options="--no-fetch"
 fi
 
-for mod in $required_submodules;do
-       git submodule update --init $git_options $mod
+for mod in $required_submodules; do
+  git submodule update --init $git_options $mod
 done
 
-if test -d ./gnulib;then
-       TMP_GNULIB_SRCDIR="${GNULIB_SRCDIR:-./gnulib/}"
-
-       deps=$(${TMP_GNULIB_SRCDIR}/gnulib-tool --extract-recursive-dependencies ${gnulib_modules})
-       deps="echo -n ${deps} ${gnulib_modules}|sort -u"
-       case ${deps} in
-         *select*|*poll*|*sockets*|*recv*|*send*)
-               echo "******************************************************************"
-               die "the library cannot include the gnulib sockets; see CONTRIBUTION.md"
-           ;;
-       esac
+# This check needs to be done before actual import.
+TMP_GNULIB_SRCDIR="${GNULIB_SRCDIR:-gnulib}"
+if test -d "$TMP_GNULIB_SRCDIR"; then
+  if ${TMP_GNULIB_SRCDIR}/gnulib-tool --extract-recursive-dependencies ${gnulib_modules} | grep -E 'select|poll|sockets|recv|send' > /dev/null 2>&1; then
+    die "the library cannot include the gnulib sockets; see CONTRIBUTING.md"
+  fi
 fi
 
 bootstrap_post_import_hook ()
 {
-  # we re-use malloc-posix from the original gnulib
-#  for i in ${unistring_modules}; do
-#    sed -i 's/malloc-posix//g' ${GNULIB_SRCDIR}/modules/$i
-#  done
-
   ${GNULIB_SRCDIR}/gnulib-tool --import --local-dir=lib/unistring/override --lib=libunistring --source-base=lib/unistring --m4-base=lib/unistring/m4 --doc-base=doc --aux-dir=build-aux --lgpl=3orGPLv2 --no-conditional-dependencies --libtool --without-tests --macro-prefix=unistring ${unistring_modules}
 
   ${GNULIB_SRCDIR}/gnulib-tool --import --local-dir=src/gl/override --lib=libgnu_gpl --source-base=src/gl --m4-base=src/gl/m4 --doc-base=doc --tests-base=src/gl/tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=ggl --with-tests --no-vc-files ${src_modules}
 
-#  git -C ${GNULIB_SRCDIR} reset --hard
+  gtkdocize || {
+    echo "No gtk-doc support found. You can't build the docs."
+    # rm because gtk-doc.make might be a link to a protected file
+    rm -f gtk-doc.make
+    # Those need to be defined because the upstream Makefile boilerplate
+    # (doc/reference/Makefile.am) relies on them.
+    cat > gtk-doc.make <<EOF
+EXTRA_DIST =
+CLEANFILES =
+EOF
+  }
 
   # Automake requires that ChangeLog exist.
   touch ChangeLog || return 1