# New Ticket Created by Andy Dougherty
# Please include the string: [perl #30320]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=30320 >
This patch allows languages/m4 to build for me. It removes some
gcc-specific flags (e.g. -fpic and -shared) and replaces them with the
appropriate items determined by Configure.pl. For the case of -fpic,
Configure.pl didn't actually determine anything, so I changed
Configure.pl to pull the appropriate value from perl5's $Config.
This patch assumes my previous Configure.pl patch for c++ detection has
been included.
Finally, this patch removes #include <error.h> from m4/src/eval.c. My
Solaris system doesn't have such a header, and it didn't seem to be
used anyway.
diff -r -u parrot-current/config/gen/makefiles/m4.in
parrot-andy/config/gen/makefiles/m4.in
--- parrot-current/config/gen/makefiles/m4.in Thu Jun 3 11:00:05 2004
+++ parrot-andy/config/gen/makefiles/m4.in Wed Jun 16 15:42:25 2004
@@ -6,6 +6,20 @@
PERL = ${perl}
RM_RF = ${rm_rf}
+CC = ${cc}
+CFLAGS = ${ccflags} -I../../include
+CC_SHARED = ${cc_shared} # e.g. -fpic
+DEBUG = ${cc_debug}
+WARN = ${ccwarn}
+
+LINK = ${link}
+LINKFLAGS = ${linkflags}
+
+# Shared-library building
+LD = ${ld}
+LDFLAGS = ${ldflags}
+LD_SHARED = ${ld_shared} # e.g. -shared
+
# some constants
M4_EVAL_COMPILER_SO = ../../runtime/parrot/dynext/m4_eval_compiler.so
@@ -46,7 +60,8 @@
$(LN_SF) src/m4.pbc
$(M4_EVAL_COMPILER_SO): src/eval.c
- $(CC) -shared -fpic src/eval.c -o $@ -g -Wall -I../../include
+ $(CC) $(CFLAGS) $(CC_SHARED) $(DEBUG) $(WARN) -c src/eval.c
+ $(LD) $(LD_SHARED) $(LDFLAGS) -o $@ eval.o
src/m4.imc: src/builtin.imc src/freeze.imc src/input.imc src/macro.imc
touch $@
diff -r -u parrot-current/config/init/data.pl parrot-andy/config/init/data.pl
--- parrot-current/config/init/data.pl Wed Jun 16 17:11:29 2004
+++ parrot-andy/config/init/data.pl Wed Jun 16 15:46:16 2004
@@ -45,6 +45,9 @@
cc => $Config{cc},
ccflags => $Config{ccflags},
ccwarn => exists($Config{ccwarn}) ? $Config{ccwarn} : '',
+ # Flags used to indicate this object file is to be compiled
+ # with position-independent code suitable for dynamic loading.
+ cc_shared => $Config{cccdlflags}, # e.g. -fpic for GNU cc.
# C++ compiler -- used to compile parts of ICU. ICU's configure
# will try to find a suitable compiler, but it prefers GNU c++ over
@@ -85,7 +88,7 @@
ld_out => '-o ', # ld output file
ld_debug => '-g ', # include debug info in executable
- ld_shared => $Config{lddlflags},
+ ld_shared => $Config{lddlflags}, # e.g. -shared for GNU cc.
ld_shared_flags=> '', # What is this, exactly? For GNU ld, it was
# '-Wl,-soname,libparrot$(SO)'
diff -r -u parrot-current/languages/m4/src/eval.c parrot-andy/languages/m4/src/eval.c
--- parrot-current/languages/m4/src/eval.c Thu Jun 3 11:00:09 2004
+++ parrot-andy/languages/m4/src/eval.c Wed Jun 16 15:16:22 2004
@@ -19,7 +19,6 @@
*/
#include <stdlib.h>
-#include <error.h>
#include <ctype.h>
typedef int boolean;
int warning_status;
--
Andy Dougherty [EMAIL PROTECTED]