Move application data files to data folder
[hvgrip.git] / autogen.sh
index 22b6ff2..87fb83d 100755 (executable)
@@ -7,13 +7,17 @@ set -e
 # To test that we are really in the top-level directory
 TEST_FILE=src/grip.c
 
+# Where to copy gettext.h
+GETTEXT_INC_DIR=src
+
 test -f ${TEST_FILE} || {
     echo "Error: You must run this script in the top-level project directory"
     exit 1
 }
 
 (autoreconf --version) < /dev/null > /dev/null 2>&1 || {
-    echo "Error: You must have autoreconf installed to generate the GNU Build System files."
+    echo "Error: You must have autoreconf installed to generate the" \
+        "GNU Build System files."
     exit 1
 }
 
@@ -22,4 +26,19 @@ touch ChangeLog
 
 autoreconf -v --install --force
 
+# Update gettext files
+if [ -f po/Makevars ]; then
+    rm po/Makevars.template
+fi
+
+# If po/POTFILES.in is not present, po/Makefile won't be generated when running
+# ./configure
+if [ ! -f po/POTFILES.in ]; then
+    touch po/POTFILES.in
+fi
+
+if [ ! -f ${GETTEXT_INC_DIR}/gettext.h ]; then
+    cp /usr/share/gettext/gettext.h ${GETTEXT_INC_DIR}
+fi
+
 rm -rf autom4te.cache