Re: Amanda compile error

 
SOLVED
Go to solution
John Gerritse
Occasional Advisor

Amanda compile error

We have more servers than back-up units, so I figured I would give Amanda a go and back-up the unprotected systems to the Ultrium-drive of one of our HP-UX 11.00 boxes. Unfortunately, I got a error within a few seconds after executing make. Because Amanda doesn't officially run on 11.x, I tried to compile it on a 10.20 box instead (which should work according to the README and INSTALL files. I got the exact same error. I did the following:
==============================================
# ./configure --with-user=amanda --with-user=backup

# make
cc -Ae -DHAVE_CONFIG_H -I. -I. -I../config -I./../regex-src -g -Ae -c alloc.c -Wp,-M.deps/alloc.TPlo +Z -DPIC -o .libs/alloc.lo
cc: "amanda.h", line 895: error 1711: Inconsistent parameter list declaration for "gettimeofday".
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
==============================================
We (my coworkers and me) have been looking at the time.h file, TZ, enviromental settings, etc, but can't find anything which might get us past this compile error. Googling it didn't work either. We used the HP ANSI/C compiler, by the way.
"I have gone to find myself. If I get back before I return, keep me here."
11 REPLIES 11
Jerome Baron
Respected Contributor

Re: Amanda compile error

Hi john,

What's your compiler version ?
what's the list of parameter for gettimeofday at line 895 .

Regards,
Jerome
Elmar P. Kolkman
Honored Contributor

Re: Amanda compile error

I think you need to take a look at the amanda.h include file (line 895) and compare it with the gettimeofday definition in the other include files (time.h could be it, don't know it by head).
Every problem has at least one solution. Only some solutions are harder to find.
John Gerritse
Occasional Advisor

Re: Amanda compile error

>>>What's your compiler version ?
Depotfile installed:
B3900AA_APZ - B.10.20.02 - HP C/ANSI C Developer's Bundle for HP-UX 10.20 (S800)

No idea what exact version that is...


>>>what's the list of parameter for gettimeofday at line 895 .

893: #ifndef HAVE_GETTIMEOFDAY_DECL
894: # ifdef HAVE_TWO_ARG_GETTIMEOFDAY
895: extern int gettimeofday P((struct timeval *tp, struct timezone *tzp));
896: # else
897: extern int gettimeofday P((struct timeval *tp));
898: # endif
899: #endif

We have taken a look at time.h by the way, but couldn't figure out how to get things working without massive source-hacking (which really shouldn't be necessary and can't be to good for a package you wanna run in a production enviroment).
"I have gone to find myself. If I get back before I return, keep me here."
Elmar P. Kolkman
Honored Contributor
Solution

Re: Amanda compile error

Apparently the configure made a wrong decision. To make it work is quite simple I think. Define in your config.h the following:
#define HAVE_GETTIMEOFDAY_DECL 1

(It is probably commented out right now)
You also need another define I think:
#define HAVE_TWO_ARG_GETTIMEOFDAY 0

(I conclude this from the error you got. You could also just define the last and not the first).
Every problem has at least one solution. Only some solutions are harder to find.
John Gerritse
Occasional Advisor

Re: Amanda compile error

I have eddited the following in config/config.h :

/* Define to 1 if you have the `gettimeofday' function. */
/* #undef HAVE_GETTIMEOFDAY */
(unchanged)

/* Define if gettimeofday is declared. */
#define HAVE_GETTIMEOFDAY_DECL 1

/* Define if gettimeofday takes two arguments. */
#define HAVE_TWO_ARG_GETTIMEOFDAY 0

After hitting 'make', it compiles for a while (past previous error), but:
==============================================
cc -Ae -DHAVE_CONFIG_H -I. -I. -I../config -I./../regex-src -g -Ae -c strftime.c -Wp,-M.deps/strftime.TPlo +Z -DPIC -o .libs/strftime.lo
cpp: "strftime.c", line 26: error 4036: Can't open include file 'tzfile.h'.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
==============================================
File "common-src/strftime.c":
24: #include
25: #include
26: #include
27: #include

# find . -name "tzfile.h"
(no file found in the amanda directory)

So first error seems to be resolved, but timezone stuff still stands in the way of a successful compile. :-(
"I have gone to find myself. If I get back before I return, keep me here."
Elmar P. Kolkman
Honored Contributor

Re: Amanda compile error

From the name of the file it seems it is seems this is a C-file containing the strftime function. I think that this already exists. So you need to look at the config.h further and I think something like HAVE_STRFTIME or something like that is defined or not, depending on whether that function already exists.

Every problem has at least one solution. Only some solutions are harder to find.
John Gerritse
Occasional Advisor

Re: Amanda compile error

Setting

/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1

/* Define if strftime is declared. */
#define HAVE_STRFTIME_DECL 1

to 0 or 1 doesn't seem to have any effect at all (both were undefined by the way). :-(
"I have gone to find myself. If I get back before I return, keep me here."
Elmar P. Kolkman
Honored Contributor

Re: Amanda compile error

I don't have the means to test this myself, but this seems to need a lot of extra manual changes.

I would suggest looking for gcc and libgcc and then do a configure again (if there is a configure script in the package). I've only used binary packages (for linux) of Amanda. Then it should compile correctly.
Every problem has at least one solution. Only some solutions are harder to find.
John Gerritse
Occasional Advisor

Re: Amanda compile error

Did you use those binary files for linux on a HP-UX?
"I have gone to find myself. If I get back before I return, keep me here."