1834661 Members
2877 Online
110069 Solutions
New Discussion

Re: aCC compile

 
SOLVED
Go to solution
Martin V.
Advisor

aCC compile

Hi guys,
i'm try to compile my red hat directory server plugin on hp-ux 11.11. but i always get the following error messages! what's wrong?

./Makefile.martin: INCLUDE_FLAGS: command not found
./Makefile.martin: -D_HPUX_SOURCE: command not found
./Makefile.martin: EXTRA_LIBS: command not found
./Makefile.martin: LDFLAGS: command not found
./Makefile.martin: OBJS: command not found
./Makefile.martin: all:: command not found
./Makefile.martin: OBJS: command not found
./Makefile.martin: a_testplugin.sl:: command not found
./Makefile.martin: LD: command not found
./Makefile.martin: LDFLAGS: command not found
./Makefile.martin: OBJS: command not found
./Makefile.martin: -o: command not found
./Makefile.martin: .c.o:: command not found
./Makefile.martin: line 19: syntax error near unexpected token `$<'
./Makefile.martin: line 19: ` $(CC) $(CFLAGS) -c $<'

help me please, thanks!!!

Martin
15 REPLIES 15
Peter Godron
Honored Contributor

Re: aCC compile

Martin,
Problem with setup/script.

Please list the commands you use, I assume something like:
make a.c

Please also list you makefile (Makefile.martin)
Martin V.
Advisor

Re: aCC compile

make -f Makefile.martin
cc -D_HPUX_SOURCE -Aa +z +DA2.0W -Ae -c a_testplugin.c
(Bundled) cc: -, line A: warning 480.
(Bundled) cc: +, line z: warning 480.
(Bundled) cc: -, line A: warning 480.
cpp: "a_testplugin.c", line 0: warning 2021:

=====================================
Makefile:

CFLAGS=$(INCLUDE_FLAGS) -D_HPUX_SOURCE -Aa +z +DA2.0W -Ae
LDFLAGS = +k -b +s $(EXTRA_LIBS)

OBJS = a_testplugin.o

all: a_testplugin.sl

a_testplugin.sl: $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS)

.c.o:
$(CC) $(CFLAGS) -c $<

clean:
-rm -f $(OBJS) a_testplugin.sl
===========================================

thanks
Dennis Handly
Acclaimed Contributor

Re: aCC compile

Are you trying to execute the makefile rather than use "make XXX"

(I see nothing that indicates the aCC compiler is at fault. And your other message said "my c plugin".)
Martin V.
Advisor

Re: aCC compile

hi,
generally i use aCC to compile the plugin or gmake but these commands are not found on the system. i'dont know why.
so i use make to compile ..

thanks for your answer!

Martin V.
Dennis Handly
Acclaimed Contributor

Re: aCC compile

Ok, you using the bundled C compiler which isn't supported for developing applications. Those -A? options and +z are ignored.

I'm not sure why your message catalog is messed up. You should be getting:
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The +z option is available only with the C/ANSI C product; ignored.

You need to purchase the HP C compiler or download a gcc compiler.

If you have the aC++ compiler, you can use -Ae to switch to C mode. And you'll have to change your CC make macro to: CC=aCC -Ae
Peter Godron
Honored Contributor

Re: aCC compile

Martin,
can we assume you got your code from:
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=NSDirSvr7

You incorrectly stated you were running aCC, which was part of the confusion. May I suggest you sort out your bundled cc first, as a failure there may comprimise you being able to build a new kernel.

Then review your make file with a view to actually use aCC, if you have it installed.
Martin V.
Advisor

Re: aCC compile

ok, thats my mistake but genrally i use gmake -f to compile these files. at once it doesn't work. and thats my big problem today! the error message called "command not found" ...

why?

thx

Martin V.
A. Clay Stephenson
Acclaimed Contributor

Re: aCC compile

Gmake has some extensions that make doesn't understand so that if some of those are in play, yoiu will need to use gmake.

If not, then examine your makefile very carefully. Make is one of the few UNIX utilities where are critically important and cannot be replaced by spaces.

If it ain't broke, I can fix that.
Peter Godron
Honored Contributor

Re: aCC compile

Martin,
re-reading your initial description and then your make -f post I am a bit confused:

make -f Makefile.martin
cc -D_HPUX_SOURCE -Aa +z +DA2.0W -Ae -c a_testplugin.c
(Bundled) cc: -, line A: warning 480.
(Bundled) cc: +, line z: warning 480.
(Bundled) cc: -, line A: warning 480.
cpp: "a_testplugin.c", line 0: warning 2021:

But your initial description had completely different errors.
The "command not found" indicates that the instruction INCLUDE_FLAGS was not understood/translated.

Are you sure you used the same command for both set of errors ? All the command not found errors are down to the Makefile.martin not being interpreted by the make command.

The second time round they seem to be recognized and the make fails do to the cc comiler being used.
Dennis Handly
Acclaimed Contributor

Re: aCC compile

>Genrally i use gmake -f to compile these files. at once it doesn't work. and thats my big problem today! the error message called "command not found" ...

Why aren't you using gmake -f or make -f?

As I stated above, you seem to be executing your makefile, as if it was a script. (This will produce those "command not found" errors.) Make sure your Makefile.martin is NOT executable.

If you need more help, tell us the exact command you are doing and the output. A Peter says, you seem to have two distinct commands and outputs.
Martin V.
Advisor

Re: aCC compile

okay, step by step

1. gmake -f Makefile.martin

=> gmake: command not found

That happen with gmake!!


2. root@audit1:examples > make -f Makefile.martin
cc -D_HPUX_SOURCE -Aa +z +DA2.0W -Ae -c a_testplugin.c
(Bundled) cc: -, line A: warning 480.
(Bundled) cc: +, line z: warning 480.
(Bundled) cc: -, line A: warning 480.
cpp: "a_testplugin.c", line 0: warning 2021:

That happen with make!!

thx
Martin V.
Advisor

Re: aCC compile

also,

3. cc -Aa -c +z a_test.c
ld -b -o test.sl a_test.o

doesn't work!

root@audit1:examples > cc -Aa -c +z a_testplugin.c
(Bundled) cc: -, line A: warning 480.
(Bundled) cc: +, line z: warning 480.
cpp: "a_testplugin.c", line 0: warning 2021:

(Bundled) cc: "/var/opt/netscape/server7/plugins/slapd/slapi/include/prtypes.h", line 271: warning 5.
(Bundled) cc: "/var/opt/netscape/server7/plugins/slapd/slapi/include/prtypes.h", line 271: error 1000.
(Bundled) cc: "/var/opt/netscape/server7/plugins/slapd/slapi/include/lber.h", line 124: error 1705.
(Bundled) cc: "/var/opt/netscape/server7/plugins/slapd/slapi/include/lber.h", line 181: error 1000.
...........

thx for your help ....
Dennis Handly
Acclaimed Contributor
Solution

Re: aCC compile

> make -f Makefile.martin
cc -D_HPUX_SOURCE -Aa +z +DA2.0W -Ae -c a_testplugin.c
(Bundled) cc: -, line A: warning 480.
(Bundled) cc: +, line z: warning 480.
(Bundled) cc: -, line A: warning 480.
cpp: "a_testplugin.c", line 0: warning 2021:

>That happen with make!!

Not precisely. This is exactly the same thing that would happen to gmake if you had it.

Basically you are using the bundled C compiler which is not supported for development. I explained warning 480. And 2021 is:
2021 warning %1$d: Possibly incorrect message catalog.

These missing messages are probably due to an incorrect setting of NLSPATH?

So unless you have any other errors, everything may have built fine.

If you have aC++ installed, you may be able to use that instead of C:
make -f Makefile.martin CC="aCC -Ae"
Dennis Handly
Acclaimed Contributor

Re: aCC compile

>. cc -Aa -c +z a_test.c
ld -b -o test.sl a_test.o
>doesn't work!

It wouldn't because the required +z is ignored. If you added +DD64, it would work.

$ dumpmsg /usr/lib/nls/msg/C/cc.cat | fgrep -e 1000 -e 1705
1000 %2$s, line %3$s: error %1$s: Unexpected symbol: "%4$s".
1705 %2$s, line %3$s: error %1$s: Function prototypes are an ANSI feature.

So you'll need to purchase HP C, or aC++ or use gcc.
Martin V.
Advisor

Re: aCC compile

thank you for your help!!