summaryrefslogtreecommitdiff
path: root/editors/bed
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2004-01-30 21:19:15 +0000
committerGreg Lewis <glewis@FreeBSD.org>2004-01-30 21:19:15 +0000
commitbe505ba5dfc4c9c4774913291db076bc390ab76d (patch)
tree9f4bf78e3514cb9b4be724911d39bdde5e81d73b /editors/bed
parent- Forced commit to log typo fixing. (diff)
. Fix the build on alpha by not assuming that you can cast a va_list
to a char **. Instead, iterate the va_list and create the char ** to pass to execvp. . Don't allow -O3 to be hardwired into CFLAGS, just use what is set. In particular, the 4.x/alpha system gcc produces many warnings about why using -O3 with it is bad. . Bump PORTREVISION since although these fixes wre motivated to fix the alpha build, they have non-alpha implications too. Submitted by: bento
Notes
Notes: svn path=/head/; revision=99539
Diffstat (limited to 'editors/bed')
-rw-r--r--editors/bed/Makefile1
-rw-r--r--editors/bed/files/patch-plugins::examples::Makefile23
-rw-r--r--editors/bed/files/patch-shell.h73
-rw-r--r--editors/bed/files/patch-utils::Makefile12
4 files changed, 107 insertions, 2 deletions
diff --git a/editors/bed/Makefile b/editors/bed/Makefile
index b172c243b98d..e9b3cdbcbd09 100644
--- a/editors/bed/Makefile
+++ b/editors/bed/Makefile
@@ -7,6 +7,7 @@
PORTNAME= bed
PORTVERSION= 0.2.19
+PORTREVISION= 1
CATEGORIES= editors
MASTER_SITES= ${MASTER_SITE_SUNSITE}
MASTER_SITE_SUBDIR= apps/editors/terminal
diff --git a/editors/bed/files/patch-plugins::examples::Makefile b/editors/bed/files/patch-plugins::examples::Makefile
index dce2bf83066d..4bce989dbb9d 100644
--- a/editors/bed/files/patch-plugins::examples::Makefile
+++ b/editors/bed/files/patch-plugins::examples::Makefile
@@ -1,5 +1,24 @@
---- plugins/examples/Makefile.orig Tue Dec 16 11:00:59 2003
-+++ plugins/examples/Makefile Tue Dec 16 11:01:51 2003
+$FreeBSD$
+
+--- plugins/examples/Makefile.orig Thu Apr 17 07:52:05 2003
++++ plugins/examples/Makefile Fri Jan 30 12:38:20 2004
+@@ -30,12 +30,12 @@
+ BIN2BYTE= ../../utils/bin2byte
+ PLUGINCFLAGSALL=-DPLUGINSRC=1
+ ifeq ($(CONFIG_DEBUG),n)
+-PLUGINLDFLAGS= -O3 -s
+-PLUGINCFLAGS= $(CFLAGS) $(OPTS) -O3 $(PLUGINCFLAGSALL)
++PLUGINLDFLAGS= -s
++PLUGINCFLAGS= $(CFLAGS) $(OPTS) $(PLUGINCFLAGSALL)
+ else
+ ifeq ($(CONFIG_DEBUG),o)
+-PLUGINLDFLAGS= -O2 -g
+-PLUGINCFLAGS= $(CFLAGS) $(OPTS) -g -O2 $(PLUGINCFLAGSALL)
++PLUGINLDFLAGS= -g
++PLUGINCFLAGS= $(CFLAGS) $(OPTS) -g $(PLUGINCFLAGSALL)
+
+ else
+ PLUGINCFLAGS= $(CFLAGS) $(OPTS) -g $(PLUGINCFLAGSALL)
@@ -150,41 +150,41 @@
##define callname(name,proc) int (Editor::*for_procedures_h_##proc##_prodefname)(void)=&Editor::proc;char name_part_##proc##_end[]=name;
#../../src/inlink.h: $(INLINKIN) $(CONFIGFILE)
diff --git a/editors/bed/files/patch-shell.h b/editors/bed/files/patch-shell.h
new file mode 100644
index 000000000000..c11a7fc9f688
--- /dev/null
+++ b/editors/bed/files/patch-shell.h
@@ -0,0 +1,73 @@
+$FreeBSD$
+
+--- src/shell.h.orig Thu May 30 07:22:42 2002
++++ src/shell.h Fri Jan 30 12:22:26 2004
+@@ -23,20 +23,56 @@
+ #else
+ #define process(commando,args...) executor(commando,commando,args,NULL)
+ #endif
+-inline int executor(const char *commando,...) {
++inline int executor(char *commando,...) {
++ if(!fork()) {
+ va_list ap;
+- if(!fork()) {
+- va_start(ap,commando);
+- execvp(commando,(char **)ap);
+- va_end(ap);
+- perror(commando);
+- exit(4);
+- }
+- else {
+- int statusdieprocessreturns;
+- wait(&statusdieprocessreturns);
+- return statusdieprocessreturns;
++ char *arg;
++ int argc = 0;
++ char **argv = NULL;
++ argv = (char **) malloc(2 * sizeof(char *)); /* commando, NULL */
++ if (argv == NULL)
++ goto cleanup;
++
++ /* Copy the relevant args into argv */
++ argv[argc] = (char *) malloc((strlen(commando) + 1) * sizeof(char));
++ if (argv[argc] == NULL)
++ goto cleanup;
++ strlcpy(argv[argc], commando, strlen(commando) + 1);
++
++ va_start(ap, commando);
++ while (*commando) {
++ switch (*commando++) {
++ case 's':
++ argc++;
++ if (realloc(argv, (argc + 2) * sizeof(char *)) == NULL)
++ goto cleanup;
++ arg = va_arg(ap, char *);
++ argv[argc] = (char *) malloc((strlen(arg) + 1) * sizeof(char));
++ if (argv[argc] == NULL)
++ goto cleanup;
++ strlcpy(argv[argc], arg, strlen(arg) + 1);
++ break;
++ }
++ }
++ va_end(ap);
++
++ argv[++argc] = NULL;
++ execvp(commando, argv);
++ perror(commando);
++cleanup:
++ if (argv != NULL) {
++ while (argc--) {
++ free(argv[argc]);
+ }
++ free(argv);
++ }
++ exit(4);
++ }
++ else {
++ int statusdieprocessreturns;
++ wait(&statusdieprocessreturns);
++ return statusdieprocessreturns;
+ }
++}
+ #endif
+ #endif
diff --git a/editors/bed/files/patch-utils::Makefile b/editors/bed/files/patch-utils::Makefile
new file mode 100644
index 000000000000..dfe7ac4b4ab4
--- /dev/null
+++ b/editors/bed/files/patch-utils::Makefile
@@ -0,0 +1,12 @@
+$FreeBSD$
+
+--- utils/Makefile.orig Fri Jan 30 12:38:36 2004
++++ utils/Makefile Fri Jan 30 12:38:50 2004
+@@ -1,6 +1,6 @@
+ include ../config
+ export LC_ALL=C
+-CFLAGS+=-O3 -s
++CFLAGS+=-s
+ #PROGRAMS=getch mkkeydef bin2byte
+ PROGRAMS=bin2byte
+ EXEPROGRAMS= $(patsubst %,%$(EXEEXT),$(PROGRAMS))