Browse Source

w3m: Avoid depending on libgc-dev when building

android-5
Fredrik Fornwall 9 years ago
parent
commit
ee7d67ae62
  1. 4
      packages/w3m/Makefile.in.patch
  2. 3
      packages/w3m/build.sh
  3. 8
      packages/w3m/gc.h

4
packages/w3m/Makefile.in.patch

@ -1,6 +1,6 @@
diff -u -r ../w3m-0.5.3/Makefile.in ./Makefile.in
--- ../w3m-0.5.3/Makefile.in 2011-01-04 04:22:18.000000000 -0500
+++ ./Makefile.in 2015-11-19 17:27:59.073507125 -0500
+++ ./Makefile.in 2016-05-12 16:53:44.113699285 -0400
@@ -176,8 +176,8 @@
./mktable$(EXT) 100 functable.tab > $@
-rm -f functable.tab
@ -8,7 +8,7 @@ diff -u -r ../w3m-0.5.3/Makefile.in ./Makefile.in
-mktable$(EXT): mktable.o dummy.o Str.o hash.o myctype.o
- $(CC) $(CFLAGS) -o mktable mktable.o dummy.o Str.o hash.o myctype.o $(LDFLAGS) $(LIBS) $(GC_LIBS)
+mktable$(EXT): mktable.c Str.c hash.c myctype.c
+ gcc -DGC_free=free -DGC_malloc=malloc -DGC_malloc_atomic=malloc -D'GC_init(arg)=' -o mktable mktable.c Str.c hash.c myctype.c
+ gcc -isystem $(TERMUX_PKG_BUILDER_DIR) -o mktable mktable.c Str.c hash.c myctype.c
$(BOOKMARKER): w3mbookmark.o dummy.o $(ALIB)
$(CC) $(CFLAGS) -o $(BOOKMARKER) w3mbookmark.o dummy.o $(LDFLAGS) $(LIBS) $(EXT_LIBS)

3
packages/w3m/build.sh

@ -7,3 +7,6 @@ TERMUX_PKG_DEPENDS="libgc, ncurses, openssl"
# ac_cv_func_bcopy=yes to avoid w3m defining it's own bcopy function, which
# breaks 64-bit builds where NDK headers define bcopy as a mactro:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_setpgrp_void=yes ac_cv_func_bcopy=yes"
# For Makefile.in.patch:
export TERMUX_PKG_BUILDER_DIR

8
packages/w3m/gc.h

@ -0,0 +1,8 @@
/* A stub for gc.h to avoid depending on libgc for
the host-built mktable program. */
#define GC_INIT()
#define GC_MALLOC(arg) malloc(arg)
#define GC_malloc(arg) malloc(arg)
#define GC_MALLOC_ATOMIC(arg) malloc(arg)
#define GC_free(arg) free(arg)
Loading…
Cancel
Save