Fix windows builds, add strip target for makefiles, update distro build makefiles...
authorDale Weiler <killfieldengine@gmail.com>
Fri, 11 Oct 2013 13:51:08 +0000 (09:51 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Fri, 11 Oct 2013 13:51:08 +0000 (09:51 -0400)
Makefile
distro/archlinux/this/Makefile
distro/deb/Makefile
distro/slackware/this/Makefile
distro/win32/Makefile
gmqcc.h
platform.h
test.c
util.c

index 18720c0..96193e7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -107,6 +107,11 @@ check: all
 test: all
        @ ./$(TESTSUITE)
 
+strip: $(GMQCC) $(QCVM) $(TESTSUITE)
+       strip $(GMQCC)
+       strip $(QCVM)
+       strip $(TESTSUITE)
+
 clean:
        rm -rf *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe gm-qcc.tgz ./cov-int
 
index e89880f..f224103 100644 (file)
@@ -23,7 +23,7 @@ endif
 base:
        $(MAKE) -C $(BASEDIR) clean
        CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
-         $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)/$(PKGDIR)" "PREFIX=$(PREFIX)" install
+         $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)/$(PKGDIR)" "PREFIX=$(PREFIX)" strip install
        @echo "pkgname = gmqcc" > $(PKGINFO)
        @echo "pkgver = $(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)" >> $(PKGINFO)
        @echo "pkgdesc = An Improved Quake C Compiler" >> $(PKGINFO)
index 7594400..9752f7a 100644 (file)
@@ -17,7 +17,7 @@ endif
 base:
        $(MAKE) -C $(BASEDIR) clean
        CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
-         $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) install
+         $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) strip install
        @install -d -m755 $(DEBDIR)/DEBIAN
        @echo "Package: gmqcc" > $(CONTROL)
        @echo "Version: $(MAJOR).$(MINOR).$(PATCH)" >> $(CONTROL)
index 294c396..3c28cb0 100644 (file)
@@ -20,7 +20,7 @@ endif
 base:
        $(MAKE) -C $(BASEDIR) clean
        CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
-         $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)" "PREFIX=$(PREFIX)" install
+         $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)" "PREFIX=$(PREFIX)" strip install
        gzip -9 $(PKGDIR)/usr/share/man/man?/*.?
        strip -s $(PKGDIR)/usr/bin/*
        mkdir $(PKGDIR)/install
index 99ae52e..62bb220 100644 (file)
@@ -7,7 +7,7 @@ BINDIR  := gmqcc-$(MAJOR).$(MINOR).$(PATCH)
 
 base:
        $(MAKE) CC=i486-mingw32-gcc UNAME=MINGW32 -C $(BASEDIR) clean
-       $(MAKE) CC=i486-mingw32-gcc UNAME=MINGW32 -C $(BASEDIR) DESTDIR=distro/win32/$(BINDIR) PREFIX=/ install
+       $(MAKE) CC=i486-mingw32-gcc UNAME=MINGW32 -C $(BASEDIR) DESTDIR=distro/win32/$(BINDIR) PREFIX=/ strip install
        @mkdir -p $(BINDIR)/doc
        @groff -mandoc $(BINDIR)/man1/gmqpak.1 | ps2pdf - $(BINDIR)/doc/gmqpak.pdf
        @groff -mandoc $(BINDIR)/man1/qcvm.1 | ps2pdf - $(BINDIR)/doc/qcvm.pdf
diff --git a/gmqcc.h b/gmqcc.h
index 61429f3..7ebb1c6 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -313,7 +313,9 @@ const struct tm *util_localtime(const time_t *timer);
 const char      *util_ctime    (const time_t *timer);
 
 typedef struct fs_file_s fs_file_t;
-bool            util_isatty   (fs_file_t *);
+
+bool             util_isatty(fs_file_t *);
+const char      *util_tmpnam(char *);
 
 /*
  * A flexible vector implementation: all vector pointers contain some
index 27abc64..bb76568 100644 (file)
             int                dd_stat;
             char               dd_name[1];
         } DIR;
-
-#       ifdef S_ISDIR
-#           undef  S_ISDIR
-#       endif /*! S_ISDIR */
-#       define S_ISDIR(X) ((X)&_S_IFDIR)
 #   else
 #       include <dirent.h>
 #   endif /*!__MINGW32__*/
+
+#   ifndef S_ISDIR
+#       define S_ISDIR(X) ((X)&_S_IFDIR)
+#   endif
 #else
 #   include <sys/types.h>
 #   include <sys/stat.h>
diff --git a/test.c b/test.c
index 2672cb6..c937d7f 100644 (file)
--- a/test.c
+++ b/test.c
@@ -152,6 +152,7 @@ static int task_pclose(fs_file_t **handles) {
     return status;
 }
 #else
+    #include <sys/stat.h>
     typedef struct {
         fs_file_t *handles[3];
         char       name_err[L_tmpnam];
diff --git a/util.c b/util.c
index 12cfb3e..f6b9808 100644 (file)
--- a/util.c
+++ b/util.c
@@ -282,6 +282,10 @@ bool util_isatty(fs_file_t *file) {
     return false;
 }
 
+const char *util_tmpnam(char *str) {
+    return platform_tmpnam(str);
+}
+
 /*
  * A small noncryptographic PRNG based on:
  * http://burtleburtle.net/bob/rand/smallprng.html