forked from bonsai/harakit
		
	configure: now you can do multiple compilers!
This commit is contained in:
		
							parent
							
								
									f99cc797e6
								
							
						
					
					
						commit
						5e1749ca43
					
				
							
								
								
									
										44
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										44
									
								
								configure
									
									
									
									
										vendored
									
									
								
							| @ -14,26 +14,30 @@ RUSTFLAGS='-Copt-level=z -Ccodegen-units=1 -Cpanic=abort -Clto=y \ | ||||
| 	-Cstrip=symbols -Ctarget-cpu=native \ | ||||
| 	--extern sysexits=build/o/libsysexits.rlib' | ||||
| 
 | ||||
| case "$@" in | ||||
| 	clang) | ||||
| 		CFLAGS="$CFLAGS -Wall" | ||||
| 		;; | ||||
| 	clean) | ||||
| 		rm *.mk || true | ||||
| 		exit 0 | ||||
| 		;; | ||||
| 	gcc) | ||||
| 		CFLAGS="$CFLAGS -s -Wl,-z,noseparate-code,-z,nosectionheader -flto" | ||||
| 		;; | ||||
| 	'rustc +nightly') | ||||
| 		RUSTFLAGS="+nightly -Zlocation-detail=none $RUSTFLAGS" | ||||
| 		;; | ||||
| 	'') ;; | ||||
| 	*) | ||||
| 		printf 'Usage: %s [compiler]\n' "$0" | ||||
| 		exit 64 # sysexits.h(3) EX_USAGE | ||||
| 		;; | ||||
| esac | ||||
| if [ "$1" = "clean" ]; then | ||||
| 	rm *.mk || true | ||||
| 	exit 0 | ||||
| fi | ||||
| 
 | ||||
| while test -n "$1"; do | ||||
| 	case "$1" in | ||||
| 		clang) | ||||
| 			CFLAGS="$CFLAGS -Wall" | ||||
| 			;; | ||||
| 		gcc) | ||||
| 			CFLAGS="$CFLAGS -s -Wl,-z,noseparate-code,-z,nosectionheader -flto" | ||||
| 			;; | ||||
| 		'rustc +nightly') | ||||
| 			RUSTFLAGS="+nightly -Zlocation-detail=none $RUSTFLAGS" | ||||
| 			;; | ||||
| 		*) | ||||
| 			printf 'Usage: %s [clean | compiler]\n' "$0" | ||||
| 			exit 64 # sysexits.h(3) EX_USAGE | ||||
| 			;; | ||||
| 	esac | ||||
| 
 | ||||
| 	shift | ||||
| done | ||||
| 
 | ||||
| printf 'CFLAGS=%s\n' "$CFLAGS" >cc.mk | ||||
| printf 'RUSTFLAGS=%s\n' "$RUSTFLAGS" >rustc.mk | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user