Fix build under NetBSD with native X.org (/usr/X11R7) and modular X.org (/usr/pkg)
* Use pkg-config for X.org * Exclude -liconv for NetBSD too * sysctl(3) of NetBSD requres _NETBSD_SOURCE
This commit is contained in:
		
							parent
							
								
									715bda292b
								
							
						
					
					
						commit
						244e856e9f
					
				
							
								
								
									
										12
									
								
								src/Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/Makefile
									
									
									
									
									
								
							@ -508,17 +508,23 @@ endif
 | 
				
			|||||||
          COPT += -D_XOPEN_SOURCE=700
 | 
					          COPT += -D_XOPEN_SOURCE=700
 | 
				
			||||||
        endif
 | 
					        endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ifeq ($(PLATFORM), NetBSD)
 | 
				
			||||||
 | 
					          COPT += -D_NETBSD_SOURCE
 | 
				
			||||||
 | 
					        endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        LOPT = -lm
 | 
					        LOPT = -lm
 | 
				
			||||||
        ifeq ($(API),sdl)
 | 
					        ifeq ($(API),sdl)
 | 
				
			||||||
          LOPT += $(shell sdl-config --libs) -lSDL_image
 | 
					          LOPT += $(shell sdl-config --libs) -lSDL_image
 | 
				
			||||||
          ifneq ($(NO_X11),1)
 | 
					          ifneq ($(NO_X11),1)
 | 
				
			||||||
            LOPT += -lX11
 | 
					            LOPT += $(shell pkg-config --libs x11)
 | 
				
			||||||
 | 
					            COPT += $(shell pkg-config --cflags x11)
 | 
				
			||||||
          endif
 | 
					          endif
 | 
				
			||||||
        endif
 | 
					        endif
 | 
				
			||||||
        ifeq ($(API),sdl2)
 | 
					        ifeq ($(API),sdl2)
 | 
				
			||||||
          LOPT += $(shell sdl2-config --libs) -lSDL2_image
 | 
					          LOPT += $(shell sdl2-config --libs) -lSDL2_image
 | 
				
			||||||
          ifneq ($(NO_X11),1)
 | 
					          ifneq ($(NO_X11),1)
 | 
				
			||||||
            LOPT += -lX11
 | 
					            LOPT += $(shell pkg-config --libs x11)
 | 
				
			||||||
 | 
					            COPT += $(shell pkg-config --cflags x11)
 | 
				
			||||||
          endif
 | 
					          endif
 | 
				
			||||||
        endif
 | 
					        endif
 | 
				
			||||||
        ifeq ($(NO_X11),1)
 | 
					        ifeq ($(NO_X11),1)
 | 
				
			||||||
@ -534,7 +540,7 @@ endif
 | 
				
			|||||||
        # enable UTF8 filename translation
 | 
					        # enable UTF8 filename translation
 | 
				
			||||||
        # For Linux (GLibc), iconv is built into the C library so no LOPT needed.
 | 
					        # For Linux (GLibc), iconv is built into the C library so no LOPT needed.
 | 
				
			||||||
        COPT += -DENABLE_FILENAMES_ICONV
 | 
					        COPT += -DENABLE_FILENAMES_ICONV
 | 
				
			||||||
        ifneq ($(PLATFORM),Linux)
 | 
					        ifeq ($(filter-out NetBSD Linux, $(PLATFORM))),)
 | 
				
			||||||
          LOPT += -liconv
 | 
					          LOPT += -liconv
 | 
				
			||||||
        endif
 | 
					        endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user