Fix autotools stripts in order they works on tarball generated by CPack

* Automatically switch --external-ortp and --external--mediastreamer
  to "enabled" when neither mediastreamer nor oRTP subdirectories can be found.

* Create an empty liblinphone_gitversion.h when there is no .git repository.
This commit is contained in:
François Grisez 2017-03-02 09:10:58 +01:00
parent 6b110ae40b
commit 8f0c130c0e
2 changed files with 4 additions and 2 deletions

View file

@ -819,7 +819,7 @@ AC_ARG_ENABLE(external-ortp,
no) external_ortp=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-external-ortp) ;;
esac],
[external_ortp=false]
[external_ortp=$(if test -d oRTP; then printf false; else printf true; fi)]
)
if test "$external_ortp" = 'true'; then
@ -847,7 +847,7 @@ AC_SUBST([ORTP_DIR])
AC_ARG_ENABLE([external-mediastreamer],
[AS_HELP_STRING([--enable-external-mediastreamer],[Use external mediastreamer library])],,
[enable_external_mediastreamer=no]
[enable_external_mediastreamer=$(if test -d mediastreamer2; then printf no; else printf yes; fi)]
)
AS_CASE($enable_external_mediastreamer,

View file

@ -202,6 +202,8 @@ make_gitversion_h:
cp -f $(builddir)/$(GITVERSION_FILE_TMP) $(builddir)/$(GITVERSION_FILE) ; \
fi ; \
rm -f $(builddir)/$(GITVERSION_FILE_TMP) ; \
else \
touch $(GITVERSION_FILE) ; \
fi
$(GITVERSION_FILE): make_gitversion_h