clean up version handling a little
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 5 Oct 2008 08:49:28 +0000 (09:49 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 5 Oct 2008 09:21:42 +0000 (10:21 +0100)
.gitignore [new file with mode: 0644]
Makefile
openconnect.h [moved from anyconnect.h with 98% similarity]
version.sh

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..0416e3e
--- /dev/null
@@ -0,0 +1,5 @@
+version.c
+.*.o.dep
+*.o
+anyconnect
+nm-openconnect-auth-dialog
index 9fa3698..dd6d800 100644 (file)
--- 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 $@ $^
similarity index 98%
rename from anyconnect.h
rename to openconnect.h
index ef4463e..8032201 100644 (file)
@@ -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 */
index 53205d2..b547327 100755 (executable)
@@ -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