Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
Message ID: 1744     Entry time: Fri Mar 3 16:48:01 2006
Icon: Entry  Author: Alexandre Gauthier  Author Email: supernaut@underwares.org 
Category: Bug fix  OS: Mac OSX  ELOG Version: SVN 1668 
Subject: Makefile patch for OS X 10.4 
Hello,

I had trouble compiling elog on Mac OS X 10.4, and so, I hacked the makefile around...

I had to remove the -lutil flag that was passed to ld, for some reason. My guess is that it is not needed anymore with OS X 10.4... Also, the current install section of the makefile crapped out when using /usr/bin/install, I had to use install from gnu fileutils, which I installed through fink, which took precedence in my path... (/sw/bin/install), since bsd fileutil doesn't like the -D option.

For some reason, the paths to "install" in the makefile are either defined by the $(INSTALL) variable, or called directly. This seems not to be very consistent... In any case, I just changed it to use "install", no matter where it was in my path.

I'm currently hacking up something more elegant soon enough...

Also, I noticed that the binary produced was inconsistent and sluggish with the default wild CFLAGs, so I brought them back to something a bit more casual for Darwin. I used -Os because that's what Apple uses to build most OS X software. I also use -Os in my blackdog builds (which is an embedded PowerPC device) since space and memory *does* matters.

Well, here's the patch. I doubt it will be useful to anyone except for those who have gnu fileutils installed through fink, in their paths, and find themselves unable to build elog on OS X.
Attachment 1: makefile-osx-tiger.patch  744 Bytes  | Hide | Hide all
Index: Makefile
===================================================================
--- Makefile	(revision 1668)
+++ Makefile	(working copy)
@@ -52,8 +52,9 @@
 endif
 
 ifeq ($(OSTYPE),darwin)
-LIBS += -lutil
+#LIBS += -lutil
 CC = cc
+CFLAGS = -Os -fomit-frame-pointer -W -Wall
 BINOWNER = root
 BINGROUP = admin
 endif
@@ -131,9 +132,9 @@
 	@if [ ! -f $(ELOGDIR)/logbooks/demo ]; then  \
 	  install -v -m 0644 logbooks/demo/* $(ELOGDIR)/logbooks/demo ; \
 	fi
-
+	
 	@sed "s#\@PREFIX\@#$(PREFIX)#g" elogd.init_template > elogd.init
-	@$(INSTALL) -v -D -m 0755 elogd.init $(RCDIR)/elogd
+	@install -v -D -m 0755 elogd.init $(RCDIR)/elogd
 
 	@if [ ! -f $(ELOGDIR)/elogd.cfg ]; then  \
 	  install -v -m 644 elogd.cfg $(ELOGDIR)/elogd.cfg ; \
ELOG V3.1.5-fe60aaf