diff --git a/Makefile.mingw b/Makefile.mingw index a369275..0d9baee 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -27,7 +27,7 @@ build: config.h $(MAKE) -C $(PLUGIN_SRC) -f Makefile.mingw $(MAKE) -C $(PLUGIN_PO) -f Makefile.mingw -config.h: VERSION configure.ac.in scripts/gen_mingw_config_h.sh +config.h: VERSION scripts/gen_mingw_config_h.sh ./scripts/gen_mingw_config_h.sh > config.h dist: $(PLUGIN_WIN32_ZIP) diff --git a/scripts/gen_mingw_config_h.sh b/scripts/gen_mingw_config_h.sh index d631a17..33df737 100755 --- a/scripts/gen_mingw_config_h.sh +++ b/scripts/gen_mingw_config_h.sh @@ -1,16 +1,22 @@ #!/bin/bash -GETTEXT_PACKAGE=$(grep 'GETTEXT_PACKAGE=' configure.ac.in | cut -d= -f2) -PLUGIN_AUTHOR=$(grep 'PLUGIN_AUTHOR' configure.ac.in | cut -d\" -f2) -PLUGIN_ID=$(grep 'PLUGIN_ID' configure.ac.in | cut -d\" -f2) -PLUGIN_STATIC_NAME=$(grep 'PLUGIN_STATIC_NAME' configure.ac.in | cut -d\" -f2) -PLUGIN_WEBSITE=$(grep 'PLUGIN_WEBSITE' configure.ac.in | cut -d\" -f2) +if [ -f configure.ac.in ]; then + CONFIGURE_AC=configure.ac.in +else + CONFIGURE_AC=configure.ac +fi + +GETTEXT_PACKAGE=$(grep 'GETTEXT_PACKAGE=' $CONFIGURE_AC | cut -d= -f2) +PLUGIN_AUTHOR=$(grep 'PLUGIN_AUTHOR' $CONFIGURE_AC | cut -d\" -f2) +PLUGIN_ID=$(grep 'PLUGIN_ID' $CONFIGURE_AC | cut -d\" -f2) +PLUGIN_STATIC_NAME=$(grep 'PLUGIN_STATIC_NAME' $CONFIGURE_AC | cut -d\" -f2) +PLUGIN_WEBSITE=$(grep 'PLUGIN_WEBSITE' $CONFIGURE_AC | cut -d\" -f2) PLUGIN_VERSION=$(cat VERSION) cat << EOF /* Generated by scripts/gen_mingw_config_h.sh - * from files VERSION and configure.ac.in. + * from files VERSION and $CONFIGURE_AC. */ #define ENABLE_NLS 1 #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE"