From 6e47ba6f9f6f31867c9eb46413c39a92cc1fd920 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 5 Oct 2008 09:49:28 +0100 Subject: [PATCH] clean up version handling a little --- .gitignore | 5 +++++ Makefile | 10 ++++------ anyconnect.h => openconnect.h | 4 ++++ version.sh | 12 +----------- 4 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 .gitignore rename anyconnect.h => openconnect.h (98%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0416e3e --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +version.c +.*.o.dep +*.o +anyconnect +nm-openconnect-auth-dialog diff --git a/Makefile b/Makefile index 9fa3698..dd6d800 100644 --- a/Makefile +++ b/Makefile @@ -35,16 +35,14 @@ CFLAGS_nm-auth-dialog.o += $(GTK_CFLAGS) $(GCONF_CFLAGS) $(GNOMEUI_CFLAGS) OPENCONNECT_OBJS := main.o ssl_ui.o xml.o CONNECTION_OBJS := dtls.o cstp.o mainloop.o tun.o -AUTH_OBJECTS := ssl.o http.o +AUTH_OBJECTS := ssl.o http.o version.o all: anyconnect nm-openconnect-auth-dialog -version.h: $(patsubst %.o,%.c,$(OBJECTS)) anyconnect.h $(wildcard .git/index .git/refs/tags) version.sh +version.c: $(patsubst %.o,%.c,$(OBJECTS)) anyconnect.h $(wildcard .git/index .git/refs/tags) version.sh @./version.sh - @echo -en "New version.h: " - @grep define version.h | cut -f2 -d\" - -main.o: version.h + @echo -en "New version.c: " + @cut -f2 -d\" version.c libopenconnect.a: $(AUTH_OBJECTS) $(AR) rcs $@ $^ diff --git a/anyconnect.h b/openconnect.h similarity index 98% rename from anyconnect.h rename to openconnect.h index ef4463e..8032201 100644 --- a/anyconnect.h +++ b/openconnect.h @@ -190,8 +190,12 @@ int config_lookup_host(struct anyconnect_info *vpninfo, const char *host); /* http.c */ int openconnect_obtain_cookie(struct anyconnect_info *vpninfo); +char *openconnect_create_useragent(char *base); /* ssl_ui.c */ int set_openssl_ui(void); +/* version.c */ +extern char openconnect_version[]; + #endif /* __OPENCONNECT_ANYCONNECT_H */ diff --git a/version.sh b/version.sh index 53205d2..b547327 100755 --- a/version.sh +++ b/version.sh @@ -24,15 +24,5 @@ if [ $? == 0 -a -d .git ]; then fi fi -echo "#ifndef ANYCONNECT_VERSION" > .build-version.h -echo "#define ANYCONNECT_VERSION \"$v\"" >> .build-version.h -echo "#endif" >> .build-version.h +echo "char openconnect_version[] = \"$v\";" > version.c -#diff -q version.h .build-version.h >& /dev/null -# -#if [ $? == 0 ]; then -# rm .build-version.h -# exit 0 -#fi - -mv -f .build-version.h version.h -- 2.7.4