[mw-devel] MW3 r1024 - trunk/src

welshbyte at sucs.org welshbyte at sucs.org
Mon Mar 31 05:19:40 BST 2008


Author: welshbyte
Date: 2008-03-31 05:19:39 +0100 (Mon, 31 Mar 2008)
New Revision: 1024

Modified:
   trunk/src/Makefile
Log:
Choose between -ljs (Fedora's lib) and -lmozjs (Debian's lib) dynamically.
This allows `make` to work on both Fedora and Debian without passing extra
options to it.


Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	2008-03-30 02:40:55 UTC (rev 1023)
+++ trunk/src/Makefile	2008-03-31 04:19:39 UTC (rev 1024)
@@ -14,7 +14,8 @@
 VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_TWEAK)
 
 # Name of the js library (differs between distros)
-JSLIB=js
+JSLIB=$(shell if `echo "main(){}" | gcc -x c -ljs - 2> /dev/null`; then echo js; else echo mozjs; fi; rm -f a.out)
+CPPFLAGS+=-I/usr/include/mozjs
 
 # cflags for standard 'cc' compiler
 ALL_CFLAGS+= -Wall -pedantic -fpie -std=gnu99 -D_GNU_SOURCE





More information about the mw-devel mailing list