Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Mingw: Generate config.h
Browse files Browse the repository at this point in the history
This replaces the config.h.mingw file that has been shipped with every
release with a generation script that generates it from the VERSION and
configure.ac.in files. This helps changing the version on Windows, e.g.
for development versions.

This has been tested with Cygwin only.
  • Loading branch information
kgraefe committed Feb 1, 2016
1 parent 4e85143 commit 429fba6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 117 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EXTRA_DIST = \
Makefile.mingw \
src/Makefile.mingw \
po/Makefile.mingw \
config.h.mingw \
scripts/gen_mingw_config_h.sh \
src/internal.h \
src/birthday_access.h \
src/birthday_list.h \
Expand Down
4 changes: 2 additions & 2 deletions Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ build: config.h
$(MAKE) -C $(PLUGIN_SRC) -f Makefile.mingw
$(MAKE) -C $(PLUGIN_PO) -f Makefile.mingw

config.h: config.h.mingw
cp config.h.mingw config.h
config.h: VERSION configure.ac.in scripts/gen_mingw_config_h.sh
./scripts/gen_mingw_config_h.sh > config.h

dist: $(PLUGIN_WIN32_ZIP)

Expand Down
99 changes: 0 additions & 99 deletions config.h.mingw

This file was deleted.

22 changes: 22 additions & 0 deletions scripts/gen_mingw_config_h.sh
Original file line number Diff line number Diff line change
@@ -0,0 +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)
PLUGIN_VERSION=$(cat VERSION)


cat << EOF
/* Generated by scripts/gen_mingw_config_h.sh
* from files VERSION and configure.ac.in.
*/
#define ENABLE_NLS 1
#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE"
#define PLUGIN_AUTHOR "$PLUGIN_AUTHOR"
#define PLUGIN_ID "$PLUGIN_ID"
#define PLUGIN_STATIC_NAME "$PLUGIN_STATIC_NAME"
#define PLUGIN_VERSION "$PLUGIN_VERSION"
#define PLUGIN_WEBSITE "$PLUGIN_WEBSITE"
EOF
9 changes: 0 additions & 9 deletions scripts/version-change.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,4 @@ vim ChangeLog || exit 1
vim VERSION || exit 1

./autogen.sh || exit 1

if [[ "$(uname -o)" == "Cygwin" ]]; then
# We set some dummy variables here so that ./configure completes so that we
# get our new config.h.mingw.
export pidgin_CFLAGS=xxx
export pidgin_LIBS=xxx
fi

./configure || exit 1
cp -v config.h config.h.mingw
7 changes: 1 addition & 6 deletions src/Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ PLUGIN_TOP := ..
PIDGIN_TREE_TOP ?= ../../../..
include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak

PLUGIN_VERSION := $(shell cat ${PLUGIN_TOP}/VERSION)

##
## VARIABLE DEFINITIONS
##
Expand All @@ -24,7 +22,7 @@ PLUGIN = pidgin-birthday-reminder

#CFLAGS =

DEFINES = -DBIRTHDAY_REMINDER_VERSION=\"$(PLUGIN_VERSION)\" -DGETTEXT_PACKAGE=\"$(PLUGIN)\" -DHAVE_CONFIG_H
DEFINES = -DHAVE_CONFIG_H

#LDFLAGS =

Expand Down Expand Up @@ -116,9 +114,6 @@ install: all $(PIDGIN_INSTALL_PLUGINS_DIR)

$(PLUGIN_OBJ): $(PLUGIN_TOP)/config.h $(PURPLE_VERSION_H)

$(PLUGIN_TOP)/config.h: $(PLUGIN_TOP)/config.h.mingw
$(MAKE) -C $(PLUGIN_TOP) -f Makefile.mingw config.h

##
## BUILD DLL
##
Expand Down

0 comments on commit 429fba6

Please sign in to comment.