View Single Post

   
  #3 (permalink)  
Old 04-17-2008, 06:35 PM
Dhanaraj M
 
Posts: n/a
Default Re: Patch - Solving compilation problem for Sun studio compiler


>>I have a Sun Studio patch which solves the -Wall problem during the
>>compilation.
>>I am not sure whether this is the right way of making the changes.
>>Please comment on this so that I will make necessary changes and re-submit.
>>
>>

>The patch looks OK in theory (I haven't actually tested it yet), though
>I would prefer to see the compiler test as a macro in acinclude.m4
>
>

Hi Dave,

As suggested, I have made some changed. I discussed with Zdenek also.
I have a new patch now. I tested on Solaris- gcc and sun studio compilers.
This works correctly. Please test this patch.

Thanks
Dhanaraj

*** pgadmin3-1.6.2/acinclude.m4 Sun Jan 7 15:15:44 2007
--- pgadmin3-1.6.2.new/acinclude.m4 Wed Jan 10 17:43:16 2007
***************
*** 20,25 ****
--- 20,47 ----
fi
])

+ #################################
+ # Check this is SUN compiler #
+ #################################
+
+ AC_DEFUN([CHECK_SUN_COMPILER],
+ [
+ $CC -V 2>test.txt
+ SUN_STR=`head -1 test.txt |cut -f2 -d" "`
+ rm -rf test.txt
+ if test "$SUN_STR" = "Sun"; then
+ SUN_CC_COMPILER=yes
+ fi
+
+ $CXX -V 2>test.txt
+ SUN_STR=`head -1 test.txt |cut -f2 -d" "`
+ rm -rf test.txt
+ if test "$SUN_STR" = "Sun"; then
+ SUN_CXX_COMPILER=yes
+ fi
+
+ ])
+
#############################
# Override wxWidgets version #
#############################


*** pgadmin3-1.6.2/configure.ac Sun Jan 7 15:15:53 2007
--- pgadmin3-1.6.2.new/configure.ac Wed Jan 10 12:35:57 2007
***************
*** 13,18 ****
--- 13,21 ----
AC_PROG_CC
AC_PROG_CXX
CHECK_CPP_COMPILER
+ CHECK_SUN_COMPILER
+ AM_CONDITIONAL([SUN_CC], [test x$SUN_CC_COMPILER = xyes])
+ AM_CONDITIONAL([SUN_CXX], [test x$SUN_CXX_COMPILER = xyes])

# Checks for header files.
AC_HEADER_STDC


*** pgadmin3-1.6.2/src/Makefile.am Sun Jan 7 15:15:38 2007
--- pgadmin3-1.6.2.new/src/Makefile.am Wed Jan 10 12:41:21 2007
***************
*** 40,51 ****
include $(srcdir)/ui/module.mk
include $(srcdir)/utils/module.mk

if !APPBUNDLE

nobase_dist_pkgdata_DATA = $(TMP_ui)
! AM_CXXFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -Wno-non-virtual-dtor -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CPPFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -Wno-non-virtual-dtor -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include

# Automake trys to execute install-exec-hook if it appears anywhere in the file, so we need a dummy
# for non-APPBUNDLE cases.
--- 40,63 ----
include $(srcdir)/ui/module.mk
include $(srcdir)/utils/module.mk

+ if !SUN_CC
+ __CFLAGS=-Wall
+ else
+ __CFLAGS=""
+ endif
+
+ if !SUN_CXX
+ __CXXFLAGS=-Wall -Wno-non-virtual-dtor
+ else
+ __CXXFLAGS=""
+ endif
+
if !APPBUNDLE

nobase_dist_pkgdata_DATA = $(TMP_ui)
! AM_CXXFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" $(__CXXFLAGS) -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CPPFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" $(__CXXFLAGS) -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" $(__CFLAGS) -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include

# Automake trys to execute install-exec-hook if it appears anywhere in the file, so we need a dummy
# for non-APPBUNDLE cases.
***************
*** 54,62 ****
else

nobase_dist_data_DATA = $(TMP_ui)
! AM_CXXFLAGS = -Wall -Wno-non-virtual-dtor -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CPPFLAGS = -Wall -Wno-non-virtual-dtor -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CFLAGS = -Wall -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include

install-exec-hook:
cd $(bindir) ;\
--- 66,74 ----
else

nobase_dist_data_DATA = $(TMP_ui)
! AM_CXXFLAGS = $(__CXXFLAGS) -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CPPFLAGS = $(__CXXFLAGS) -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include
! AM_CFLAGS = $(__CFLAGS) -I$(top_srcdir)/src/include -I$(top_srcdir)/src/agent/include -I$(top_srcdir)/src/slony/include

install-exec-hook:
cd $(bindir) ;\


*** pgadmin3-1.6.2/xtra/pgagent/Makefile.am Sun Jan 7 15:15:44 2007
--- pgadmin3-1.6.2.new/xtra/pgagent/Makefile.am Sat Jan 13 11:38:40 2007
***************
*** 30,40 ****
$(srcdir)/include/misc.h \
$(srcdir)/include/pgAgent.h

if !APPBUNDLE

! AM_CXXFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -Wno-non-virtual-dtor -I$(srcdir)/include
! AM_CPPFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -Wno-non-virtual-dtor -I$(srcdir)/include
! AM_CFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -I$(srcdir)/include

install-data-local:
$(install_sh) -c -m 644 pgagent.sql $(DESTDIR)/$(pkgdatadir)/pgagent.sql
--- 30,52 ----
$(srcdir)/include/misc.h \
$(srcdir)/include/pgAgent.h

+ if !SUN_CC
+ __CFLAGS=-Wall
+ else
+ __CFLAGS=""
+ endif
+
+ if !SUN_CXX
+ __CXXFLAGS=-Wall -Wno-non-virtual-dtor
+ else
+ __CXXFLAGS=""
+ endif
+
if !APPBUNDLE

! AM_CXXFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" $(__CXXFLAGS) -I$(srcdir)/include
! AM_CPPFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" $(__CXXFLAGS) -I$(srcdir)/include
! AM_CFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" $(__CFLAGS) -I$(srcdir)/include

install-data-local:
$(install_sh) -c -m 644 pgagent.sql $(DESTDIR)/$(pkgdatadir)/pgagent.sql


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote