1 rule -configure-options-help- {
2 Echo "jam configure supports" ;
3 Echo " --prefix=dir [/usr/local]" ;
4 Echo " --debug build with debug symbols" ;
5 Echo " --tests build tests" ;
6 Echo " --install-arch install to multiarch directory" ;
7 Echo " --shared build with shared library" ;
11 rule -configure-options-debug- {
15 rule -configure-options-tests- {
19 rule -configure-options-install-arch- {
23 rule -configure-test-gmp- {
25 -configure-test-compile-cc- "libgmp" :
29 "mpz_init_set_str(x, "1234567", 10);"
36 # $(1) -- program, string list
37 # $(2) -- additional compiler flags (optional)
38 # $(3) -- additional linker flags (optional)
39 rule -configure-try-exec-cc- {
43 local tfn = [ RandName ] ;
45 if [ ListWrite $(tfn) : $(1) ] {
46 rc = [ Command $(CC) $(CFLAGS.all) -c $(tfn:Q) -o $(tfn:S=.o:Q) $(2) '2>/dev/null' : exit-code no-output ] ;
48 rc = [ Command $(LINK) $(tfn:S=.o:Q) -o $(tfn:S=.elf:Q) $(3) '2>/dev/null' : exit-code no-output ] ;
50 res = [ Command $(tfn:S=.elf:Q) : parse-output no-space-break no-tab-break no-cr-break ] ;
53 Command rm $(tfn:Q) $(tfn:S=.o:Q) $(tfn:S=.elf:Q) '2>/dev/null' ;
60 # $(2) -- program, string list
61 # $(3) -- additional compiler flags (optional)
62 # $(4) -- additional linker flags (optional)
63 rule -configure-test-exec-cc- {
65 Echo 'generate code for' $(1) '... ' : -n ;
66 r = [ -configure-try-exec-cc- $(2) : $(3) : $(4) ] ;
68 if ( $(r) = "-D__m32__" ) {
70 } else if ( $(r) = "-D__m64__" ) {
80 rule -configure-test-arch- {
82 -configure-test-exec-cc- "" :
85 "switch (sizeof(void*)) {"
86 "case 4: printf(\"-D__m32__\"); break;"
87 "case 8: printf(\"-D__m64__\"); break;"
99 local arch = [ -configure-test-arch- ] ;
102 if ( $(arch) = '-D__m32__' ) {
103 ARCH_LIB = "/i386-linux-gnu" ;
105 ARCH_LIB = "/x86_64-linux-gnu" ;
108 if ( $(arch) = '-D__m32__' ) {
109 ARCH_LIB = "/powerpc-aix-ibm" ;
111 ARCH_LIB = "/powerpc64-aix-ibm" ;
114 if ! $(INSTALLARCH) {
118 Exit "Architecture not supported" ;
121 local pl = [ Command "echo $(ARCH_LIB) | sed \"s/\\//\\\\\\\\\\\//g\"" : dummy ] ;
122 -configure-add-line- "ARCH_LIB = $(ARCH_LIB) ;" ;
123 -configure-pkg-config-necessary-
126 local pp = [ Command "echo $(PREFIX) | sed \"s/\\//\\\\\\\\\\\//g\"" : dummy ] ;
127 if [ -configure-test-gmp- ] == 1 {
128 -configure-add-line- "CFLAGS.all += -DHAVE_GMP ;" ;
129 -configure-add-line- "LINKLIBS.all += -lgmp ;" ;
130 Command "sed -e \"s/@prefix/\\$(pp)/\" -e \"s/@cflags/-DHAVE_GMP/\" ./libpgcli.pc.in > ./libpgcli.pc" ;
132 Command "sed -e \"s/@prefix/\\$(pp)/\" -e \"s/@cflags//\" ./libpgcli.pc.in > ./libpgcli.pc" ;
136 -configure-add-line- "CFLAGS.all += -O0 -g3 ;" ;
138 -configure-add-line- "CFLAGS.all += -O0 -g ;" ;
141 -configure-add-line- "set-profile ;" ;
143 -configure-add-line- "BUILDDEBUG =" "$(BUILDDEBUG)" ";" ;
144 -configure-add-line- "BUILDTESTS =" "$(BUILDTESTS)" ";" ;
145 -configure-add-line- "INSTALLARCH =" "$(INSTALLARCH)" ";" ;
148 rule -configure-preinit- {