Makefile: allow CONFIG_LDDIR=lib64 configuration
authorgrischka <grischka>
Mon, 4 Feb 2013 15:11:17 +0000 (4 16:11 +0100)
committergrischka <grischka>
Mon, 4 Feb 2013 15:24:58 +0000 (4 16:24 +0100)
Makefile
tcc.h

index d6a0a28..c3346de 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,17 +43,19 @@ endif
 endif
 
 ifeq ($(ARCH),i386)
-NATIVE_DEFINES=-DTCC_TARGET_I386 
-NATIVE_DEFINES+=$(if $(wildcard /lib/i386-linux-gnu),-DCONFIG_MULTIARCHDIR=\"i386-linux-gnu\")
-NATIVE_DEFINES+=$(if $(wildcard /lib/i386-kfreebsd-gnu),-DCONFIG_MULTIARCHDIR=\"i386-kfreebsd-gnu\")
-NATIVE_DEFINES+=$(if $(wildcard /lib/i386-gnu),-DCONFIG_MULTIARCHDIR=\"i386-gnu\")
+NATIVE_DEFINES=-DTCC_TARGET_I386
+NATIVE_DEFINES+=\
+  $(if $(wildcard /lib/i386-linux-gnu),-DCONFIG_MULTIARCHDIR=\"i386-linux-gnu\"\
+  $(if $(wildcard /lib/i386-kfreebsd-gnu),-DCONFIG_MULTIARCHDIR=\"i386-kfreebsd-gnu\"\
+  $(if $(wildcard /lib/i386-gnu),-DCONFIG_MULTIARCHDIR=\"i386-gnu\")))
 CFLAGS+=-m32
 else ifeq ($(ARCH),x86-64)
 NATIVE_DEFINES=-DTCC_TARGET_X86_64
 CFLAGS+=-m64
-NATIVE_DEFINES+=$(if $(wildcard /usr/lib64),-DCONFIG_LDDIR=\"lib64\")
-NATIVE_DEFINES+=$(if $(wildcard /lib/x86_64-linux-gnu),-DCONFIG_MULTIARCHDIR=\"x86_64-linux-gnu\")
-NATIVE_DEFINES+=$(if $(wildcard /lib/x86_64-kfreebsd-gnu),-DCONFIG_MULTIARCHDIR=\"x86_64-kfreebsd-gnu\")
+NATIVE_DEFINES+=\
+  $(if $(wildcard /usr/lib64),-DCONFIG_LDDIR=\"lib64\"\
+  $(if $(wildcard /lib/x86_64-linux-gnu),-DCONFIG_MULTIARCHDIR=\"x86_64-linux-gnu\"\
+  $(if $(wildcard /lib/x86_64-kfreebsd-gnu),-DCONFIG_MULTIARCHDIR=\"x86_64-kfreebsd-gnu\")))
 endif
 
 ifeq ($(ARCH),arm)
diff --git a/tcc.h b/tcc.h
index 5949ab6..b98025c 100644 (file)
--- a/tcc.h
+++ b/tcc.h
 # define CONFIG_SYSROOT ""
 #endif
 
-#ifdef CONFIG_MULTIARCHDIR
-# define CONFIG_LDDIR "lib/" CONFIG_MULTIARCHDIR
-#endif
-
 #ifndef CONFIG_LDDIR
-# define CONFIG_LDDIR "lib"
+# ifdef CONFIG_MULTIARCHDIR
+#  define CONFIG_LDDIR "lib/" CONFIG_MULTIARCHDIR
+# else
+#  define CONFIG_LDDIR "lib"
+# endif
 #endif
 
 /* path to find crt1.o, crti.o and crtn.o */