[gs-cvs] gs/src

Ralph Giles giles at casper.ghostscript.com
Fri Mar 29 19:24:12 PST 2002


Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv3761/src

Modified Files:
	Makefile.in configure.ac 
Log Message:
Fix: removes gcc-specific compiler flags from the autoconf makefile,
including the -fomit-frame-pointer optimization. Replaces the workaround 
for const not working in gcc 2.7 with the more general autoconf macro
AC_C_CONST. Lists the defines generated by the configure script for
reference in the Makefile, but doesn't make use of them.


Index: Makefile.in
===================================================================
RCS file: /cvs/ghostscript/gs/src/Makefile.in,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile.in	29 Mar 2002 22:04:58 -0000	1.10
+++ Makefile.in	30 Mar 2002 03:24:10 -0000	1.11
@@ -219,6 +219,9 @@
 #   gcc to accept ANSI-style function prototypes and function definitions.
 XCFLAGS=
 
+# defines from autoconf; note that we don't use these at present.
+ACDEFS=@DEFS@
+
 CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(XCFLAGS)
 
 # Define platform flags for ld.
@@ -352,27 +355,6 @@
 #DEVICE_DEVS=$(DISPLAY_DEV) $(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev
 DEVICE_DEVS=$(DISPLAY_DEV) @X11DEVS@
 
-#DEVICE_DEVS1=
-#DEVICE_DEVS2=
-#DEVICE_DEVS3=
-#DEVICE_DEVS4=
-#DEVICE_DEVS5=
-#DEVICE_DEVS6=
-#DEVICE_DEVS7=
-#DEVICE_DEVS8=
-#DEVICE_DEVS9=
-#DEVICE_DEVS10=
-#DEVICE_DEVS11=
-#DEVICE_DEVS12=
-#DEVICE_DEVS13=
-#DEVICE_DEVS14=
-#DEVICE_DEVS15=
-#DEVICE_DEVS16=
-#DEVICE_DEVS17=
-#DEVICE_DEVS18=
-#DEVICE_DEVS19=
-#DEVICE_DEVS20=
-
 DEVICE_DEVS1=$(DD)bmpmono.dev $(DD)bmpgray.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)bmp32b.dev
 DEVICE_DEVS2=
 DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)lj5mono.dev $(DD)lj5gray.dev
@@ -404,23 +386,21 @@
 MAKEFILE=Makefile
 TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)/unixhead.mak
 
-# Define the ANSI-to-K&R dependency.  There isn't one, but we do have to
-# detect whether we're running a version of gcc with the const optimization
-# bug.
+# This defines the ANSI-to-K&R dependency. No longer supported.
 
-AK=$(GLGENDIR)/cc.tr
+AK=
 
 # Define the compilation rules and flags.
 
 CCFLAGS=$(GENOPT) $(CAPOPT) $(CFLAGS)
-CC_=$(CC) `cat $(AK)` $(CCFLAGS)
-CCAUX=$(CC) `cat $(AK)`
-CC_LEAF=$(CC_) -fomit-frame-pointer
-# gcc can't use -fomit-frame-pointer with -pg.
+CC_=$(CC) $(CCFLAGS)
+CCAUX=$(CC) 
+CC_LEAF=$(CC_)
+# note gcc can't use -fomit-frame-pointer with -pg.
 CC_LEAF_PG=$(CC_)
 # These are the specific warnings we have to turn off to compile those
 # specific few files that need this.  We may turn off others in the future.
-CC_NO_WARN=$(CC_) -Wno-cast-qual -Wno-traditional
+CC_NO_WARN=$(CC_)
 
 # ---------------- End of platform-specific section ---------------- #
 
@@ -442,7 +422,3 @@
 include $(GLSRCDIR)/unix-dll.mak
 include $(GLSRCDIR)/unix-end.mak
 include $(GLSRCDIR)/unixinst.mak
-
-# This has to come last so it won't be taken as the default target.
-$(AK):
-	if ( $(CC) --version | egrep "^2\.7\.([01]|2(\.[^1-9]|$$))" >/dev/null ); then echo -Dconst= >$(AK); else echo -Wcast-qual -Wwrite-strings >$(AK); fi

Index: configure.ac
===================================================================
RCS file: /cvs/ghostscript/gs/src/configure.ac,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- configure.ac	29 Mar 2002 22:05:54 -0000	1.11
+++ configure.ac	30 Mar 2002 03:24:10 -0000	1.12
@@ -12,9 +12,8 @@
 dnl Check for programs
 dnl --------------------------------------------------  
 
-dnl AC_PROG_CC likes to add '-g -O2' to CFLAGS, but
-dnl we do not worry since our makefile discards the env
-dnl CFLAGS
+dnl AC_PROG_CC likes to add '-g -O2' to CFLAGS. however,
+dnl we ignore those flags and construct our own.
 AC_PROG_CC
 AC_PROG_CPP
 
@@ -29,7 +28,8 @@
 
 AC_MSG_CHECKING([supported compiler flags])
 cflags_to_try="-Wall -Wstrict-prototypes -Wmissing-declarations \
--Wmissing-prototypes -fno-builtin -fno-common"
+-Wmissing-prototypes -Wqual-cast -Wwrite-strings \
+-fno-builtin -fno-common"
 old_cflags=$CFLAGS
 echo
 for flag in $cflags_to_try; do
@@ -40,7 +40,6 @@
 	])
 	CFLAGS=$old_cflags
 done
-AC_SUBST(GCFLAGS)
 AC_MSG_RESULT([ ...done.])
 
 dnl --------------------------------------------------
@@ -67,6 +66,12 @@
 AC_HEADER_TIME
 AC_STRUCT_TM
 
+dnl we aren't interested in all of DEFS, so manually insert
+dnl the flags we care about
+if test "$ac_cv_c_const" = yes; then
+	GCCFLAGS="$GCCFLAGS -Dconst="
+fi
+
 dnl --------------------------------------------------
 dnl Check for libraries
 dnl --------------------------------------------------
@@ -185,4 +190,5 @@
 dnl Do substitutions
 dnl --------------------------------------------------
 
+AC_SUBST(GCFLAGS)
 AC_OUTPUT(Makefile)




More information about the gs-cvs mailing list