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 18720c0705d723598b0e2c1e18bcb036f2f630bf..96193e76abfa6175aca2ffcc013e69cfad6af5f8 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 e89880ff5548beb04c4347c39c89c909bc05cb86..f22410369516b597669668391864175bd7690c44 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 7594400300c9482bab11df2ae93b5509683a4114..9752f7a53cebbd5774ae7c34cd07530f891a5a44 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 294c396b976eb5dd5f040192d21b579abbe3b7d4..3c28cb0a18e979655ce8940e502992ab83031646 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 99ae52e6a81c7814b1b0b3f6d610bb98e3925b2c..62bb220f3bd333dbdcf0962a4b9373bd3f06e36b 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 61429f34577bf630975e369e478a431c7d291a9c..7ebb1c6ce091fe2a81b5054e24a883f4a8ee0599 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 27abc644fc5b7eb23f3cbf4bef376b7fc253b1ae..bb7656816d9a84e9f5dff928d96fbe3ac61f6fec 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 2672cb6a93fa955cf6f772d49ec41348aa1789a6..c937d7f8de074b1647bf5fc5acdfec9ca8c79a00 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 12cfb3e06863bce3090fb1900d3f7af47c6584c6..f6b9808657f272125381bc06cb6e9ab39ad619db 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