summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugh McMaster <hugh.mcmaster@outlook.com>2021-10-05 22:21:39 +1100
committerWerner Lemberg <wl@gnu.org>2021-10-05 19:44:27 +0200
commit467e49e817336bf3b890cb0e7fe984a5cae2e5e7 (patch)
treef416bba494f42af1b55bb17babb0d05be3666ed8
parentbbab0a675ef29b0eaa96054a69ada63fc3051c51 (diff)
downloadfreetype2-467e49e817336bf3b890cb0e7fe984a5cae2e5e7.tar.gz
autogen.sh: Only copy submodules if building from a git branch.
`autogen.sh` fails if building from a standard source tarball. Firstly, git expects to be called in a git repository, then `copy_submodule_files` blindly attempts to copy files. Debian, Ubuntu, Linux Mint, and other derivatives all run `autogen.sh` before compiling to regenerate build files. This patch ensures that various git commands are only called and 'dlg' files are only copied if `autogen.sh` is called from a git repository.
-rwxr-xr-xautogen.sh22
1 files changed, 12 insertions, 10 deletions
diff --git a/autogen.sh b/autogen.sh
index ee9257659..8cca7c84a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -182,17 +182,19 @@ copy_submodule_files ()
cp $DLG_SRC_DIR/* src/dlg
}
-DLG_INC_DIR=subprojects/dlg/include/dlg
-DLG_SRC_DIR=subprojects/dlg/src/dlg
+if test -d ".git"; then
+ DLG_INC_DIR=subprojects/dlg/include/dlg
+ DLG_SRC_DIR=subprojects/dlg/src/dlg
-if test -d "$DLG_INC_DIR"; then
- :
-else
- echo "Checking out submodule in \`subprojects/dlg':"
- git submodule init
- git submodule update
-fi
+ if test -d "$DLG_INC_DIR"; then
+ :
+ else
+ echo "Checking out submodule in \`subprojects/dlg':"
+ git submodule init
+ git submodule update
+ fi
-copy_submodule_files
+ copy_submodule_files
+fi
# EOF