@@ -522,89 +522,88 @@ ppHsc2hs bi lbi clbi =
522
522
where
523
523
ldflags =
524
524
map (" --lflag=" ++ ) $
525
- concat
526
- [ programDefaultArgs gccProg ++ programOverrideArgs gccProg
527
- , osxFrameworkDirs
528
- , [ arg
529
- | isOSX
530
- , opt <- map getSymbolicPath (PD. frameworks bi) ++ concatMap Installed. frameworks pkgs
531
- , arg <- [" -framework" , opt]
532
- ]
533
- , -- Note that on ELF systems, wherever we use -L, we must also use -R
534
- -- because presumably that -L dir is not on the normal path for the
535
- -- system's dynamic linker. This is needed because hsc2hs works by
536
- -- compiling a C program and then running it.
537
-
538
- -- Options from the current package:
539
- [ " -L" ++ u opt
540
- | opt <-
541
- if withFullyStaticExe lbi
542
- then PD. extraLibDirsStatic bi
543
- else PD. extraLibDirs bi
544
- ]
545
- , [ " -Wl,-R," ++ u opt
546
- | isELF
547
- , opt <-
548
- if withFullyStaticExe lbi
549
- then PD. extraLibDirsStatic bi
550
- else PD. extraLibDirs bi
551
- ]
552
- , [" -l" ++ opt | opt <- PD. extraLibs bi]
553
- , PD. ldOptions bi
554
- , -- Options from dependent packages
555
- [ opt
556
- | pkg <- pkgs
557
- , opt <-
558
- [" -L" ++ opt | opt <- Installed. libraryDirs pkg]
559
- ++ [ " -Wl,-R," ++ opt | isELF, opt <- Installed. libraryDirs pkg
560
- ]
561
- ++ [ " -l" ++ opt
562
- | opt <-
563
- if withFullyStaticExe lbi
564
- then Installed. extraLibrariesStatic pkg
565
- else Installed. extraLibraries pkg
566
- ]
567
- ++ Installed. ldOptions pkg
525
+ ordNub $
526
+ concat
527
+ [ programDefaultArgs gccProg ++ programOverrideArgs gccProg
528
+ , osxFrameworkDirs
529
+ , [ arg
530
+ | isOSX
531
+ , opt <- map getSymbolicPath (PD. frameworks bi) ++ concatMap Installed. frameworks pkgs
532
+ , arg <- [" -framework" , opt]
533
+ ]
534
+ , -- Note that on ELF systems, wherever we use -L, we must also use -R
535
+ -- because presumably that -L dir is not on the normal path for the
536
+ -- system's dynamic linker. This is needed because hsc2hs works by
537
+ -- compiling a C program and then running it.
538
+
539
+ -- Options from the current package:
540
+ [ " -L" ++ u opt
541
+ | opt <-
542
+ if withFullyStaticExe lbi
543
+ then PD. extraLibDirsStatic bi
544
+ else PD. extraLibDirs bi
545
+ ]
546
+ , [ " -Wl,-R," ++ u opt
547
+ | isELF
548
+ , opt <-
549
+ if withFullyStaticExe lbi
550
+ then PD. extraLibDirsStatic bi
551
+ else PD. extraLibDirs bi
552
+ ]
553
+ , [" -l" ++ opt | opt <- PD. extraLibs bi]
554
+ , PD. ldOptions bi
555
+ , -- Options from dependent packages
556
+ [ opt
557
+ | pkg <- pkgs
558
+ , opt <-
559
+ [" -L" ++ opt | opt <- Installed. libraryDirs pkg]
560
+ ++ [ " -Wl,-R," ++ opt | isELF, opt <- Installed. libraryDirs pkg
561
+ ]
562
+ ++ [ " -l" ++ opt
563
+ | opt <-
564
+ if withFullyStaticExe lbi
565
+ then Installed. extraLibrariesStatic pkg
566
+ else Installed. extraLibraries pkg
567
+ ]
568
+ ++ Installed. ldOptions pkg
569
+ ]
568
570
]
569
- ]
570
571
571
572
cflags =
572
573
map (" --cflag=" ++ ) $
573
- concat
574
- [ programDefaultArgs gccProg ++ programOverrideArgs gccProg
575
- , osxFrameworkDirs
576
- , platformDefines lbi
577
- , -- Options from the current package:
578
- [" -I" ++ u dir | dir <- PD. includeDirs bi]
579
- , [ " -I" ++ u (buildDir lbi </> unsafeCoerceSymbolicPath relDir)
580
- | relDir <- mapMaybe symbolicPathRelative_maybe $ PD. includeDirs bi
581
- ]
582
-
583
- , -- hsc2hs uses the C ABI
584
- -- We assume that there are only C sources
585
- -- and C++ functions are exported via a C
586
- -- interface and wrapped in a C source file.
587
- -- Therefore we do not supply C++ flags
588
- -- because there will not be C++ sources.
589
- --
590
- -- DO NOT add PD.cxxOptions unless this changes!
591
- PD. ccOptions bi ++ PD. cppOptions bi
592
-
593
- ,
594
- [ " -I" ++ u (autogenComponentModulesDir lbi clbi)
595
- , " -I" ++ u (autogenPackageModulesDir lbi)
596
- , " -include"
597
- , u $ autogenComponentModulesDir lbi clbi </> makeRelativePathEx cppHeaderName
598
- ]
599
-
600
- , -- Options from dependent packages
601
- [ opt
602
- | pkg <- pkgs
603
- , opt <-
604
- [" -I" ++ opt | opt <- Installed. includeDirs pkg]
605
- ++ Installed. ccOptions pkg
574
+ ordNub $
575
+ concat
576
+ [ programDefaultArgs gccProg ++ programOverrideArgs gccProg
577
+ , osxFrameworkDirs
578
+ , platformDefines lbi
579
+ , -- Options from the current package:
580
+ [" -I" ++ u dir | dir <- PD. includeDirs bi]
581
+ , [ " -I" ++ u (buildDir lbi </> unsafeCoerceSymbolicPath relDir)
582
+ | relDir <- mapMaybe symbolicPathRelative_maybe $ PD. includeDirs bi
583
+ ]
584
+ , -- hsc2hs uses the C ABI
585
+ -- We assume that there are only C sources
586
+ -- and C++ functions are exported via a C
587
+ -- interface and wrapped in a C source file.
588
+ -- Therefore we do not supply C++ flags
589
+ -- because there will not be C++ sources.
590
+ --
591
+ -- DO NOT add PD.cxxOptions unless this changes!
592
+ PD. ccOptions bi ++ PD. cppOptions bi
593
+ ,
594
+ [ " -I" ++ u (autogenComponentModulesDir lbi clbi)
595
+ , " -I" ++ u (autogenPackageModulesDir lbi)
596
+ , " -include"
597
+ , u $ autogenComponentModulesDir lbi clbi </> makeRelativePathEx cppHeaderName
598
+ ]
599
+ , -- Options from dependent packages
600
+ [ opt
601
+ | pkg <- pkgs
602
+ , opt <-
603
+ [" -I" ++ opt | opt <- Installed. includeDirs pkg]
604
+ ++ Installed. ccOptions pkg
605
+ ]
606
606
]
607
- ]
608
607
609
608
osxFrameworkDirs =
610
609
[ " -F" ++ opt
0 commit comments