Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #1732] Won't compile on FreeBSD #687

Closed
icinga-migration opened this issue Jul 19, 2011 · 11 comments
Closed

[dev.icinga.com #1732] Won't compile on FreeBSD #687

icinga-migration opened this issue Jul 19, 2011 · 11 comments

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/1732

Created by sag47 on 2011-07-19 18:18:01 +00:00

Assignee: (none)
Status: Resolved (closed on 2011-08-23 08:53:26 +00:00)
Target Version: 1.5
Last Update: 2011-08-23 08:53:26 +00:00 (in Redmine)


Just letting you guys know but there seems to be a problem when compiling Icinga 1.4.2 with IDOUtils on FreeBSD. I had previously compiled Icinga 1.3 successfully and double checked all prerequisites with the new Icinga.

I ran the following configure command.

    #> ./configure --with-command-group=icinga-cmd --enable-broker-module --enable-idoutils CPPFLAGS=-I/usr/local/include CFLAGS="-I/usr/local/include -L/usr/local/lib" --with-dbi-lib=/usr/local/lib --with-dbi-inc=/usr/local/include

When I attempt to compile I get the following error.

    #> make all
    cd ./base && make
    gcc ?-Wall -I/usr/local/include -L/usr/local/lib -I/usr/local/include -DHAVE_CONFIG_H -DNSCORE -c broker.c
    gcc: ?-Wall: No such file or directory
    *** Error code 1

    Stop in /usr/local/src/icinga-1.4.2/base.
    *** Error code 1

    Stop in /usr/local/src/icinga-1.4.2.

I analyzed the make file and here is the definition for CFLAGS (only problem shown).

    #> vim base/Makefile
    CFLAGS=?-Wall -I/usr/local/include -L/usr/local/lib -I/usr/local/include -DHAVE_CONFIG_H -DNSCORE

It should be the following:

    CFLAGS=-Wall -I/usr/local/include -L/usr/local/lib -I/usr/local/include -DHAVE_CONFIG_H -DNSCORE 

I ran a search command to see what files are affected.

    #> find . -type f -print0 | xargs -0 grep -iH '?-Wall' | cut -f1 -d: | sort -u
    ./Makefile
    ./base/Makefile
    ./cgi/Makefile
    ./common/Makefile
    ./config.log
    ./config.status
    ./contrib/Makefile
    ./html/Makefile
    ./module/Makefile
    ./module/idoutils/src/Makefile

So to fix the problem I ran the following command.

    #>  find . -type f -print0 | xargs -0 sed -i.bak 's/?-Wall/-Wall/'

After that everything compiled successfully.

Attachments

Changesets

2011-07-19 23:33:27 +00:00 by (unknown) 90e7d7c

Fix typo in configure.in preventing compilation on FreeBSD (thanks sag47) #1732

refs #1732
@icinga-migration
Copy link
Author

Updated by sag47 on 2011-07-19 18:19:25 +00:00

I forgot to give distro specific information.

#> uname -a
FreeBSD arc.tju.edu 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Thu Aug 19 17:56:59 EDT 2010     george@arc.tju.edu:/usr/obj/usr/src/sys/neoarc  i386

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-07-19 18:34:25 +00:00

those files are created within configure (recheck and run 'make distclean', they are gone).

the root cause would be a wrong detection of CFLAGS during configure run.

@icinga-migration
Copy link
Author

Updated by sag47 on 2011-07-19 19:58:14 +00:00

I did make distclean several times during my troubleshooting of trying to figure out what the root of the problem was. Even now it still does it on my FreeBSD 8 machine.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-07-19 20:34:58 +00:00

make distclean isn't the solution either - as said it's within the configure itsself. you might consider patching configure.in and creating a new one with autoconf and see if it works as expected. i don't have any freebsd for icinga available currently nor do i have a vm for that.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-07-19 20:35:11 +00:00

  • Status changed from New to Feedback
  • Priority changed from High to Normal
  • Target Version deleted 1.4.2

@icinga-migration
Copy link
Author

Updated by sag47 on 2011-07-19 20:54:10 +00:00

  • File added configure.in.patch

I made a patch for configure.in

#> patch -p0 < configure.in.patch

@icinga-migration
Copy link
Author

Updated by sag47 on 2011-07-19 20:55:34 +00:00

After patching Icinga 1.4.2 stable it now works as intended on FreeBSD 8.

@icinga-migration
Copy link
Author

Updated by mjbrooks on 2011-07-19 23:47:20 +00:00

  • Done % changed from 0 to 100

Just pushed the change to mbrooks/core which is based off of test/core so your patch probably wouldn't apply (I didn't even try), but I was able to zero in on the line thanks to your investigations. Much appreciated.

I don't currently have a FreeBSD setup either... I should probably add it to my VM stockpile.

dnsmichi: I'll leave it to you to mark this resolved once you've merged it. I'm trying not to step on your toes, but thought making the change for you would be helpful ;^)

@icinga-migration
Copy link
Author

Updated by sag47 on 2011-08-01 15:40:33 +00:00

Apparently this is a bug again.

Here is a direct quote from the mailing list.

Message: 1
Date: Thu, 21 Jul 2011 08:33:15 +0200
From: Michael Friedrich <michael.friedrich@univie.ac.at>
Subject: [icinga-devel] Fwd: Icinga 1.4.2 (build failed on FreeBSD)
To: icinga-devel@lists.sourceforge.net
Message-ID: <658c5d72-6730-42ed-8980-084faf9b828c@email.android.com>
Content-Type: text/plain; charset="utf-8"

Seems to be a typo, tobemerged, thx.

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Evgeniy Isaev <isaev.evgeniy@gmail.com> schrieb:

Hello.
On FreeBSD build stop with error:

cd ./base && gmake
gmake[1]: ? ??? `/root/icinga-1.4.2/base'
gcc ?-Wall -g -O2 -DHAVE_CONFIG_H -DNSCORE -c -o broker.o broker.c
gcc: ?-Wall: No such file or directory
gmake[1]: ***** [broker.o] ?? 1
gmake[1]: ? ?? `/root/icinga-1.4.2/base'
gmake: ***** [all] ?? 2

Typo in this commit: https://git.icinga.org/?p=icinga-core.git;a=commitdiff;h=ba1ce79f4335d49f9e77c96d4365598bc1562899

This patch solves this problem (copy of patch in attach):

--- configure.orig 2011-07-21 10:53:19.000000000 +0600

**+ configure 2011-07-21 10:17:00.000000000 +0600
@ -6890,7 +6890,7 @
CFLAGS="-Wall $CFLAGS"
;;
freebsd*)

  • CFLAGS=?"-Wall $CFLAGS"
  • CFLAGS?="-Wall $CFLAGS"
    ;;

*)
;;

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.diff
Type: text/x-diff
Size: 303 bytes
Desc: not available

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-08-01 16:32:20 +00:00

yeah another user sent that to me too. but you can see in the git history that this already applied in upstream for 1.5.0

(one from matthew)
https://git.icinga.org/?p=icinga-core.git;a=commit;h=90e7d7cc4810ec482c6f4c2a8ff08b931373fcd1
(one from me with autoconf)
https://git.icinga.org/?p=icinga-core.git;a=commit;h=27124124ff071d309807468a60c854ff6fd7bd13

so pls test either master or r1.5 branch -

$ git checkout master ; git pull ; git checkout r1.5

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-08-23 08:53:26 +00:00

  • Status changed from Feedback to Resolved
  • Target Version set to 1.5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant