- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Converting an application that used cfront and gcc...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2002 06:32 AM
01-16-2002 06:32 AM
Converting an application that used cfront and gcc to compile to now use aCC
As a part of an upgrade project, we have been forced to switch to using the aCC compiler (v.01.21). As I am new to this compiler, I cannot get the application to compile and link. I have attempted to replace both compilers as well as the cfront compiler only. I am at a loss as to how to proceed. This is the original part of the makefile that contained cfront and gcc. The application is running HP-UX 10.20.
CC=CC
STDCCFLAGS= +eh +a1 +DAportable -Wl,+s -z
objects := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
%.o: %.cpp
$(CC) -I. $(STDCCFLAGS) $(ALL_INCLUDES) -c $(CFLAGS) $< -o $@
%.o: %.cxx
$(CC) $(STDCCFLAGS) -DCLASS_NAME=$(CLASS_NAME) -I. -I../lib $(ALL_INCLUDES) -c $(CFLAGS) $< -o $@
%.d: %.cpp
$(SHELL) -ec 'g++ -MM -I. $(ALL_INCLUDES) $(CPPFLAGS) $< | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@'
%.d: %.cxx
$(SHELL) -ec 'gcc -MM -I. $(ALL_INCLUDES) $(CPPFLAGS) $< | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@'
%.d: %.cxx
$(SHELL) -ec 'gcc -MM -I. $(ALL_INCLUDES) $(CPPFLAGS) $< | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@'
Any assistance on how I could get this to work with the aCC compiler would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2002 06:45 AM
01-16-2002 06:45 AM
Re: Converting an application that used cfront and gcc to compile to now use aCC
1) Why switch to aCC? gcc is free, fast, and probably the best C compiler in the world.
2) What is the actual compiler issue - I haven't used cfront - but do you get issues compiling the code, or just how to start?
dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2002 07:03 AM
01-16-2002 07:03 AM
Re: Converting an application that used cfront and gcc to compile to now use aCC
1) We are using the RogueWave DBTools.h++ and Tools.h++ libraries. We also use Oracle and had upgraded our Oracle version from 7.2 to 7.3.4, which forced an upgrade to the RogueWave products. The upgraded RogueWave products require the aCC compiler version 01.21 to compile the RogueWave product. The, according to all the documentation I could find, in order to use the RogueWave libraries built with aCC, all applications have to be compiled with aCC.
2) The compiler issue is that I can get the portion of the application that uses templates to appear to compile and correctly create the user defined static library (it's called libmcr.a). The issue arises when attempting to compile the application executable. The compile appears to work, however when that application attempts to link, it throws an error stating "An unexpected end of file has been found in libtux.a" and the linking blows up. Libtux.a is fine because I have used that lib in a seperate application on the same box and that appication uses the aCC compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2002 08:59 AM
01-16-2002 08:59 AM
Re: Converting an application that used cfront and gcc to compile to now use aCC
This shouldn't be too difficult. The good news is that aCC will recogize myfile.C as C++ source, myfile.cpp as C++ source, and myfile.c as C source. I assume that you have no K&R C source because aCC will not compile it; it does not speak K&R C. If you have K&R source you will need the ANSI/C compiler in addition to aCC. You main problem is the makefiles.
CC=CC
STDCCFLAGS= +eh +a1 +DAportable -Wl,+s -z
objects := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
%.o: %.cpp
$(CC) -I. $(STDCCFLAGS) $(ALL_INCLUDES) -c $(CFLAGS) $< -o $@
I think the main thing you need to do is make sure that /opt/aCC/bin is in your PATH and then the CC=CC above should be CC=aCC. Study the man pages for aCC to see what compiler options you want. You almost certainly want the +DAportable unless you are only compiling for one architecture.
Important note: make is one of the few utilities that is VERY sensitive to whitespace.
To it, 8 spaces ain't the same as a tab. Make definitions should all resemble this:
$(PROG) : $(OBJECTS) $(LIBES1)
Don't worry about this particular rule just note that the commands are preceded by a single tab with no other spaces.
You should be able to really trim down your suffix rules to simply those that process
.cpp's, .C's, and .c's - all of those will invoke aCC.
You might consider renaming all the .cpp to .C since that is the more modern convention for C++ source and will mean 1 less rule. When you get your suffix rules like you want them, I would put them in a single file and let your make file include the file. By the way, the first thing to try is to remove the suffix rules and leave the CC=aCC define. I suspect that the default suffix rules will fix you unless you are also doing something like Oracle Pro/C and you need rules to deal with the invocation of the Pro/C compiler.
This should get you started, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2002 09:50 AM
01-16-2002 09:50 AM
Re: Converting an application that used cfront and gcc to compile to now use aCC
However, I still have questions regarding the gcc portion. The gcc appears to create the definition files (*.d). Can I get aCC to perform this function? The current compilation mechanism does not work without the definition files.
The reason I am looking for a parallel to the current methods used is the application that this makefile is used for is very convoluted and in my opinion far more complex that it needs to be. Therefore, I am trying not to make alot of changes to the code or compilation mechanisms because as you know, you try and fix one thing and end up breaking 3 others.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2002 01:40 PM
01-16-2002 01:40 PM
Re: Converting an application that used cfront and gcc to compile to now use aCC
You are going to have to rethink. You see, aC++ doesn't retain the old cfront concept of defmap files; it doesn't need them. Rather than me trying to explain, it's probably simpler to point you to the 'HP aC++ Transition Guide (HP C++ to hp aC++)'; it pretty much covers everything you need to know.
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1744,00.html