DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st January 2009
nihonto nihonto is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 65
Default New Kernel: "make depend" doesn't work

Hi there,

I'm trying to compile a new kernel on NetBSD-4.0.1. But when it comes to "make depend" I get this error:

Quote:
# make depend
make: "/etc/mk.conf" line 207: Malformed conditional ((!empty(MACHINE_PLATFORM:MNetBSD-*-*) && exists(/usr/X11R7/lib/libX11.so)))
make: "/etc/mk.conf" line 207: Need an operator
make: "/etc/mk.conf" line 210: Malformed conditional (empty(MACHINE_PLATFORM:MDarwin-9.*-*) || (defined(X11_TYPE) && ${X11_TYPE} != "native"))
make: "/etc/mk.conf" line 516: Malformed conditional (${OPSYS} == "IRIX")
make: "/etc/mk.conf" line 516: Need an operator
make: "/etc/mk.conf" line 529: Malformed conditional (${OPSYS} == "SunOS")
make: Fatal errors encountered -- cannot continue

make: stopped in /usr/src/sys/arch/i386/compile/MYKERNEL
What is ment by "Malformed conditional"? And what kind of "operator" is expected?

I have copied the example from /usr/pkgsrc/mk/defaults/mk.conf to /etc. So I thought it should be ok.

Any ideas?
Reply With Quote
  #2   (View Single Post)  
Old 22nd January 2009
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

It looks to me like you need to set up in your /etc/mk.conf file the type of architecture you are compiling kernel for. NetBSD can be cross compiled so it probably makes no assumption that if you are compiling kernel on AMD64 it is going to be used on AMD64.
Reply With Quote
  #3   (View Single Post)  
Old 22nd January 2009
nihonto nihonto is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 65
Default

Quote:
Originally Posted by Oko View Post
It looks to me like you need to set up in your /etc/mk.conf file the type of architecture you are compiling kernel for.
Hi Oko,

thanks for your hint! I will look it up, when I'm home from work this evening. This example mk.conf from pkgsrc is a quite long document and I haven't read it in total.

In fact up to now I just used it for building xorg and for several ACCEPTABLE_LICENSE details.
Reply With Quote
  #4   (View Single Post)  
Old 22nd January 2009
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

@nihonto

Did you add any extra options to /etc/mk.conf or you just copied it over to /etc and did a 'make depend'?
Also, try deleting the content of mk.conf file and put only stuff you need, there is no need for default options to be listed, and it's way clearer for reading.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #5   (View Single Post)  
Old 22nd January 2009
nihonto nihonto is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 65
Default

Quote:
Originally Posted by s0xxx View Post
@nihonto

Did you add any extra options to /etc/mk.conf or you just copied it over to /etc and did a 'make depend'?
Also, try deleting the content of mk.conf file and put only stuff you need, there is no need for default options to be listed, and it's way clearer for reading.
I didn't add any extra options. I just needed the mk.conf for building modular xorg:

Quote:
X11_TYPE=modular
And I need the mk.conf because several packages need an entry in mk.conf while building them with pkgsrc. For example Opera needs an entry a la

Quote:
ACCEPTABLE_LICENSES += opera-license
I copied the /usr/pkgsrc/mk/defaults/mk.conf to /etc because I thought this would be the "right" way.

By the way - what does the "+" sign mean in front of the equals sign? And I have even seen question marks in front of the equals sign like here:

Quote:
PACKAGES?= ${PKGSRCDIR}/packages
What do they indicate?
Reply With Quote
  #6   (View Single Post)  
Old 22nd January 2009
nihonto nihonto is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 65
Default

Well, this evening I have chosen the easy solution. I have moved /etc/mk.conf to /etc.mk.conf.old and created a new empty mk.conf.

In this new document I placed only entries, that I know I need:

Quote:
ALLOW_VULNERABLE_PACKAGES=defined
X11_TYPE=modular
ACCEPTABLE_LICENSES+=opera-850-license vim-license
After that the kernel compiled without any problems!
Reply With Quote
  #7   (View Single Post)  
Old 23rd January 2009
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

Quote:
Originally Posted by nihonto View Post
By the way - what does the "+" sign mean in front of the equals sign? And I have even seen question marks in front of the equals sign. What do they indicate?
From a make(1) man page:
Code:
VARIABLE ASSIGNMENTS
     Variables in make are much like variables in the shell, and, by tradi-
     tion, consist of all upper-case letters.

   Variable assignment modifiers
     The five operators that can be used to assign values to variables are as
     follows:

     =       Assign the value to the variable.  Any previous value is overrid-
             den.

     +=      Append the value to the current value of the variable.

     ?=      Assign the value to the variable if it is not already defined.

     :=      Assign with expansion, i.e. expand the value before assigning it
             to the variable.  Normally, expansion is not done until the vari-
             able is referenced.  NOTE: References to undefined variables are
             not expanded.  This can cause problems when variable modifiers
             are used.

     !=      Expand the value and pass it to the shell for execution and
             assign the result to the variable.  Any newlines in the result
             are replaced with spaces.
http://netbsd.gw.com/cgi-bin/man-cgi...NetBSD-current
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #8   (View Single Post)  
Old 23rd January 2009
nihonto nihonto is offline
Fdisk Soldier
 
Join Date: May 2008
Posts: 65
Default

Quote:
Originally Posted by s0xxx View Post
From a make(1) man page: ...
Ahhh, there is a description of the signs. I looked up mk.conf (5) and couldn't find anything.

That's the trick with manpages - you have to know which one solves your needs.
Reply With Quote
  #9   (View Single Post)  
Old 23rd January 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,165
Default

RE: "Malformed conditional". The following, done on OpenBSD, explains this error
Code:
# cat -n Makefile ; make 
     1  #OPSYS = IRIX
     2  
     3  .if ( ${OPSYS} == "IRIX" )
     4  message:
     5          @echo Yes the operating system is IRIX!
     6  .endif
     7  
"Makefile", line 3: Malformed conditional (( ${OPSYS} == "IRIX" ))
"Makefile", line 3: Missing dependency operator
"Makefile", line 6: if-less endif
"Makefile", line 6: Need an operator
Fatal errors encountered -- cannot continue
Removal of the comment indicator '#' from line 1 and thus having a variable OPSYS defined, there is no error at all
Code:
$ cat -n Makefile ; make 
     1  OPSYS = IRIX
     2  
     3  .if ( ${OPSYS} == "IRIX" )
     4  message:
     5          @echo Yes the operating system is IRIX!
     6  .endif
     7 
 
Yes the operating system is IRIX!
RE: "need an operator" error

A more common cause for the "need an operator" message is using a spaces instead of the required tab in the shell command line (here lines 2-3):
Code:
$ cat -nt Makefile                  
     1  message: 
     2  ^I@echo "Yes the operating system is IRIX!"
     3  ^I@echo "===" 
     4  
Yes the operating system is IRIX!
===
Here the required tabs displayed as '^I', short for CONTROL-I, are present. An expansion of this tab into spaces, for instance caused by a cut and paste operation, produces the "need an operator" error:
Code:
$ cat -nt Makefile ; make           
     1  message: 
     2          @echo "Yes the operating system is IRIX!"
     3          @echo "===" 
     4  
"Makefile", line 3: Need an operator
Fatal errors encountered -- cannot continue
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 23rd January 2009
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

As for the error, I found this thread, check Hubert Feyrer's response: http://arkiv.netbsd.se/?ml=netbsd-te...05-01&t=592114
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opera Port - conflicting pkgs in "make install" IronForge OpenBSD Packages and Ports 5 29th October 2009 05:10 AM
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" jb_daefo Guides 0 5th October 2009 09:31 PM
Thoughts on "make deinstall clean" Mantazz FreeBSD Ports and Packages 8 14th September 2009 06:45 PM
"Thanks" and "Edit Tags". diw Feedback and Suggestions 2 29th March 2009 12:06 AM
TIP:a nice way to make your pf more "stealth" marc OpenBSD Security 2 30th January 2009 09:39 PM


All times are GMT. The time now is 11:30 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick